diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c5816f62749c..7df490449af3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -90,7 +90,7 @@ # ServiceOwners: @Azure/aks-pm # ServiceLabel: %Alerts Management -# ServiceOwners: @liadtal @yairgil +# ServiceOwners: @yairgil # ServiceLabel: %ARM # ServiceOwners: @armleads-azure @@ -1039,12 +1039,6 @@ # ServiceLabel: %Operator Nexus - Network Cloud %Mgmt # ServiceOwners: @Azure/azure-sdk-write-networkcloud -# PRLabel: %Oracle -/sdk/oracle/Azure.ResourceManager.*/ @v-jamcheung @v-rvilathurs @v-eelhomsi - -# ServiceLabel: %Oracle %Mgmt -# ServiceOwners: @v-jamcheung @v-rvilathurs @v-eelhomsi - # PRLabel: %Quota /sdk/quota/Azure.ResourceManager.*/ @tejasm-microsoft diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 32ec1923940d..49bfb9aee781 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -58,7 +58,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240917.2 + --version 1.0.0-dev.20241206.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash @@ -118,7 +118,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240917.2 + --version 1.0.0-dev.20241206.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.github/workflows/scheduled-event-processor.yml b/.github/workflows/scheduled-event-processor.yml index d3a01442bef8..a726ee36097e 100644 --- a/.github/workflows/scheduled-event-processor.yml +++ b/.github/workflows/scheduled-event-processor.yml @@ -39,7 +39,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240917.2 + --version 1.0.0-dev.20241206.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 60a4e21f8c97..2065b559fa8a 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -264,7 +264,7 @@ "Hvci" ] }, - { + { "filename": "**/sdk/computefleet/**/*.cs", "words": [ "Rdma" @@ -917,7 +917,7 @@ ] }, { - "filename": "**/sdk/maps/Azure.Maps.TimeZone/**/*.cs", + "filename": "**/sdk/maps/Azure.Maps.TimeZones/**/*.cs", "words": [ "Posix", "posix", @@ -1618,7 +1618,19 @@ "AOAI", "Rerank" ] + }, + { + "filename": "**/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/*.cs", + "words": [ + "prebuilts" + ] + }, + { + "filename": "**/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/*.cs", + "words": [ + "prebuilts" + ] } ], "allowCompoundWords": true -} +} \ No newline at end of file diff --git a/doc/DataPlaneCodeGeneration/Autorest_DataPlane_Quickstart.md b/doc/DataPlaneCodeGeneration/Autorest_DataPlane_Quickstart.md index 34075c931439..d5344ec69140 100644 --- a/doc/DataPlaneCodeGeneration/Autorest_DataPlane_Quickstart.md +++ b/doc/DataPlaneCodeGeneration/Autorest_DataPlane_Quickstart.md @@ -62,16 +62,16 @@ sdk\\\CHANGELOG.md We will use dotnet project template [Azure.Template](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template) to automatically create the project. -You can run `eng\scripts\automation\Invoke-DataPlaneGenerateSDKPackage.ps1` to generate the starting SDK client library package directly as following: +You can run `eng\scripts\automation\Invoke-AutorestDataPlaneGenerateSDKPackage.ps1` to generate the starting SDK client library package directly as following: ```powershell -eng/scripts/automation/Invoke-DataPlaneGenerateSDKPackage.ps1 -service -namespace Azure.. -sdkPath [-inputfiles ] [-readme ] [-securityScope ] [-securityHeaderName ] +eng/scripts/automation/Invoke-AutorestDataPlaneGenerateSDKPackage.ps1 -service -namespace Azure.. -sdkPath [-inputfiles ] [-readme ] [-securityScope ] [-securityHeaderName ] ``` e.g. ```powershell -pwsh /home/azure-sdk-for-net/eng/scripts/automation/Invoke-DataPlaneGenerateSDKPackage.ps1 -service webpubsub -namespace Azure.Messaging.WebPubSub -sdkPath /home/azure-sdk-for-net -inputfiles https://github.com/Azure/azure-rest-api-specs/blob/73a0fa453a93bdbe8885f87b9e4e9fef4f0452d0/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/webpubsub.json -securityScope https://sample/.default +pwsh /home/azure-sdk-for-net/eng/scripts/automation/Invoke-AutorestDataPlaneGenerateSDKPackage.ps1 -service webpubsub -namespace Azure.Messaging.WebPubSub -sdkPath /home/azure-sdk-for-net -inputfiles https://github.com/Azure/azure-rest-api-specs/blob/73a0fa453a93bdbe8885f87b9e4e9fef4f0452d0/specification/webpubsub/data-plane/WebPubSub/stable/2021-10-01/webpubsub.json -securityScope https://sample/.default ``` **Note**: @@ -85,7 +85,7 @@ pwsh /home/azure-sdk-for-net/eng/scripts/automation/Invoke-DataPlaneGenerateSDKP - `-securityScope` designates the authentication scope to use if your library supports **Token Credential** authentication. - `-securityHeaderName` designates the key to use if your library supports **Azure Key Credential** authentication. -When you run the `eng\scripts\automation\Invoke-DataPlaneGenerateSDKPackage.ps1` script, it will: +When you run the `eng\scripts\automation\Invoke-AutorestDataPlaneGenerateSDKPackage.ps1` script, it will: - Create a project folder, install template files from `sdk/template/Azure.Template`, and create `.csproj` and `.sln` files for your new library. diff --git a/doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md b/doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md index 0ff56e445393..77da0babb463 100644 --- a/doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md +++ b/doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md @@ -17,8 +17,8 @@ sdk\\\.sln - `` - Should be the name of the shipping package, or an abbreviation that distinguishes the given shipping artifact for the given service. It will be `Azure..`, e.g. Azure.IoT.DeviceUpdate ## Create sdk package - -We will use the Azure SDK template [Azure.Template](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template) to create the initial project skeleton. + +We will use the Azure SDK template [Azure.Template](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template) to create the initial project skeleton for SDKs generated from TypeSpec. You can run `eng\scripts\automation\Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1` to generate the starting SDK client library package directly as following: @@ -26,7 +26,7 @@ You can run `eng\scripts\automation\Invoke-TypeSpecDataPlaneGenerateSDKPackage.p eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 -sdkFolder -typespecSpecDirectory -commit [-repo ] [-additionalSubDirectories ] ``` -e.g. +e.g. Use git url ```powershell diff --git a/eng/ApiListing.exclude-attributes.txt b/eng/ApiListing.exclude-attributes.txt index 4fbcb9b4f4bf..671f403ae17b 100644 --- a/eng/ApiListing.exclude-attributes.txt +++ b/eng/ApiListing.exclude-attributes.txt @@ -3,6 +3,7 @@ T:System.Runtime.CompilerServices.AsyncStateMachineAttribute T:System.Runtime.CompilerServices.CompilerGeneratedAttribute T:System.Runtime.CompilerServices.NullableContextAttribute T:System.Runtime.CompilerServices.NullableAttribute +T:System.Runtime.CompilerServices.IsReadOnlyAttribute T:Azure.Core.CodeGenSuppressAttribute T:Azure.Core.CodeGenModelAttribute T:Azure.Core.CodeGenMemberAttribute diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index a5a929bc508f..04d89f7c4fd2 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -186,7 +186,7 @@ - + @@ -194,6 +194,11 @@ + + + + + - + @@ -254,7 +259,7 @@ - + -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.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/ai/Azure.AI.Inference/README.png) diff --git a/sdk/ai/Azure.AI.Inference/samples/README.md b/sdk/ai/Azure.AI.Inference/samples/README.md index 704f40ef2210..8e88891d0089 100644 --- a/sdk/ai/Azure.AI.Inference/samples/README.md +++ b/sdk/ai/Azure.AI.Inference/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.AI.Inference samples for .NET description: Samples for the Azure.AI.Inference client library. diff --git a/sdk/ai/Azure.AI.Projects/CHANGELOG.md b/sdk/ai/Azure.AI.Projects/CHANGELOG.md index 610241142b1e..d761aabbbd3d 100644 --- a/sdk/ai/Azure.AI.Projects/CHANGELOG.md +++ b/sdk/ai/Azure.AI.Projects/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.3 (Unreleased) ### Features Added @@ -10,6 +10,19 @@ ### Other Changes +## 1.0.0-beta.2 (2024-12-13) + +### Features Added + +* Added `AzureFunctionToolDefinition` support to inform Agents about Azure Functions. +* Added `OpenApiTool` for Agents, which creates and executes a REST function defined by an OpenAPI spec. +* Add `parallelToolCalls` parameter to `CreateRunRequest`, `CreateRunAsync`, `CreateRunStreaming` and `CreateRunStreamingAsync`, which allows parallel tool execution for Agents. + +### Bugs Fixed + +* Fix a bug preventing additional messages to be created when using `CreateRunStreamingAsync` and `CreateRunAsync` see [issue](https://github.com/Azure/azure-sdk-for-net/issues/47244). +* Fixed a bug where an exception would occur when run was not completed due to RAI check fail see [issue](https://github.com/Azure/azure-sdk-for-net/issues/47243). + ## 1.0.0-beta.1 (2024-11-19) ### Features Added diff --git a/sdk/ai/Azure.AI.Projects/README.md b/sdk/ai/Azure.AI.Projects/README.md index 289cf65ef206..d2622bf48c11 100644 --- a/sdk/ai/Azure.AI.Projects/README.md +++ b/sdk/ai/Azure.AI.Projects/README.md @@ -4,6 +4,12 @@ Use the AI Projects client library to: * **Develop Agents using the Azure AI Agent Service**, leveraging an extensive ecosystem of models, tools, and capabilities from OpenAI, Microsoft, and other LLM providers. The Azure AI Agent Service enables the building of Agents for a wide range of generative AI use cases. The package is currently in preview. * **Enumerate connections** in your Azure AI Studio project and get connection properties. For example, get the inference endpoint URL and credentials associated with your Azure OpenAI connection. +[Product documentation][product_doc] +| [Samples][samples] +| [API reference documentation][api_ref_docs] +| [Package (NuGet)][nuget] +| [SDK source code][source_code] + ## Table of contents - [Getting started](#getting-started) @@ -20,6 +26,9 @@ Use the AI Projects client library to: - [Retrieve messages](#retrieve-messages) - [File search](#file-search) - [Function call](#function-call) + - [Azure function call](#azure-function-call) + - [Azure Function Call](#create-agent-with-azure-function-call) + - [OpenAPI](#create-agent-with-openapi) - [Troubleshooting](#troubleshooting) - [Next steps](#next-steps) - [Contributing](#contributing) @@ -347,6 +356,126 @@ while (runResponse.Value.Status == RunStatus.Queued || runResponse.Value.Status == RunStatus.InProgress); ``` +#### Azure function call + +We also can use Azure Function from inside the agent. In the example below we are calling function "foo", which responds "Bar". In this example we create `AzureFunctionToolDefinition` object, with the function name, description, input and output queues, followed by function parameters. +```C# Snippet:AzureFunctionsDefineFunctionTools +AzureFunctionToolDefinition azureFnTool = new( + name: "foo", + description: "Get answers from the foo bot.", + inputBinding: new AzureFunctionBinding( + new AzureFunctionStorageQueue( + queueName: "azure-function-foo-input", + storageServiceEndpoint: storageQueueUri + ) + ), + outputBinding: new AzureFunctionBinding( + new AzureFunctionStorageQueue( + queueName: "azure-function-tool-output", + storageServiceEndpoint: storageQueueUri + ) + ), + parameters: BinaryData.FromObjectAsJson( + new + { + Type = "object", + Properties = new + { + query = new + { + Type = "string", + Description = "The question to ask.", + }, + outputqueueuri = new + { + Type = "string", + Description = "The full output queue uri." + } + }, + }, + new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase } + ) +); +``` + +Note that in this scenario we are asking agent to supply storage queue URI to the azure function whenever it is called. +```C# Snippet:AzureFunctionsCreateAgentWithFunctionTools +Response agentResponse = await client.CreateAgentAsync( + model: "gpt-4", + name: "azure-function-agent-foo", + instructions: "You are a helpful support agent. Use the provided function any " + + "time the prompt contains the string 'What would foo say?'. When you invoke " + + "the function, ALWAYS specify the output queue uri parameter as " + + $"'{storageQueueUri}/azure-function-tool-output'. Always responds with " + + "\"Foo says\" and then the response from the tool.", + tools: new List { azureFnTool } + ); +Agent agent = agentResponse.Value; +``` + +After we have created a message with request to ask "What would foo say?", we need to wait while the run is in queued, in progress or requires action states. +```C# Snippet:AzureFunctionsHandlePollingWithRequiredAction +Response messageResponse = await client.CreateMessageAsync( + thread.Id, + MessageRole.User, + "What is the most prevalent element in the universe? What would foo say?"); +ThreadMessage message = messageResponse.Value; + +Response runResponse = await client.CreateRunAsync(thread, agent); + +do +{ + await Task.Delay(TimeSpan.FromMilliseconds(500)); + runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id); +} +while (runResponse.Value.Status == RunStatus.Queued + || runResponse.Value.Status == RunStatus.InProgress + || runResponse.Value.Status == RunStatus.RequiresAction); +``` + +#### Create Agent With OpenAPI + +OpenAPI specifications describe REST operations against a specific endpoint. Agents SDK can read an OpenAPI spec, create a function from it, and call that function against the REST endpoint without additional client-side execution. + +Here is an example creating an OpenAPI tool (using anonymous authentication): +```C# Snippet:OpenAPIDefineFunctionTools +OpenApiAnonymousAuthDetails oaiAuth = new(); +OpenApiToolDefinition openapiTool = new( + name: "get_weather", + description: "Retrieve weather information for a location", + spec: BinaryData.FromBytes(File.ReadAllBytes(file_path)), + auth: oaiAuth +); + +Response agentResponse = await client.CreateAgentAsync( + model: "gpt-4", + name: "azure-function-agent-foo", + instructions: "You are a helpful assistant.", + tools: new List { openapiTool } + ); +Agent agent = agentResponse.Value; +``` + +In this example we are using the `weather_openapi.json` file and agent will request the wttr.in website for the weather in a location fron the prompt. +```C# Snippet:OpenAPIHandlePollingWithRequiredAction +Response messageResponse = await client.CreateMessageAsync( + thread.Id, + MessageRole.User, + "What's the weather in Seattle?"); +ThreadMessage message = messageResponse.Value; + +Response runResponse = await client.CreateRunAsync(thread, agent); + +do +{ + await Task.Delay(TimeSpan.FromMilliseconds(500)); + runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id); +} +while (runResponse.Value.Status == RunStatus.Queued + || runResponse.Value.Status == RunStatus.InProgress + || runResponse.Value.Status == RunStatus.RequiresAction); +``` + ## Troubleshooting Any operation that fails will throw a [RequestFailedException][RequestFailedException]. The exception's `code` will hold the HTTP response status code. The exception's `message` contains a detailed message that may be helpful in diagnosing the issue: @@ -385,6 +514,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [RequestFailedException]: https://learn.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet [samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Projects/tests/Samples +[api_ref_docs]: https://learn.microsoft.com/dotnet/api/azure.ai.projects?view=azure-dotnet-preview +[nuget]: https://www.nuget.org/packages/Azure.AI.Projects +[source_code]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Projects +[product_doc]: https://learn.microsoft.com/azure/ai-studio/ [azure_identity]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet [azure_identity_dac]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [aiprojects_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs index 8c6e275544ff..60548c9993aa 100644 --- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs +++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs @@ -199,18 +199,18 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task CreateMessageAsync(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateRun(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateRun(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateRunAsync(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateRunAsync(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.ClientModel.CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.ClientModel.AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.ClientModel.CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.ClientModel.AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThread(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateThread(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThreadAndRun(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateThreadAndRun(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateThreadAndRun(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAndRunAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateThreadAsync(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStore(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -391,6 +391,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.AI.Projects.AgentStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.AgentStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -454,7 +455,7 @@ public static partial class AIClientModelFactory public static Azure.AI.Projects.RunStepFunctionToolCall RunStepFunctionToolCall(string id, string name, string arguments, string output) { throw null; } public static Azure.AI.Projects.SubmitToolOutputsAction SubmitToolOutputsAction(System.Collections.Generic.IEnumerable toolCalls) { throw null; } public static Azure.AI.Projects.ThreadMessage ThreadMessage(string id = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), string threadId = null, Azure.AI.Projects.MessageStatus status = default(Azure.AI.Projects.MessageStatus), Azure.AI.Projects.MessageIncompleteDetails incompleteDetails = null, System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? incompleteAt = default(System.DateTimeOffset?), Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable contentItems = null, string agentId = null, string runId = null, System.Collections.Generic.IEnumerable attachments = null, System.Collections.Generic.IDictionary metadata = null) { throw null; } - public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails? incompleteDetails = default(Azure.AI.Projects.IncompleteRunDetails?), Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } + public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails incompleteDetails = null, Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } } public partial class AIProjectClient { @@ -483,6 +484,7 @@ public static partial class AIProjectsModelFactory { public static Azure.AI.Projects.AgentPageableListOfVectorStore AgentPageableListOfVectorStore(Azure.AI.Projects.AgentPageableListOfVectorStoreObject @object = default(Azure.AI.Projects.AgentPageableListOfVectorStoreObject), System.Collections.Generic.IEnumerable data = null, string firstId = null, string lastId = null, bool hasMore = false) { throw null; } public static Azure.AI.Projects.AgentPageableListOfVectorStoreFile AgentPageableListOfVectorStoreFile(Azure.AI.Projects.AgentPageableListOfVectorStoreFileObject @object = default(Azure.AI.Projects.AgentPageableListOfVectorStoreFileObject), System.Collections.Generic.IEnumerable data = null, string firstId = null, string lastId = null, bool hasMore = false) { throw null; } + public static Azure.AI.Projects.AzureFunctionBinding AzureFunctionBinding(Azure.AI.Projects.AzureFunctionBindingType type = default(Azure.AI.Projects.AzureFunctionBindingType), Azure.AI.Projects.AzureFunctionStorageQueue storageQueue = null) { throw null; } public static Azure.AI.Projects.ConnectionProperties ConnectionProperties(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null) { throw null; } public static Azure.AI.Projects.ConnectionPropertiesApiKeyAuth ConnectionPropertiesApiKeyAuth(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null, Azure.AI.Projects.CredentialsApiKeyAuth credentials = null) { throw null; } public static Azure.AI.Projects.ConnectionResponse ConnectionResponse(string id = null, string name = null, Azure.AI.Projects.ConnectionProperties properties = null) { throw null; } @@ -490,6 +492,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.Evaluation Evaluation(string id = null, Azure.AI.Projects.InputData data = null, string displayName = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string status = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary evaluators = null) { throw null; } public static Azure.AI.Projects.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string isEnabled = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } + public static Azure.AI.Projects.IncompleteRunDetails IncompleteRunDetails(Azure.AI.Projects.IncompleteDetailsReason reason = default(Azure.AI.Projects.IncompleteDetailsReason)) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } public static Azure.AI.Projects.MessageDeltaChunk MessageDeltaChunk(string id = null, Azure.AI.Projects.MessageDeltaChunkObject @object = default(Azure.AI.Projects.MessageDeltaChunkObject), Azure.AI.Projects.MessageDelta delta = null) { throw null; } @@ -609,6 +612,62 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureFunctionBinding : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureFunctionBinding(Azure.AI.Projects.AzureFunctionStorageQueue storageQueue) { } + public Azure.AI.Projects.AzureFunctionStorageQueue StorageQueue { get { throw null; } set { } } + public Azure.AI.Projects.AzureFunctionBindingType Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionBinding System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionBinding System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureFunctionBindingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureFunctionBindingType(string value) { throw null; } + public static Azure.AI.Projects.AzureFunctionBindingType StorageQueue { get { throw null; } } + public bool Equals(Azure.AI.Projects.AzureFunctionBindingType 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.Projects.AzureFunctionBindingType left, Azure.AI.Projects.AzureFunctionBindingType right) { throw null; } + public static implicit operator Azure.AI.Projects.AzureFunctionBindingType (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.AzureFunctionBindingType left, Azure.AI.Projects.AzureFunctionBindingType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureFunctionStorageQueue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName) { } + public string QueueName { get { throw null; } set { } } + public string StorageServiceEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionStorageQueue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionStorageQueue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureFunctionToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureFunctionToolDefinition(string name, string description, Azure.AI.Projects.AzureFunctionBinding inputBinding, Azure.AI.Projects.AzureFunctionBinding outputBinding, System.BinaryData parameters) { } + public string Description { get { throw null; } } + public string Name { get { throw null; } } + public System.BinaryData Parameters { get { throw null; } } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionToolDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class BingGroundingToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BingGroundingToolDefinition(Azure.AI.Projects.ToolConnectionList bingGrounding) { } @@ -1011,23 +1070,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct IncompleteRunDetails : System.IEquatable + public readonly partial struct IncompleteDetailsReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public IncompleteRunDetails(string value) { throw null; } - public static Azure.AI.Projects.IncompleteRunDetails MaxCompletionTokens { get { throw null; } } - public static Azure.AI.Projects.IncompleteRunDetails MaxPromptTokens { get { throw null; } } - public bool Equals(Azure.AI.Projects.IncompleteRunDetails other) { throw null; } + public IncompleteDetailsReason(string value) { throw null; } + public static Azure.AI.Projects.IncompleteDetailsReason MaxCompletionTokens { get { throw null; } } + public static Azure.AI.Projects.IncompleteDetailsReason MaxPromptTokens { get { throw null; } } + public bool Equals(Azure.AI.Projects.IncompleteDetailsReason 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.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } - public static implicit operator Azure.AI.Projects.IncompleteRunDetails (string value) { throw null; } - public static bool operator !=(Azure.AI.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } + public static bool operator ==(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } + public static implicit operator Azure.AI.Projects.IncompleteDetailsReason (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } public override string ToString() { throw null; } } + public partial class IncompleteRunDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IncompleteRunDetails() { } + public Azure.AI.Projects.IncompleteDetailsReason Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class IndexResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IndexResource(string indexConnectionId, string indexName) { } @@ -1082,7 +1152,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MessageAttachment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MessageAttachment(System.Collections.Generic.IEnumerable tools) { } - public System.Collections.Generic.IList DataSources { get { throw null; } } + public Azure.AI.Projects.VectorStoreDataSource DataSource { get { throw null; } set { } } public string FileId { get { throw null; } set { } } public System.Collections.Generic.IList Tools { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1430,8 +1500,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class MicrosoftFabricToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList microsoftFabric) { } - public Azure.AI.Projects.ToolConnectionList MicrosoftFabric { get { throw null; } set { } } + public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList fabricAiskill) { } + public Azure.AI.Projects.ToolConnectionList FabricAiskill { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MicrosoftFabricToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1439,6 +1509,96 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class OpenApiAnonymousAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiAnonymousAuthDetails() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAnonymousAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAnonymousAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class OpenApiAuthDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected OpenApiAuthDetails() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiConnectionAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiConnectionAuthDetails(Azure.AI.Projects.OpenApiConnectionSecurityScheme securityScheme) { } + public Azure.AI.Projects.OpenApiConnectionSecurityScheme SecurityScheme { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiConnectionSecurityScheme : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiConnectionSecurityScheme(string connectionId) { } + public string ConnectionId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionSecurityScheme System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionSecurityScheme System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiFunctionDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiFunctionDefinition(string name, System.BinaryData spec, Azure.AI.Projects.OpenApiAuthDetails auth) { } + public Azure.AI.Projects.OpenApiAuthDetails Auth { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Spec { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiFunctionDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiFunctionDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiManagedAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiManagedAuthDetails(Azure.AI.Projects.OpenApiManagedSecurityScheme securityScheme) { } + public Azure.AI.Projects.OpenApiManagedSecurityScheme SecurityScheme { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiManagedSecurityScheme : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiManagedSecurityScheme(string audience) { } + public string Audience { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedSecurityScheme System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedSecurityScheme System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiToolDefinition(Azure.AI.Projects.OpenApiFunctionDefinition openapi) { } + public OpenApiToolDefinition(string name, string description, System.BinaryData spec, Azure.AI.Projects.OpenApiAuthDetails auth) { } + public Azure.AI.Projects.OpenApiFunctionDefinition Openapi { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiToolDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class PageableList : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { internal PageableList() { } @@ -2102,6 +2262,7 @@ internal RunStepUpdate() { } public static Azure.AI.Projects.RunStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.RunStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -2261,14 +2422,14 @@ internal ThreadRun() { } public System.DateTimeOffset? ExpiresAt { get { throw null; } } public System.DateTimeOffset? FailedAt { get { throw null; } } public string Id { get { throw null; } } - public Azure.AI.Projects.IncompleteRunDetails? IncompleteDetails { get { throw null; } } + public Azure.AI.Projects.IncompleteRunDetails IncompleteDetails { get { throw null; } } public string Instructions { get { throw null; } } public Azure.AI.Projects.RunError LastError { get { throw null; } } public int? MaxCompletionTokens { get { throw null; } } public int? MaxPromptTokens { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public string Model { get { throw null; } } - public bool? ParallelToolCalls { get { throw null; } } + public bool ParallelToolCalls { get { throw null; } } public Azure.AI.Projects.RequiredAction RequiredAction { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredActions { get { throw null; } } public System.BinaryData ResponseFormat { get { throw null; } } @@ -2546,10 +2707,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public enum VectorStoreDataSourceAssetType + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VectorStoreDataSourceAssetType : System.IEquatable { - UriAsset = 0, - IdAsset = 1, + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorStoreDataSourceAssetType(string value) { throw null; } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType IdAsset { get { throw null; } } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType UriAsset { get { throw null; } } + public bool Equals(Azure.AI.Projects.VectorStoreDataSourceAssetType 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.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public static implicit operator Azure.AI.Projects.VectorStoreDataSourceAssetType (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public override string ToString() { throw null; } } public partial class VectorStoreDeletionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs index 8c6e275544ff..60548c9993aa 100644 --- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs +++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs @@ -199,18 +199,18 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task CreateMessageAsync(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateRun(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateRun(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateRunAsync(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateRunAsync(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.ClientModel.CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.ClientModel.AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.ClientModel.CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.ClientModel.AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThread(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateThread(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThreadAndRun(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateThreadAndRun(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateThreadAndRun(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAndRunAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateThreadAsync(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStore(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -391,6 +391,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.AI.Projects.AgentStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.AgentStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -454,7 +455,7 @@ public static partial class AIClientModelFactory public static Azure.AI.Projects.RunStepFunctionToolCall RunStepFunctionToolCall(string id, string name, string arguments, string output) { throw null; } public static Azure.AI.Projects.SubmitToolOutputsAction SubmitToolOutputsAction(System.Collections.Generic.IEnumerable toolCalls) { throw null; } public static Azure.AI.Projects.ThreadMessage ThreadMessage(string id = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), string threadId = null, Azure.AI.Projects.MessageStatus status = default(Azure.AI.Projects.MessageStatus), Azure.AI.Projects.MessageIncompleteDetails incompleteDetails = null, System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? incompleteAt = default(System.DateTimeOffset?), Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable contentItems = null, string agentId = null, string runId = null, System.Collections.Generic.IEnumerable attachments = null, System.Collections.Generic.IDictionary metadata = null) { throw null; } - public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails? incompleteDetails = default(Azure.AI.Projects.IncompleteRunDetails?), Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } + public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails incompleteDetails = null, Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } } public partial class AIProjectClient { @@ -483,6 +484,7 @@ public static partial class AIProjectsModelFactory { public static Azure.AI.Projects.AgentPageableListOfVectorStore AgentPageableListOfVectorStore(Azure.AI.Projects.AgentPageableListOfVectorStoreObject @object = default(Azure.AI.Projects.AgentPageableListOfVectorStoreObject), System.Collections.Generic.IEnumerable data = null, string firstId = null, string lastId = null, bool hasMore = false) { throw null; } public static Azure.AI.Projects.AgentPageableListOfVectorStoreFile AgentPageableListOfVectorStoreFile(Azure.AI.Projects.AgentPageableListOfVectorStoreFileObject @object = default(Azure.AI.Projects.AgentPageableListOfVectorStoreFileObject), System.Collections.Generic.IEnumerable data = null, string firstId = null, string lastId = null, bool hasMore = false) { throw null; } + public static Azure.AI.Projects.AzureFunctionBinding AzureFunctionBinding(Azure.AI.Projects.AzureFunctionBindingType type = default(Azure.AI.Projects.AzureFunctionBindingType), Azure.AI.Projects.AzureFunctionStorageQueue storageQueue = null) { throw null; } public static Azure.AI.Projects.ConnectionProperties ConnectionProperties(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null) { throw null; } public static Azure.AI.Projects.ConnectionPropertiesApiKeyAuth ConnectionPropertiesApiKeyAuth(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null, Azure.AI.Projects.CredentialsApiKeyAuth credentials = null) { throw null; } public static Azure.AI.Projects.ConnectionResponse ConnectionResponse(string id = null, string name = null, Azure.AI.Projects.ConnectionProperties properties = null) { throw null; } @@ -490,6 +492,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.Evaluation Evaluation(string id = null, Azure.AI.Projects.InputData data = null, string displayName = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string status = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary evaluators = null) { throw null; } public static Azure.AI.Projects.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string isEnabled = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } + public static Azure.AI.Projects.IncompleteRunDetails IncompleteRunDetails(Azure.AI.Projects.IncompleteDetailsReason reason = default(Azure.AI.Projects.IncompleteDetailsReason)) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } public static Azure.AI.Projects.MessageDeltaChunk MessageDeltaChunk(string id = null, Azure.AI.Projects.MessageDeltaChunkObject @object = default(Azure.AI.Projects.MessageDeltaChunkObject), Azure.AI.Projects.MessageDelta delta = null) { throw null; } @@ -609,6 +612,62 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureFunctionBinding : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureFunctionBinding(Azure.AI.Projects.AzureFunctionStorageQueue storageQueue) { } + public Azure.AI.Projects.AzureFunctionStorageQueue StorageQueue { get { throw null; } set { } } + public Azure.AI.Projects.AzureFunctionBindingType Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionBinding System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionBinding System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureFunctionBindingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureFunctionBindingType(string value) { throw null; } + public static Azure.AI.Projects.AzureFunctionBindingType StorageQueue { get { throw null; } } + public bool Equals(Azure.AI.Projects.AzureFunctionBindingType 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.Projects.AzureFunctionBindingType left, Azure.AI.Projects.AzureFunctionBindingType right) { throw null; } + public static implicit operator Azure.AI.Projects.AzureFunctionBindingType (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.AzureFunctionBindingType left, Azure.AI.Projects.AzureFunctionBindingType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureFunctionStorageQueue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName) { } + public string QueueName { get { throw null; } set { } } + public string StorageServiceEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionStorageQueue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionStorageQueue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureFunctionToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureFunctionToolDefinition(string name, string description, Azure.AI.Projects.AzureFunctionBinding inputBinding, Azure.AI.Projects.AzureFunctionBinding outputBinding, System.BinaryData parameters) { } + public string Description { get { throw null; } } + public string Name { get { throw null; } } + public System.BinaryData Parameters { get { throw null; } } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AzureFunctionToolDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class BingGroundingToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BingGroundingToolDefinition(Azure.AI.Projects.ToolConnectionList bingGrounding) { } @@ -1011,23 +1070,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct IncompleteRunDetails : System.IEquatable + public readonly partial struct IncompleteDetailsReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public IncompleteRunDetails(string value) { throw null; } - public static Azure.AI.Projects.IncompleteRunDetails MaxCompletionTokens { get { throw null; } } - public static Azure.AI.Projects.IncompleteRunDetails MaxPromptTokens { get { throw null; } } - public bool Equals(Azure.AI.Projects.IncompleteRunDetails other) { throw null; } + public IncompleteDetailsReason(string value) { throw null; } + public static Azure.AI.Projects.IncompleteDetailsReason MaxCompletionTokens { get { throw null; } } + public static Azure.AI.Projects.IncompleteDetailsReason MaxPromptTokens { get { throw null; } } + public bool Equals(Azure.AI.Projects.IncompleteDetailsReason 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.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } - public static implicit operator Azure.AI.Projects.IncompleteRunDetails (string value) { throw null; } - public static bool operator !=(Azure.AI.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } + public static bool operator ==(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } + public static implicit operator Azure.AI.Projects.IncompleteDetailsReason (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } public override string ToString() { throw null; } } + public partial class IncompleteRunDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IncompleteRunDetails() { } + public Azure.AI.Projects.IncompleteDetailsReason Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class IndexResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IndexResource(string indexConnectionId, string indexName) { } @@ -1082,7 +1152,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MessageAttachment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MessageAttachment(System.Collections.Generic.IEnumerable tools) { } - public System.Collections.Generic.IList DataSources { get { throw null; } } + public Azure.AI.Projects.VectorStoreDataSource DataSource { get { throw null; } set { } } public string FileId { get { throw null; } set { } } public System.Collections.Generic.IList Tools { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1430,8 +1500,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class MicrosoftFabricToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList microsoftFabric) { } - public Azure.AI.Projects.ToolConnectionList MicrosoftFabric { get { throw null; } set { } } + public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList fabricAiskill) { } + public Azure.AI.Projects.ToolConnectionList FabricAiskill { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MicrosoftFabricToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1439,6 +1509,96 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class OpenApiAnonymousAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiAnonymousAuthDetails() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAnonymousAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAnonymousAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class OpenApiAuthDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected OpenApiAuthDetails() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiConnectionAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiConnectionAuthDetails(Azure.AI.Projects.OpenApiConnectionSecurityScheme securityScheme) { } + public Azure.AI.Projects.OpenApiConnectionSecurityScheme SecurityScheme { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiConnectionSecurityScheme : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiConnectionSecurityScheme(string connectionId) { } + public string ConnectionId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionSecurityScheme System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiConnectionSecurityScheme System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiFunctionDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiFunctionDefinition(string name, System.BinaryData spec, Azure.AI.Projects.OpenApiAuthDetails auth) { } + public Azure.AI.Projects.OpenApiAuthDetails Auth { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Spec { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiFunctionDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiFunctionDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiManagedAuthDetails : Azure.AI.Projects.OpenApiAuthDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiManagedAuthDetails(Azure.AI.Projects.OpenApiManagedSecurityScheme securityScheme) { } + public Azure.AI.Projects.OpenApiManagedSecurityScheme SecurityScheme { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedAuthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedAuthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiManagedSecurityScheme : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiManagedSecurityScheme(string audience) { } + public string Audience { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedSecurityScheme System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiManagedSecurityScheme System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenApiToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenApiToolDefinition(Azure.AI.Projects.OpenApiFunctionDefinition openapi) { } + public OpenApiToolDefinition(string name, string description, System.BinaryData spec, Azure.AI.Projects.OpenApiAuthDetails auth) { } + public Azure.AI.Projects.OpenApiFunctionDefinition Openapi { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.OpenApiToolDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class PageableList : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { internal PageableList() { } @@ -2102,6 +2262,7 @@ internal RunStepUpdate() { } public static Azure.AI.Projects.RunStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.RunStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -2261,14 +2422,14 @@ internal ThreadRun() { } public System.DateTimeOffset? ExpiresAt { get { throw null; } } public System.DateTimeOffset? FailedAt { get { throw null; } } public string Id { get { throw null; } } - public Azure.AI.Projects.IncompleteRunDetails? IncompleteDetails { get { throw null; } } + public Azure.AI.Projects.IncompleteRunDetails IncompleteDetails { get { throw null; } } public string Instructions { get { throw null; } } public Azure.AI.Projects.RunError LastError { get { throw null; } } public int? MaxCompletionTokens { get { throw null; } } public int? MaxPromptTokens { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public string Model { get { throw null; } } - public bool? ParallelToolCalls { get { throw null; } } + public bool ParallelToolCalls { get { throw null; } } public Azure.AI.Projects.RequiredAction RequiredAction { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredActions { get { throw null; } } public System.BinaryData ResponseFormat { get { throw null; } } @@ -2546,10 +2707,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public enum VectorStoreDataSourceAssetType + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VectorStoreDataSourceAssetType : System.IEquatable { - UriAsset = 0, - IdAsset = 1, + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorStoreDataSourceAssetType(string value) { throw null; } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType IdAsset { get { throw null; } } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType UriAsset { get { throw null; } } + public bool Equals(Azure.AI.Projects.VectorStoreDataSourceAssetType 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.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public static implicit operator Azure.AI.Projects.VectorStoreDataSourceAssetType (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public override string ToString() { throw null; } } public partial class VectorStoreDeletionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { diff --git a/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj b/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj index 2fce03a2eabf..85bf509a8290 100644 --- a/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj +++ b/sdk/ai/Azure.AI.Projects/src/Azure.AI.Projects.csproj @@ -2,7 +2,7 @@ This is the Azure.AI.Projects client library for developing .NET applications with rich experience. Microsoft Azure.AI.Projects client library - 1.0.0-beta.2 + 1.0.0-beta.3 Azure.AI.Projects true $(RequiredTargetFrameworks) diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs index 73ae1c769605..a7cee4f50d0e 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs @@ -128,12 +128,12 @@ public static AgentThread AgentThread(string id = null, DateTimeOffset createdAt /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. /// Determines if tools can be executed in parallel within the run. /// A new instance for mocking. - public static ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, RunStatus status = default, RequiredAction requiredAction = null, RunError lastError = null, string model = null, string instructions = null, IEnumerable tools = null, DateTimeOffset createdAt = default, DateTimeOffset? expiresAt = null, DateTimeOffset? startedAt = null, DateTimeOffset? completedAt = null, DateTimeOffset? cancelledAt = null, DateTimeOffset? failedAt = null, IncompleteRunDetails? incompleteDetails = null, RunCompletionUsage usage = default, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = null) + public static ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, RunStatus status = default, RequiredAction requiredAction = null, RunError lastError = null, string model = null, string instructions = null, IEnumerable tools = null, DateTimeOffset createdAt = default, DateTimeOffset? expiresAt = null, DateTimeOffset? startedAt = null, DateTimeOffset? completedAt = null, DateTimeOffset? cancelledAt = null, DateTimeOffset? failedAt = null, IncompleteRunDetails incompleteDetails = default, RunCompletionUsage usage = default, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = null) { tools ??= new List(); metadata ??= new Dictionary(); - return new ThreadRun(id, @object: null, threadId, agentId, status, requiredAction, lastError, model, instructions, tools.ToList(), createdAt, expiresAt, startedAt, completedAt, cancelledAt, failedAt, incompleteDetails, usage, temperature, topP, maxPromptTokens, maxCompletionTokens, truncationStrategy, toolChoice, responseFormat, metadata, toolResources, parallelToolCalls, serializedAdditionalRawData: null); + return new ThreadRun(id, @object: null, threadId, agentId, status, requiredAction, lastError, model, instructions, tools.ToList(), createdAt, expiresAt, startedAt, completedAt, cancelledAt, failedAt, incompleteDetails, usage, temperature, topP, maxPromptTokens, maxCompletionTokens, truncationStrategy, toolChoice, responseFormat, metadata, toolResources, parallelToolCalls ?? true, serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs index 8180b0ab4696..e7a0213989de 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs @@ -52,12 +52,13 @@ public partial class AgentsClient /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. #pragma warning disable AZC0015 // Unexpected client method return type. - public virtual AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) #pragma warning restore AZC0015 // Unexpected client method return type. { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); @@ -78,6 +79,7 @@ public virtual AsyncCollectionResult CreateRunStreamingAsync(st truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); @@ -126,12 +128,13 @@ async Task sendRequestAsync() => /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. #pragma warning disable AZC0015 // Unexpected client method return type. - public virtual CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) #pragma warning restore AZC0015 // Unexpected client method return type. { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); @@ -152,6 +155,7 @@ public virtual CollectionResult CreateRunStreaming(string threa truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.cs index 8e26bdbe3758..bf16573a82c7 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.cs @@ -108,7 +108,7 @@ public AgentsClient(Uri endpoint, string subscriptionId, string resourceGroupNam /// The cancellation token to use. /// A new instance. public virtual Response CreateRun(AgentThread thread, Agent agent, CancellationToken cancellationToken = default) - => CreateRun(thread.Id, agent.Id, null, null, null, null, null, null, null, null, null, null, null, null, null, null, cancellationToken); + => CreateRun(thread.Id, agent.Id, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, cancellationToken); /// /// Creates a new run of the specified thread using a specified agent. @@ -121,7 +121,7 @@ public virtual Response CreateRun(AgentThread thread, Agent agent, Ca /// The cancellation token to use. /// A new instance. public virtual Task> CreateRunAsync(AgentThread thread, Agent agent, CancellationToken cancellationToken = default) - => CreateRunAsync(thread.Id, agent.Id, null, null, null, null, null, null, null, null, null, null, null, null, null, null, cancellationToken); + => CreateRunAsync(thread.Id, agent.Id, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, cancellationToken); /// Returns a list of run steps associated an agent thread run. /// The instance from which run steps should be listed. diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AzureFunctionToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AzureFunctionToolDefinition.cs new file mode 100644 index 000000000000..5f001e3d0eb7 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AzureFunctionToolDefinition.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.AI.Projects +{ + [CodeGenSuppress("AzureFunctionToolDefinition", typeof(InternalAzureFunctionDefinition))] + public partial class AzureFunctionToolDefinition + { + /// + public string Name => InternalAzureFunction.Function.Name; + + /// + public string Description => InternalAzureFunction.Function.Description; + + /// + public BinaryData Parameters => InternalAzureFunction.Function.Parameters; + + /// The definition of the function that the function tool should call. + internal InternalAzureFunctionDefinition InternalAzureFunction { get; set; } + + /// + /// Initializes a new instance of AzureFunctionDefinition. + /// + /// The name of the Azure function to be called. + /// A description of what the Azure function does, used by the model to choose when and how to call the function. + /// Input storage queue. + /// Output storage queue. + /// The parameters the Azure functions accepts, described as a JSON Schema object. + /// , or is null. + public AzureFunctionToolDefinition(string name, string description, AzureFunctionBinding inputBinding, AzureFunctionBinding outputBinding, BinaryData parameters) + : this(type: "azure_function", serializedAdditionalRawData: null, new InternalAzureFunctionDefinition(new InternalFunctionDefinition(name, description, parameters, serializedAdditionalRawData: null), inputBinding: inputBinding, outputBinding: outputBinding)) + { + } + + /// + public override bool Equals(object obj) + => (obj is AzureFunctionToolDefinition toolDefinition && Name == toolDefinition.Name); + + /// + public override int GetHashCode() => InternalAzureFunction.GetHashCode(); + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/OpenApiToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/OpenApiToolDefinition.cs new file mode 100644 index 000000000000..646bf56448bc --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/OpenApiToolDefinition.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiToolDefinition + { + public OpenApiToolDefinition(string name, string description, BinaryData spec, OpenApiAuthDetails auth):this( + new OpenApiFunctionDefinition( + name: name, + description: description, + spec: spec, + auth: auth, + serializedAdditionalRawData: null + ) + ){} + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/Streaming/StreamingUpdateReason.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/Streaming/StreamingUpdateReason.cs index 28fff18288fa..54a982496928 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/Streaming/StreamingUpdateReason.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/Streaming/StreamingUpdateReason.cs @@ -20,7 +20,7 @@ public enum StreamingUpdateReason /// Indicates that an update was generated as part of a thread.created event. /// /// This reason is typically only associated with calls to - /// , + /// , /// as other run-related methods operate on a thread that has previously been created. /// ThreadCreated, diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs index fc1c7f45a00e..267dd3c78398 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs @@ -35,10 +35,10 @@ protected AIProjectClient() } /// Initializes a new instance of AIProjectClient. - /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. + /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. /// The Azure subscription ID. /// The name of the Azure Resource Group. - /// The Azure AI Studio project name. + /// The Azure AI Foundry project name. /// A credential used to authenticate to an Azure Service. /// , , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -47,10 +47,10 @@ protected AIProjectClient() } /// Initializes a new instance of AIProjectClient. - /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. + /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. /// The Azure subscription ID. /// The name of the Azure Resource Group. - /// The Azure AI Studio project name. + /// The Azure AI Foundry project name. /// A credential used to authenticate to an Azure Service. /// The options for configuring the client. /// , , , or is null. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs index 02f3bc489b92..acd83ee1a217 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs @@ -16,10 +16,10 @@ public static partial class AIProjectsClientBuilderExtensions { /// Registers a instance. /// The builder to register with. - /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. + /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. /// The Azure subscription ID. /// The name of the Azure Resource Group. - /// The Azure AI Studio project name. + /// The Azure AI Foundry project name. public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName) where TBuilder : IAzureClientFactoryBuilderWithCredential { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs index ca30fab8a036..c503dd3f2eda 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs @@ -21,7 +21,7 @@ public static partial class AIProjectsModelFactory /// 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 . /// - /// Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique. + /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. /// Metadata containing createdBy and modifiedBy information. /// Status of the evaluation. It is set by service and is read-only. @@ -164,6 +164,15 @@ public static CredentialsApiKeyAuth CredentialsApiKeyAuth(string key = null) return new CredentialsApiKeyAuth(key, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The type of binding, which is always 'storage_queue'. + /// Storage queue. + /// A new instance for mocking. + public static AzureFunctionBinding AzureFunctionBinding(AzureFunctionBindingType type = default, AzureFunctionStorageQueue storageQueue = null) + { + return new AzureFunctionBinding(type, storageQueue, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// /// The role of the entity that is creating the message. Allowed values include: @@ -223,6 +232,14 @@ public static RunError RunError(string code = null, string message = null) return new RunError(code, message, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + /// A new instance for mocking. + public static IncompleteRunDetails IncompleteRunDetails(IncompleteDetailsReason reason = default) + { + return new IncompleteRunDetails(reason, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Number of completion tokens used over the course of the run. /// Number of prompt tokens used over the course of the run. @@ -253,7 +270,7 @@ public static RunStepMessageCreationReference RunStepMessageCreationReference(st /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , , and . /// /// A new instance for mocking. public static RunStepToolCallDetails RunStepToolCallDetails(IEnumerable toolCalls = null) @@ -348,7 +365,7 @@ public static RunStepMicrosoftFabricToolCall RunStepMicrosoftFabricToolCall(stri { microsoftFabric ??= new Dictionary(); - return new RunStepMicrosoftFabricToolCall("microsoft_fabric", id, serializedAdditionalRawData: null, microsoftFabric); + return new RunStepMicrosoftFabricToolCall("fabric_aiskill", id, serializedAdditionalRawData: null, microsoftFabric); } /// Initializes a new instance of . diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs index 51f05f61a7b8..4df181b747e4 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs @@ -56,7 +56,7 @@ public partial class Agent /// /// The collection of tools enabled for the agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -104,7 +104,7 @@ internal Agent(string id, DateTimeOffset createdAt, string name, string descript /// /// The collection of tools enabled for the agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -162,7 +162,7 @@ internal Agent() /// /// The collection of tools enabled for the agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs index 467c36acfd8b..97c4efa2a29e 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs @@ -45,6 +45,7 @@ public AgentStreamEvent(string value) private const string ThreadRunInProgressValue = "thread.run.in_progress"; private const string ThreadRunRequiresActionValue = "thread.run.requires_action"; private const string ThreadRunCompletedValue = "thread.run.completed"; + private const string ThreadRunIncompleteValue = "thread.run.incomplete"; private const string ThreadRunFailedValue = "thread.run.failed"; private const string ThreadRunCancellingValue = "thread.run.cancelling"; private const string ThreadRunCancelledValue = "thread.run.cancelled"; @@ -76,6 +77,8 @@ public AgentStreamEvent(string value) public static AgentStreamEvent ThreadRunRequiresAction { get; } = new AgentStreamEvent(ThreadRunRequiresActionValue); /// Event sent when a run is completed. The data of this event is of type ThreadRun. public static AgentStreamEvent ThreadRunCompleted { get; } = new AgentStreamEvent(ThreadRunCompletedValue); + /// Event sent when a run ends incomplete. The data of this event is of type ThreadRun. + public static AgentStreamEvent ThreadRunIncomplete { get; } = new AgentStreamEvent(ThreadRunIncompleteValue); /// Event sent when a run fails. The data of this event is of type ThreadRun. public static AgentStreamEvent ThreadRunFailed { get; } = new AgentStreamEvent(ThreadRunFailedValue); /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs index 6d8476ffe785..c5cb29e9b5e9 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs @@ -44,10 +44,10 @@ protected AgentsClient() /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The token credential to copy. - /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. + /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. /// The Azure subscription ID. /// The name of the Azure Resource Group. - /// The Azure AI Studio project name. + /// The Azure AI Foundry project name. /// The API version to use for this operation. internal AgentsClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName, string apiVersion) { @@ -1706,11 +1706,12 @@ public virtual Response UpdateMessage(string threadId, string messageId, Request /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -1730,6 +1731,7 @@ public virtual async Task> CreateRunAsync(string threadId, s truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); @@ -1776,11 +1778,12 @@ public virtual async Task> CreateRunAsync(string threadId, s /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -1800,6 +1803,7 @@ public virtual Response CreateRun(string threadId, string assistantId truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); @@ -1817,7 +1821,7 @@ public virtual Response CreateRun(string threadId, string assistantId /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -1858,7 +1862,7 @@ public virtual async Task CreateRunAsync(string threadId, RequestConte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2522,10 +2526,11 @@ public virtual Response CancelRun(string threadId, string runId, RequestContext /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// is null. - public virtual async Task> CreateThreadAndRunAsync(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateThreadAndRunAsync(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -2544,6 +2549,7 @@ public virtual async Task> CreateThreadAndRunAsync(string as truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); @@ -2586,10 +2592,11 @@ public virtual async Task> CreateThreadAndRunAsync(string as /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// is null. - public virtual Response CreateThreadAndRun(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response CreateThreadAndRun(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -2608,6 +2615,7 @@ public virtual Response CreateThreadAndRun(string assistantId, AgentT truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); @@ -2625,7 +2633,7 @@ public virtual Response CreateThreadAndRun(string assistantId, AgentT /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2663,7 +2671,7 @@ public virtual async Task CreateThreadAndRunAsync(RequestContent conte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs index 1fce40ad472d..e9371e9da058 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs @@ -26,7 +26,7 @@ public AgentsNamedToolChoiceType(string value) private const string CodeInterpreterValue = "code_interpreter"; private const string FileSearchValue = "file_search"; private const string BingGroundingValue = "bing_grounding"; - private const string MicrosoftFabricValue = "microsoft_fabric"; + private const string MicrosoftFabricValue = "fabric_aiskill"; private const string SharepointValue = "sharepoint_grounding"; private const string AzureAISearchValue = "azure_ai_search"; @@ -38,7 +38,7 @@ public AgentsNamedToolChoiceType(string value) public static AgentsNamedToolChoiceType FileSearch { get; } = new AgentsNamedToolChoiceType(FileSearchValue); /// Tool type `bing_grounding`. public static AgentsNamedToolChoiceType BingGrounding { get; } = new AgentsNamedToolChoiceType(BingGroundingValue); - /// Tool type `microsoft_fabric`. + /// Tool type `fabric_aiskill`. public static AgentsNamedToolChoiceType MicrosoftFabric { get; } = new AgentsNamedToolChoiceType(MicrosoftFabricValue); /// Tool type `sharepoint_grounding`. public static AgentsNamedToolChoiceType Sharepoint { get; } = new AgentsNamedToolChoiceType(SharepointValue); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.Serialization.cs new file mode 100644 index 000000000000..a4debebae798 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class AzureFunctionBinding : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + writer.WritePropertyName("storage_queue"u8); + writer.WriteObjectValue(StorageQueue, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureFunctionBinding IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureFunctionBinding(document.RootElement, options); + } + + internal static AzureFunctionBinding DeserializeAzureFunctionBinding(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureFunctionBindingType type = default; + AzureFunctionStorageQueue storageQueue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new AzureFunctionBindingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("storage_queue"u8)) + { + storageQueue = AzureFunctionStorageQueue.DeserializeAzureFunctionStorageQueue(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureFunctionBinding(type, storageQueue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support writing '{options.Format}' format."); + } + } + + AzureFunctionBinding IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureFunctionBinding(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureFunctionBinding FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureFunctionBinding(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.cs new file mode 100644 index 000000000000..86898f39d812 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// The structure for keeping storage queue name and URI. + public partial class AzureFunctionBinding + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Storage queue. + /// is null. + public AzureFunctionBinding(AzureFunctionStorageQueue storageQueue) + { + Argument.AssertNotNull(storageQueue, nameof(storageQueue)); + + StorageQueue = storageQueue; + } + + /// Initializes a new instance of . + /// The type of binding, which is always 'storage_queue'. + /// Storage queue. + /// Keeps track of any properties unknown to the library. + internal AzureFunctionBinding(AzureFunctionBindingType type, AzureFunctionStorageQueue storageQueue, IDictionary serializedAdditionalRawData) + { + Type = type; + StorageQueue = storageQueue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureFunctionBinding() + { + } + + /// The type of binding, which is always 'storage_queue'. + public AzureFunctionBindingType Type { get; } = AzureFunctionBindingType.StorageQueue; + + /// Storage queue. + public AzureFunctionStorageQueue StorageQueue { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBindingType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBindingType.cs new file mode 100644 index 000000000000..d3ef7652d782 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBindingType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Projects +{ + /// The AzureFunctionBinding_type. + public readonly partial struct AzureFunctionBindingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureFunctionBindingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StorageQueueValue = "storage_queue"; + + /// storage_queue. + public static AzureFunctionBindingType StorageQueue { get; } = new AzureFunctionBindingType(StorageQueueValue); + /// Determines if two values are the same. + public static bool operator ==(AzureFunctionBindingType left, AzureFunctionBindingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureFunctionBindingType left, AzureFunctionBindingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureFunctionBindingType(string value) => new AzureFunctionBindingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureFunctionBindingType other && Equals(other); + /// + public bool Equals(AzureFunctionBindingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.Serialization.cs new file mode 100644 index 000000000000..1965136e4c3d --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class AzureFunctionStorageQueue : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("queue_service_endpoint"u8); + writer.WriteStringValue(StorageServiceEndpoint); + writer.WritePropertyName("queue_name"u8); + writer.WriteStringValue(QueueName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureFunctionStorageQueue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureFunctionStorageQueue(document.RootElement, options); + } + + internal static AzureFunctionStorageQueue DeserializeAzureFunctionStorageQueue(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string queueServiceEndpoint = default; + string queueName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queue_service_endpoint"u8)) + { + queueServiceEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("queue_name"u8)) + { + queueName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureFunctionStorageQueue(queueServiceEndpoint, queueName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support writing '{options.Format}' format."); + } + } + + AzureFunctionStorageQueue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureFunctionStorageQueue(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureFunctionStorageQueue FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureFunctionStorageQueue(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs new file mode 100644 index 000000000000..1782ede5ac86 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// The structure for keeping storage queue name and URI. + public partial class AzureFunctionStorageQueue + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// URI to the Azure Storage Queue service allowing you to manipulate a queue. + /// The name of an Azure function storage queue. + /// or is null. + public AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName) + { + Argument.AssertNotNull(storageServiceEndpoint, nameof(storageServiceEndpoint)); + Argument.AssertNotNull(queueName, nameof(queueName)); + + StorageServiceEndpoint = storageServiceEndpoint; + QueueName = queueName; + } + + /// Initializes a new instance of . + /// URI to the Azure Storage Queue service allowing you to manipulate a queue. + /// The name of an Azure function storage queue. + /// Keeps track of any properties unknown to the library. + internal AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName, IDictionary serializedAdditionalRawData) + { + StorageServiceEndpoint = storageServiceEndpoint; + QueueName = queueName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureFunctionStorageQueue() + { + } + + /// URI to the Azure Storage Queue service allowing you to manipulate a queue. + public string StorageServiceEndpoint { get; set; } + /// The name of an Azure function storage queue. + public string QueueName { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.Serialization.cs new file mode 100644 index 000000000000..2e12aa340633 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class AzureFunctionToolDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("azure_function"u8); + writer.WriteObjectValue(InternalAzureFunction, options); + } + + AzureFunctionToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureFunctionToolDefinition(document.RootElement, options); + } + + internal static AzureFunctionToolDefinition DeserializeAzureFunctionToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InternalAzureFunctionDefinition azureFunction = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azure_function"u8)) + { + azureFunction = InternalAzureFunctionDefinition.DeserializeInternalAzureFunctionDefinition(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureFunctionToolDefinition(type, serializedAdditionalRawData, azureFunction); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support writing '{options.Format}' format."); + } + } + + AzureFunctionToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureFunctionToolDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AzureFunctionToolDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureFunctionToolDefinition(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.cs new file mode 100644 index 000000000000..87032b76e501 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// The input definition information for a azure function tool as used to configure an agent. + public partial class AzureFunctionToolDefinition : ToolDefinition + { + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + /// The definition of the concrete function that the function tool should call. + internal AzureFunctionToolDefinition(string type, IDictionary serializedAdditionalRawData, InternalAzureFunctionDefinition internalAzureFunction) : base(type, serializedAdditionalRawData) + { + InternalAzureFunction = internalAzureFunction; + } + + /// Initializes a new instance of for deserialization. + internal AzureFunctionToolDefinition() + { + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs index 1e49d70a3a98..5eebfab8f085 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs @@ -57,7 +57,7 @@ public CodeInterpreterToolResource() /// A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files /// associated with the tool. /// - /// The data sources to be used. This option is mutually exclusive with fileIds. + /// The data sources to be used. This option is mutually exclusive with the `fileIds` property. /// Keeps track of any properties unknown to the library. internal CodeInterpreterToolResource(IList fileIds, IList dataSources, IDictionary serializedAdditionalRawData) { @@ -71,7 +71,7 @@ internal CodeInterpreterToolResource(IList fileIds, IList public IList FileIds { get; } - /// The data sources to be used. This option is mutually exclusive with fileIds. + /// The data sources to be used. This option is mutually exclusive with the `fileIds` property. public IList DataSources { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs index 606b20563260..4a88cff11158 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs @@ -65,7 +65,7 @@ internal CreateAgentRequest(string model) /// /// The collection of tools to enable for the new agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -115,7 +115,7 @@ internal CreateAgentRequest() /// /// The collection of tools to enable for the new agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs index 91cd817d3827..bde5271e3de4 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs @@ -209,6 +209,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("response_format"); } } + if (Optional.IsDefined(ParallelToolCalls)) + { + writer.WritePropertyName("parallel_tool_calls"u8); + writer.WriteBooleanValue(ParallelToolCalls.Value); + } if (Optional.IsCollectionDefined(Metadata)) { if (Metadata != null) @@ -278,6 +283,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element TruncationObject truncationStrategy = default; BinaryData toolChoice = default; BinaryData responseFormat = default; + bool? parallelToolCalls = default; IReadOnlyDictionary metadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -425,6 +431,15 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element responseFormat = BinaryData.FromString(property.Value.GetRawText()); continue; } + if (property.NameEquals("parallel_tool_calls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parallelToolCalls = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -460,6 +475,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs index b47736e413eb..ad16d5992e52 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs @@ -70,7 +70,7 @@ internal CreateRunRequest(string assistantId) /// /// The overridden list of enabled tools that the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// /// If `true`, returns a stream of events that happen during the Run as server-sent events, @@ -100,9 +100,10 @@ internal CreateRunRequest(string assistantId) /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { AssistantId = assistantId; OverrideModelName = overrideModelName; @@ -118,6 +119,7 @@ internal CreateRunRequest(string assistantId, string overrideModelName, string o TruncationStrategy = truncationStrategy; ToolChoice = toolChoice; ResponseFormat = responseFormat; + ParallelToolCalls = parallelToolCalls; Metadata = metadata; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -143,7 +145,7 @@ internal CreateRunRequest() /// /// The overridden list of enabled tools that the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , , and . /// public IReadOnlyList OverrideTools { get; } /// @@ -268,6 +270,8 @@ internal CreateRunRequest() /// /// public BinaryData ResponseFormat { get; } + /// If `true` functions will run in parallel during tool use. + public bool? ParallelToolCalls { get; } /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. public IReadOnlyDictionary Metadata { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs index 10ad472113df..0af226f2493c 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs @@ -197,6 +197,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("response_format"); } } + if (Optional.IsDefined(ParallelToolCalls)) + { + writer.WritePropertyName("parallel_tool_calls"u8); + writer.WriteBooleanValue(ParallelToolCalls.Value); + } if (Optional.IsCollectionDefined(Metadata)) { if (Metadata != null) @@ -266,6 +271,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J TruncationObject truncationStrategy = default; BinaryData toolChoice = default; BinaryData responseFormat = default; + bool? parallelToolCalls = default; IReadOnlyDictionary metadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -408,6 +414,15 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J responseFormat = BinaryData.FromString(property.Value.GetRawText()); continue; } + if (property.NameEquals("parallel_tool_calls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parallelToolCalls = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -443,6 +458,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J truncationStrategy, toolChoice, responseFormat, + parallelToolCalls, metadata ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs index 1a002dd86bdd..8a7ef06db71a 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs @@ -65,7 +65,7 @@ internal CreateThreadAndRunRequest(string assistantId) /// /// The overridden list of enabled tools the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. /// @@ -96,9 +96,10 @@ internal CreateThreadAndRunRequest(string assistantId) /// The strategy to use for dropping messages as the context windows moves forward. /// Controls whether or not and which tool is called by the model. /// Specifies the format that the model must output. + /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { AssistantId = assistantId; Thread = thread; @@ -114,6 +115,7 @@ internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOption TruncationStrategy = truncationStrategy; ToolChoice = toolChoice; ResponseFormat = responseFormat; + ParallelToolCalls = parallelToolCalls; Metadata = metadata; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -134,7 +136,7 @@ internal CreateThreadAndRunRequest() /// /// The overridden list of enabled tools the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , , and . /// public IReadOnlyList OverrideTools { get; } /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. @@ -261,6 +263,8 @@ internal CreateThreadAndRunRequest() /// /// public BinaryData ResponseFormat { get; } + /// If `true` functions will run in parallel during tool use. + public bool? ParallelToolCalls { get; } /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. public IReadOnlyDictionary Metadata { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs index 173443bdd0bd..a5bb875ca420 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs @@ -71,7 +71,7 @@ public Evaluation(InputData data, IDictionary ev /// 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 . /// - /// Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique. + /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. /// Metadata containing createdBy and modifiedBy information. /// Status of the evaluation. It is set by service and is read-only. @@ -106,7 +106,7 @@ internal Evaluation() /// The available derived classes include and . /// public InputData Data { get; set; } - /// Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique. + /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. public string DisplayName { get; set; } /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. public string Description { get; set; } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs index 2df054d1bb74..f577d7d06da6 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs @@ -42,10 +42,10 @@ protected EvaluationsClient() /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The token credential to copy. - /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. + /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. /// The Azure subscription ID. /// The name of the Azure Resource Group. - /// The Azure AI Studio project name. + /// The Azure AI Foundry project name. /// The API version to use for this operation. internal EvaluationsClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName, string apiVersion) { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs index 27d2c74fd442..a2445583f91c 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs @@ -56,7 +56,7 @@ public FileSearchToolDefinitionDetails() /// /// Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. /// - /// + /// Ranking options for file search. /// Keeps track of any properties unknown to the library. internal FileSearchToolDefinitionDetails(int? maxNumResults, FileSearchRankingOptions rankingOptions, IDictionary serializedAdditionalRawData) { @@ -71,7 +71,7 @@ internal FileSearchToolDefinitionDetails(int? maxNumResults, FileSearchRankingOp /// Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. /// public int? MaxNumResults { get; set; } - /// Gets or sets the ranking options. + /// Ranking options for file search. public FileSearchRankingOptions RankingOptions { get; set; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs index da9f6a2ceb26..9dc2301d67ea 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs @@ -58,9 +58,9 @@ public FileSearchToolResource() /// store attached to the agent. /// /// - /// The list of vector store configuration objects from Azure. This list is limited to one - /// element. The only element of this list contains - /// the list of azure asset IDs used by the search tool. + /// The list of vector store configuration objects from Azure. + /// This list is limited to one element. + /// The only element of this list contains the list of azure asset IDs used by the search tool. /// /// Keeps track of any properties unknown to the library. internal FileSearchToolResource(IList vectorStoreIds, IList vectorStores, IDictionary serializedAdditionalRawData) @@ -76,9 +76,9 @@ internal FileSearchToolResource(IList vectorStoreIds, IList public IList VectorStoreIds { get; } /// - /// The list of vector store configuration objects from Azure. This list is limited to one - /// element. The only element of this list contains - /// the list of azure asset IDs used by the search tool. + /// The list of vector store configuration objects from Azure. + /// This list is limited to one element. + /// The only element of this list contains the list of azure asset IDs used by the search tool. /// public IList VectorStores { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs new file mode 100644 index 000000000000..517961f355be --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Projects +{ + /// The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + public readonly partial struct IncompleteDetailsReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IncompleteDetailsReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MaxCompletionTokensValue = "max_completion_tokens"; + private const string MaxPromptTokensValue = "max_prompt_tokens"; + + /// Maximum completion tokens exceeded. + public static IncompleteDetailsReason MaxCompletionTokens { get; } = new IncompleteDetailsReason(MaxCompletionTokensValue); + /// Maximum prompt tokens exceeded. + public static IncompleteDetailsReason MaxPromptTokens { get; } = new IncompleteDetailsReason(MaxPromptTokensValue); + /// Determines if two values are the same. + public static bool operator ==(IncompleteDetailsReason left, IncompleteDetailsReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IncompleteDetailsReason left, IncompleteDetailsReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IncompleteDetailsReason(string value) => new IncompleteDetailsReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IncompleteDetailsReason other && Equals(other); + /// + public bool Equals(IncompleteDetailsReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.Serialization.cs new file mode 100644 index 000000000000..6264642302cb --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class IncompleteRunDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IncompleteRunDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIncompleteRunDetails(document.RootElement, options); + } + + internal static IncompleteRunDetails DeserializeIncompleteRunDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IncompleteDetailsReason reason = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reason"u8)) + { + reason = new IncompleteDetailsReason(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IncompleteRunDetails(reason, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support writing '{options.Format}' format."); + } + } + + IncompleteRunDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIncompleteRunDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IncompleteRunDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIncompleteRunDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs index 824797e5f7c6..786489fd3369 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs @@ -6,46 +6,67 @@ #nullable disable using System; -using System.ComponentModel; +using System.Collections.Generic; namespace Azure.AI.Projects { - /// The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - public readonly partial struct IncompleteRunDetails : IEquatable + /// Details on why the run is incomplete. Will be `null` if the run is not incomplete. + public partial class IncompleteRunDetails { - private readonly string _value; + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// is null. - public IncompleteRunDetails(string value) + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + internal IncompleteRunDetails(IncompleteDetailsReason reason) { - _value = value ?? throw new ArgumentNullException(nameof(value)); + Reason = reason; } - private const string MaxCompletionTokensValue = "max_completion_tokens"; - private const string MaxPromptTokensValue = "max_prompt_tokens"; - - /// Maximum completion tokens exceeded. - public static IncompleteRunDetails MaxCompletionTokens { get; } = new IncompleteRunDetails(MaxCompletionTokensValue); - /// Maximum prompt tokens exceeded. - public static IncompleteRunDetails MaxPromptTokens { get; } = new IncompleteRunDetails(MaxPromptTokensValue); - /// Determines if two values are the same. - public static bool operator ==(IncompleteRunDetails left, IncompleteRunDetails right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IncompleteRunDetails left, IncompleteRunDetails right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator IncompleteRunDetails(string value) => new IncompleteRunDetails(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IncompleteRunDetails other && Equals(other); - /// - public bool Equals(IncompleteRunDetails other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; + /// Initializes a new instance of . + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + /// Keeps track of any properties unknown to the library. + internal IncompleteRunDetails(IncompleteDetailsReason reason, IDictionary serializedAdditionalRawData) + { + Reason = reason; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IncompleteRunDetails() + { + } + + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + public IncompleteDetailsReason Reason { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.Serialization.cs new file mode 100644 index 000000000000..1a3d51797196 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + internal partial class InternalAzureFunctionDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("function"u8); + writer.WriteObjectValue(Function, options); + writer.WritePropertyName("input_binding"u8); + writer.WriteObjectValue(InputBinding, options); + writer.WritePropertyName("output_binding"u8); + writer.WriteObjectValue(OutputBinding, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InternalAzureFunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInternalAzureFunctionDefinition(document.RootElement, options); + } + + internal static InternalAzureFunctionDefinition DeserializeInternalAzureFunctionDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InternalFunctionDefinition function = default; + AzureFunctionBinding inputBinding = default; + AzureFunctionBinding outputBinding = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("function"u8)) + { + function = InternalFunctionDefinition.DeserializeInternalFunctionDefinition(property.Value, options); + continue; + } + if (property.NameEquals("input_binding"u8)) + { + inputBinding = AzureFunctionBinding.DeserializeAzureFunctionBinding(property.Value, options); + continue; + } + if (property.NameEquals("output_binding"u8)) + { + outputBinding = AzureFunctionBinding.DeserializeAzureFunctionBinding(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InternalAzureFunctionDefinition(function, inputBinding, outputBinding, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support writing '{options.Format}' format."); + } + } + + InternalAzureFunctionDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInternalAzureFunctionDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InternalAzureFunctionDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureFunctionDefinition(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.cs new file mode 100644 index 000000000000..f566ee9d15b9 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// The definition of Azure function. + internal partial class InternalAzureFunctionDefinition + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The definition of azure function and its parameters. + /// Input storage queue. The queue storage trigger runs a function as messages are added to it. + /// Output storage queue. The function writes output to this queue when the input items are processed. + /// , or is null. + public InternalAzureFunctionDefinition(InternalFunctionDefinition function, AzureFunctionBinding inputBinding, AzureFunctionBinding outputBinding) + { + Argument.AssertNotNull(function, nameof(function)); + Argument.AssertNotNull(inputBinding, nameof(inputBinding)); + Argument.AssertNotNull(outputBinding, nameof(outputBinding)); + + Function = function; + InputBinding = inputBinding; + OutputBinding = outputBinding; + } + + /// Initializes a new instance of . + /// The definition of azure function and its parameters. + /// Input storage queue. The queue storage trigger runs a function as messages are added to it. + /// Output storage queue. The function writes output to this queue when the input items are processed. + /// Keeps track of any properties unknown to the library. + internal InternalAzureFunctionDefinition(InternalFunctionDefinition function, AzureFunctionBinding inputBinding, AzureFunctionBinding outputBinding, IDictionary serializedAdditionalRawData) + { + Function = function; + InputBinding = inputBinding; + OutputBinding = outputBinding; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InternalAzureFunctionDefinition() + { + } + + /// The definition of azure function and its parameters. + public InternalFunctionDefinition Function { get; set; } + /// Input storage queue. The queue storage trigger runs a function as messages are added to it. + public AzureFunctionBinding InputBinding { get; set; } + /// Output storage queue. The function writes output to this queue when the input items are processed. + public AzureFunctionBinding OutputBinding { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs index 124ba52d97e1..9a3751e9f5ea 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs @@ -39,15 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("file_id"u8); writer.WriteStringValue(FileId); } - if (Optional.IsCollectionDefined(DataSources)) + if (Optional.IsDefined(DataSource)) { - writer.WritePropertyName("data_sources"u8); - writer.WriteStartArray(); - foreach (var item in DataSources) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("data_source"u8); + writer.WriteObjectValue(DataSource, options); } writer.WritePropertyName("tools"u8); writer.WriteStartArray(); @@ -106,7 +101,7 @@ internal static MessageAttachment DeserializeMessageAttachment(JsonElement eleme return null; } string fileId = default; - IList dataSources = default; + VectorStoreDataSource dataSource = default; IList tools = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -117,18 +112,13 @@ internal static MessageAttachment DeserializeMessageAttachment(JsonElement eleme fileId = property.Value.GetString(); continue; } - if (property.NameEquals("data_sources"u8)) + if (property.NameEquals("data_source"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VectorStoreDataSource.DeserializeVectorStoreDataSource(item, options)); - } - dataSources = array; + dataSource = VectorStoreDataSource.DeserializeVectorStoreDataSource(property.Value, options); continue; } if (property.NameEquals("tools"u8)) @@ -154,7 +144,7 @@ internal static MessageAttachment DeserializeMessageAttachment(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new MessageAttachment(fileId, dataSources ?? new ChangeTrackingList(), tools, serializedAdditionalRawData); + return new MessageAttachment(fileId, dataSource, tools, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs index 0aab327fa3db..be25230a7c4c 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs @@ -53,19 +53,18 @@ public MessageAttachment(IEnumerable tools) { Argument.AssertNotNull(tools, nameof(tools)); - DataSources = new ChangeTrackingList(); Tools = tools.ToList(); } /// Initializes a new instance of . /// The ID of the file to attach to the message. - /// Azure asset ID. + /// Azure asset ID. /// The tools to add to this file. /// Keeps track of any properties unknown to the library. - internal MessageAttachment(string fileId, IList dataSources, IList tools, IDictionary serializedAdditionalRawData) + internal MessageAttachment(string fileId, VectorStoreDataSource dataSource, IList tools, IDictionary serializedAdditionalRawData) { FileId = fileId; - DataSources = dataSources; + DataSource = dataSource; Tools = tools; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,7 +77,7 @@ internal MessageAttachment() /// The ID of the file to attach to the message. public string FileId { get; set; } /// Azure asset ID. - public IList DataSources { get; } + public VectorStoreDataSource DataSource { get; set; } /// /// The tools to add to this file. /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs index 74fb6c1c1968..ad1aecac6013 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs @@ -35,8 +35,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("microsoft_fabric"u8); - writer.WriteObjectValue(MicrosoftFabric, options); + writer.WritePropertyName("fabric_aiskill"u8); + writer.WriteObjectValue(FabricAiskill, options); } MicrosoftFabricToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -59,15 +59,15 @@ internal static MicrosoftFabricToolDefinition DeserializeMicrosoftFabricToolDefi { return null; } - ToolConnectionList microsoftFabric = default; + ToolConnectionList fabricAiskill = default; string type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("microsoft_fabric"u8)) + if (property.NameEquals("fabric_aiskill"u8)) { - microsoftFabric = ToolConnectionList.DeserializeToolConnectionList(property.Value, options); + fabricAiskill = ToolConnectionList.DeserializeToolConnectionList(property.Value, options); continue; } if (property.NameEquals("type"u8)) @@ -81,7 +81,7 @@ internal static MicrosoftFabricToolDefinition DeserializeMicrosoftFabricToolDefi } } serializedAdditionalRawData = rawDataDictionary; - return new MicrosoftFabricToolDefinition(type, serializedAdditionalRawData, microsoftFabric); + return new MicrosoftFabricToolDefinition(type, serializedAdditionalRawData, fabricAiskill); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs index fb886ddbd869..f62e63d2f7f0 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs @@ -14,23 +14,23 @@ namespace Azure.AI.Projects public partial class MicrosoftFabricToolDefinition : ToolDefinition { /// Initializes a new instance of . - /// The list of connections used by the Microsoft Fabric tool. - /// is null. - public MicrosoftFabricToolDefinition(ToolConnectionList microsoftFabric) + /// The list of connections used by the Microsoft Fabric tool. + /// is null. + public MicrosoftFabricToolDefinition(ToolConnectionList fabricAiskill) { - Argument.AssertNotNull(microsoftFabric, nameof(microsoftFabric)); + Argument.AssertNotNull(fabricAiskill, nameof(fabricAiskill)); - Type = "microsoft_fabric"; - MicrosoftFabric = microsoftFabric; + Type = "fabric_aiskill"; + FabricAiskill = fabricAiskill; } /// Initializes a new instance of . /// The object type. /// Keeps track of any properties unknown to the library. - /// The list of connections used by the Microsoft Fabric tool. - internal MicrosoftFabricToolDefinition(string type, IDictionary serializedAdditionalRawData, ToolConnectionList microsoftFabric) : base(type, serializedAdditionalRawData) + /// The list of connections used by the Microsoft Fabric tool. + internal MicrosoftFabricToolDefinition(string type, IDictionary serializedAdditionalRawData, ToolConnectionList fabricAiskill) : base(type, serializedAdditionalRawData) { - MicrosoftFabric = microsoftFabric; + FabricAiskill = fabricAiskill; } /// Initializes a new instance of for deserialization. @@ -39,6 +39,6 @@ internal MicrosoftFabricToolDefinition() } /// The list of connections used by the Microsoft Fabric tool. - public ToolConnectionList MicrosoftFabric { get; set; } + public ToolConnectionList FabricAiskill { get; set; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.Serialization.cs new file mode 100644 index 000000000000..e2b9cdf54847 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiAnonymousAuthDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OpenApiAnonymousAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiAnonymousAuthDetails(document.RootElement, options); + } + + internal static OpenApiAnonymousAuthDetails DeserializeOpenApiAnonymousAuthDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenApiAuthType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OpenApiAuthType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiAnonymousAuthDetails(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support writing '{options.Format}' format."); + } + } + + OpenApiAnonymousAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiAnonymousAuthDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OpenApiAnonymousAuthDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiAnonymousAuthDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.cs new file mode 100644 index 000000000000..5a86750c6c95 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Security details for OpenApi anonymous authentication. + public partial class OpenApiAnonymousAuthDetails : OpenApiAuthDetails + { + /// Initializes a new instance of . + public OpenApiAnonymousAuthDetails() + { + Type = OpenApiAuthType.Anonymous; + } + + /// Initializes a new instance of . + /// The type of authentication, must be anonymous/connection/managed_identity. + /// Keeps track of any properties unknown to the library. + internal OpenApiAnonymousAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.Serialization.cs new file mode 100644 index 000000000000..8d9043b1b4ba --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + [PersistableModelProxy(typeof(UnknownOpenApiAuthDetails))] + public partial class OpenApiAuthDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenApiAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiAuthDetails(document.RootElement, options); + } + + internal static OpenApiAuthDetails DeserializeOpenApiAuthDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "anonymous": return OpenApiAnonymousAuthDetails.DeserializeOpenApiAnonymousAuthDetails(element, options); + case "connection": return OpenApiConnectionAuthDetails.DeserializeOpenApiConnectionAuthDetails(element, options); + case "managed_identity": return OpenApiManagedAuthDetails.DeserializeOpenApiManagedAuthDetails(element, options); + } + } + return UnknownOpenApiAuthDetails.DeserializeUnknownOpenApiAuthDetails(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support writing '{options.Format}' format."); + } + } + + OpenApiAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiAuthDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenApiAuthDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiAuthDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.cs new file mode 100644 index 000000000000..596d594a2488 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// + /// authentication details for OpenApiFunctionDefinition + /// 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 OpenApiAuthDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected OpenApiAuthDetails() + { + } + + /// Initializes a new instance of . + /// The type of authentication, must be anonymous/connection/managed_identity. + /// Keeps track of any properties unknown to the library. + internal OpenApiAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of authentication, must be anonymous/connection/managed_identity. + internal OpenApiAuthType Type { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs new file mode 100644 index 000000000000..230257cdbd7b --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Projects +{ + /// + /// Authentication type for OpenApi endpoint. Allowed types are: + /// - Anonymous (no authentication required) + /// - Connection (requires connection_id to endpoint, as setup in AI Foundry) + /// - Managed_Identity (requires audience for identity based auth) + /// + internal readonly partial struct OpenApiAuthType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OpenApiAuthType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AnonymousValue = "anonymous"; + private const string ConnectionValue = "connection"; + private const string ManagedIdentityValue = "managed_identity"; + + /// anonymous. + public static OpenApiAuthType Anonymous { get; } = new OpenApiAuthType(AnonymousValue); + /// connection. + public static OpenApiAuthType Connection { get; } = new OpenApiAuthType(ConnectionValue); + /// managed_identity. + public static OpenApiAuthType ManagedIdentity { get; } = new OpenApiAuthType(ManagedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(OpenApiAuthType left, OpenApiAuthType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OpenApiAuthType left, OpenApiAuthType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OpenApiAuthType(string value) => new OpenApiAuthType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OpenApiAuthType other && Equals(other); + /// + public bool Equals(OpenApiAuthType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.Serialization.cs new file mode 100644 index 000000000000..3594791bd427 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiConnectionAuthDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("security_scheme"u8); + writer.WriteObjectValue(SecurityScheme, options); + } + + OpenApiConnectionAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiConnectionAuthDetails(document.RootElement, options); + } + + internal static OpenApiConnectionAuthDetails DeserializeOpenApiConnectionAuthDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenApiConnectionSecurityScheme securityScheme = default; + OpenApiAuthType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("security_scheme"u8)) + { + securityScheme = OpenApiConnectionSecurityScheme.DeserializeOpenApiConnectionSecurityScheme(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OpenApiAuthType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiConnectionAuthDetails(type, serializedAdditionalRawData, securityScheme); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support writing '{options.Format}' format."); + } + } + + OpenApiConnectionAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiConnectionAuthDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OpenApiConnectionAuthDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiConnectionAuthDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.cs new file mode 100644 index 000000000000..8c2771c0f3b9 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Security details for OpenApi connection authentication. + public partial class OpenApiConnectionAuthDetails : OpenApiAuthDetails + { + /// Initializes a new instance of . + /// Connection auth security details. + /// is null. + public OpenApiConnectionAuthDetails(OpenApiConnectionSecurityScheme securityScheme) + { + Argument.AssertNotNull(securityScheme, nameof(securityScheme)); + + Type = OpenApiAuthType.Connection; + SecurityScheme = securityScheme; + } + + /// Initializes a new instance of . + /// The type of authentication, must be anonymous/connection/managed_identity. + /// Keeps track of any properties unknown to the library. + /// Connection auth security details. + internal OpenApiConnectionAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData, OpenApiConnectionSecurityScheme securityScheme) : base(type, serializedAdditionalRawData) + { + SecurityScheme = securityScheme; + } + + /// Initializes a new instance of for deserialization. + internal OpenApiConnectionAuthDetails() + { + } + + /// Connection auth security details. + public OpenApiConnectionSecurityScheme SecurityScheme { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.Serialization.cs new file mode 100644 index 000000000000..3587020a8867 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiConnectionSecurityScheme : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("connection_id"u8); + writer.WriteStringValue(ConnectionId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenApiConnectionSecurityScheme IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiConnectionSecurityScheme(document.RootElement, options); + } + + internal static OpenApiConnectionSecurityScheme DeserializeOpenApiConnectionSecurityScheme(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string connectionId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connection_id"u8)) + { + connectionId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiConnectionSecurityScheme(connectionId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support writing '{options.Format}' format."); + } + } + + OpenApiConnectionSecurityScheme IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiConnectionSecurityScheme(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenApiConnectionSecurityScheme FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiConnectionSecurityScheme(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.cs new file mode 100644 index 000000000000..d74d1bae8a27 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Security scheme for OpenApi managed_identity authentication. + public partial class OpenApiConnectionSecurityScheme + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Connection id for Connection auth type. + /// is null. + public OpenApiConnectionSecurityScheme(string connectionId) + { + Argument.AssertNotNull(connectionId, nameof(connectionId)); + + ConnectionId = connectionId; + } + + /// Initializes a new instance of . + /// Connection id for Connection auth type. + /// Keeps track of any properties unknown to the library. + internal OpenApiConnectionSecurityScheme(string connectionId, IDictionary serializedAdditionalRawData) + { + ConnectionId = connectionId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OpenApiConnectionSecurityScheme() + { + } + + /// Connection id for Connection auth type. + public string ConnectionId { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.Serialization.cs new file mode 100644 index 000000000000..52bd220dc908 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiFunctionDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("spec"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Spec); +#else + using (JsonDocument document = JsonDocument.Parse(Spec)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + writer.WritePropertyName("auth"u8); + writer.WriteObjectValue(Auth, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenApiFunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiFunctionDefinition(document.RootElement, options); + } + + internal static OpenApiFunctionDefinition DeserializeOpenApiFunctionDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string description = default; + BinaryData spec = default; + OpenApiAuthDetails auth = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("spec"u8)) + { + spec = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("auth"u8)) + { + auth = OpenApiAuthDetails.DeserializeOpenApiAuthDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiFunctionDefinition(name, description, spec, auth, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support writing '{options.Format}' format."); + } + } + + OpenApiFunctionDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiFunctionDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenApiFunctionDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiFunctionDefinition(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.cs new file mode 100644 index 000000000000..8980b1cfe70e --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// The input definition information for an openapi function. + public partial class OpenApiFunctionDefinition + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the function to be called. + /// The openapi function shape, described as a JSON Schema object. + /// + /// Open API authentication details + /// 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 . + /// + /// , or is null. + public OpenApiFunctionDefinition(string name, BinaryData spec, OpenApiAuthDetails auth) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(spec, nameof(spec)); + Argument.AssertNotNull(auth, nameof(auth)); + + Name = name; + Spec = spec; + Auth = auth; + } + + /// Initializes a new instance of . + /// The name of the function to be called. + /// A description of what the function does, used by the model to choose when and how to call the function. + /// The openapi function shape, described as a JSON Schema object. + /// + /// Open API authentication details + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal OpenApiFunctionDefinition(string name, string description, BinaryData spec, OpenApiAuthDetails auth, IDictionary serializedAdditionalRawData) + { + Name = name; + Description = description; + Spec = spec; + Auth = auth; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OpenApiFunctionDefinition() + { + } + + /// The name of the function to be called. + public string Name { get; set; } + /// A description of what the function does, used by the model to choose when and how to call the function. + public string Description { get; set; } + /// + /// The openapi function shape, described as a JSON Schema object. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Spec { get; set; } + /// + /// Open API authentication details + /// 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 OpenApiAuthDetails Auth { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.Serialization.cs new file mode 100644 index 000000000000..6f05aaf2f05c --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiManagedAuthDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiManagedAuthDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("security_scheme"u8); + writer.WriteObjectValue(SecurityScheme, options); + } + + OpenApiManagedAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiManagedAuthDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiManagedAuthDetails(document.RootElement, options); + } + + internal static OpenApiManagedAuthDetails DeserializeOpenApiManagedAuthDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenApiManagedSecurityScheme securityScheme = default; + OpenApiAuthType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("security_scheme"u8)) + { + securityScheme = OpenApiManagedSecurityScheme.DeserializeOpenApiManagedSecurityScheme(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new OpenApiAuthType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiManagedAuthDetails(type, serializedAdditionalRawData, securityScheme); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiManagedAuthDetails)} does not support writing '{options.Format}' format."); + } + } + + OpenApiManagedAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiManagedAuthDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiManagedAuthDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OpenApiManagedAuthDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiManagedAuthDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.cs new file mode 100644 index 000000000000..9a51a510225c --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Security details for OpenApi managed_identity authentication. + public partial class OpenApiManagedAuthDetails : OpenApiAuthDetails + { + /// Initializes a new instance of . + /// Connection auth security details. + /// is null. + public OpenApiManagedAuthDetails(OpenApiManagedSecurityScheme securityScheme) + { + Argument.AssertNotNull(securityScheme, nameof(securityScheme)); + + Type = OpenApiAuthType.ManagedIdentity; + SecurityScheme = securityScheme; + } + + /// Initializes a new instance of . + /// The type of authentication, must be anonymous/connection/managed_identity. + /// Keeps track of any properties unknown to the library. + /// Connection auth security details. + internal OpenApiManagedAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData, OpenApiManagedSecurityScheme securityScheme) : base(type, serializedAdditionalRawData) + { + SecurityScheme = securityScheme; + } + + /// Initializes a new instance of for deserialization. + internal OpenApiManagedAuthDetails() + { + } + + /// Connection auth security details. + public OpenApiManagedSecurityScheme SecurityScheme { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.Serialization.cs new file mode 100644 index 000000000000..61a1375c0007 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiManagedSecurityScheme : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiManagedSecurityScheme)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenApiManagedSecurityScheme IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiManagedSecurityScheme)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiManagedSecurityScheme(document.RootElement, options); + } + + internal static OpenApiManagedSecurityScheme DeserializeOpenApiManagedSecurityScheme(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string audience = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiManagedSecurityScheme(audience, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiManagedSecurityScheme)} does not support writing '{options.Format}' format."); + } + } + + OpenApiManagedSecurityScheme IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiManagedSecurityScheme(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiManagedSecurityScheme)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OpenApiManagedSecurityScheme FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiManagedSecurityScheme(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.cs new file mode 100644 index 000000000000..e1c3d9970098 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Security scheme for OpenApi managed_identity authentication. + public partial class OpenApiManagedSecurityScheme + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Authentication scope for managed_identity auth type. + /// is null. + public OpenApiManagedSecurityScheme(string audience) + { + Argument.AssertNotNull(audience, nameof(audience)); + + Audience = audience; + } + + /// Initializes a new instance of . + /// Authentication scope for managed_identity auth type. + /// Keeps track of any properties unknown to the library. + internal OpenApiManagedSecurityScheme(string audience, IDictionary serializedAdditionalRawData) + { + Audience = audience; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OpenApiManagedSecurityScheme() + { + } + + /// Authentication scope for managed_identity auth type. + public string Audience { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.Serialization.cs new file mode 100644 index 000000000000..bd31655d48ab --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class OpenApiToolDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiToolDefinition)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("openapi"u8); + writer.WriteObjectValue(Openapi, options); + } + + OpenApiToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiToolDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiToolDefinition(document.RootElement, options); + } + + internal static OpenApiToolDefinition DeserializeOpenApiToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenApiFunctionDefinition openapi = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("openapi"u8)) + { + openapi = OpenApiFunctionDefinition.DeserializeOpenApiFunctionDefinition(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenApiToolDefinition(type, serializedAdditionalRawData, openapi); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiToolDefinition)} does not support writing '{options.Format}' format."); + } + } + + OpenApiToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiToolDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiToolDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OpenApiToolDefinition FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOpenApiToolDefinition(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.cs new file mode 100644 index 000000000000..f56708e3d6e5 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// The input definition information for an OpenAPI tool as used to configure an agent. + public partial class OpenApiToolDefinition : ToolDefinition + { + /// Initializes a new instance of . + /// The openapi function definition. + /// is null. + public OpenApiToolDefinition(OpenApiFunctionDefinition openapi) + { + Argument.AssertNotNull(openapi, nameof(openapi)); + + Type = "openapi"; + Openapi = openapi; + } + + /// Initializes a new instance of . + /// The object type. + /// Keeps track of any properties unknown to the library. + /// The openapi function definition. + internal OpenApiToolDefinition(string type, IDictionary serializedAdditionalRawData, OpenApiFunctionDefinition openapi) : base(type, serializedAdditionalRawData) + { + Openapi = openapi; + } + + /// Initializes a new instance of for deserialization. + internal OpenApiToolDefinition() + { + } + + /// The openapi function definition. + public OpenApiFunctionDefinition Openapi { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs index f9e94be0b0fd..abeb4d7c18ec 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Projects { /// - /// An abstract representation a a tool invocation needed by the model to continue a run. + /// An abstract representation of a tool invocation needed by the model to continue a run. /// 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 . /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs index e4cbd4acd590..1b3f42907d65 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs @@ -35,7 +35,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("microsoft_fabric"u8); + writer.WritePropertyName("fabric_aiskill"u8); writer.WriteStartObject(); foreach (var item in MicrosoftFabric) { @@ -65,21 +65,21 @@ internal static RunStepMicrosoftFabricToolCall DeserializeRunStepMicrosoftFabric { return null; } - IReadOnlyDictionary microsoftFabric = default; + IReadOnlyDictionary fabricAiskill = default; string type = default; string id = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("microsoft_fabric"u8)) + if (property.NameEquals("fabric_aiskill"u8)) { Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } - microsoftFabric = dictionary; + fabricAiskill = dictionary; continue; } if (property.NameEquals("type"u8)) @@ -98,7 +98,7 @@ internal static RunStepMicrosoftFabricToolCall DeserializeRunStepMicrosoftFabric } } serializedAdditionalRawData = rawDataDictionary; - return new RunStepMicrosoftFabricToolCall(type, id, serializedAdditionalRawData, microsoftFabric); + return new RunStepMicrosoftFabricToolCall(type, id, serializedAdditionalRawData, fabricAiskill); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs index 15f664c26464..b212127c0605 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs @@ -25,7 +25,7 @@ internal RunStepMicrosoftFabricToolCall(string id, IReadOnlyDictionary /// An abstract representation of a detailed tool call as recorded within a run step for an existing run. /// 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 . + /// The available derived classes include , , , , , and . /// public abstract partial class RunStepToolCall { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs index f5a2490363ac..f734d2d76efe 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs @@ -18,7 +18,7 @@ public partial class RunStepToolCallDetails : RunStepDetails /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , , and . /// /// is null. internal RunStepToolCallDetails(IEnumerable toolCalls) @@ -35,7 +35,7 @@ internal RunStepToolCallDetails(IEnumerable toolCalls) /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , , and . /// internal RunStepToolCallDetails(RunStepType type, IDictionary serializedAdditionalRawData, IReadOnlyList toolCalls) : base(type, serializedAdditionalRawData) { @@ -50,7 +50,7 @@ internal RunStepToolCallDetails() /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , , and . /// public IReadOnlyList ToolCalls { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs index f560f75366ce..b3fd0dcab2ef 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs @@ -27,6 +27,7 @@ public RunStreamEvent(string value) private const string ThreadRunInProgressValue = "thread.run.in_progress"; private const string ThreadRunRequiresActionValue = "thread.run.requires_action"; private const string ThreadRunCompletedValue = "thread.run.completed"; + private const string ThreadRunIncompleteValue = "thread.run.incomplete"; private const string ThreadRunFailedValue = "thread.run.failed"; private const string ThreadRunCancellingValue = "thread.run.cancelling"; private const string ThreadRunCancelledValue = "thread.run.cancelled"; @@ -42,6 +43,8 @@ public RunStreamEvent(string value) public static RunStreamEvent ThreadRunRequiresAction { get; } = new RunStreamEvent(ThreadRunRequiresActionValue); /// Event sent when a run is completed. The data of this event is of type ThreadRun. public static RunStreamEvent ThreadRunCompleted { get; } = new RunStreamEvent(ThreadRunCompletedValue); + /// Event sent when a run ends incomplete. The data of this event is of type ThreadRun. + public static RunStreamEvent ThreadRunIncomplete { get; } = new RunStreamEvent(ThreadRunIncompleteValue); /// Event sent when a run fails. The data of this event is of type ThreadRun. public static RunStreamEvent ThreadRunFailed { get; } = new RunStreamEvent(ThreadRunFailedValue); /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/TelemetryClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/TelemetryClient.cs index 74d85dbdef87..2732da6a60da 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/TelemetryClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/TelemetryClient.cs @@ -41,10 +41,10 @@ protected TelemetryClient() /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The token credential to copy. - /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. + /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link. /// The Azure subscription ID. /// The name of the Azure Resource Group. - /// The Azure AI Studio project name. + /// The Azure AI Foundry project name. /// The API version to use for this operation. internal TelemetryClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName, string apiVersion) { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs index 310ef48146c4..46c6f4a2e3f7 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs @@ -126,7 +126,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (IncompleteDetails != null) { writer.WritePropertyName("incomplete_details"u8); - writer.WriteStringValue(IncompleteDetails.Value.ToString()); + writer.WriteObjectValue(IncompleteDetails, options); } else { @@ -251,11 +251,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("tool_resources"); } } - if (Optional.IsDefined(ParallelToolCalls)) - { - writer.WritePropertyName("parallelToolCalls"u8); - writer.WriteBooleanValue(ParallelToolCalls.Value); - } + writer.WritePropertyName("parallel_tool_calls"u8); + writer.WriteBooleanValue(ParallelToolCalls); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -309,7 +306,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW DateTimeOffset? completedAt = default; DateTimeOffset? cancelledAt = default; DateTimeOffset? failedAt = default; - IncompleteRunDetails? incompleteDetails = default; + IncompleteRunDetails incompleteDetails = default; RunCompletionUsage usage = default; float? temperature = default; float? topP = default; @@ -320,7 +317,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW BinaryData responseFormat = default; IReadOnlyDictionary metadata = default; UpdateToolResourcesOptions toolResources = default; - bool? parallelToolCalls = default; + bool parallelToolCalls = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -427,7 +424,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW incompleteDetails = null; continue; } - incompleteDetails = new IncompleteRunDetails(property.Value.GetString()); + incompleteDetails = IncompleteRunDetails.DeserializeIncompleteRunDetails(property.Value, options); continue; } if (property.NameEquals("usage"u8)) @@ -535,12 +532,8 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW toolResources = UpdateToolResourcesOptions.DeserializeUpdateToolResourcesOptions(property.Value, options); continue; } - if (property.NameEquals("parallelToolCalls"u8)) + if (property.NameEquals("parallel_tool_calls"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } parallelToolCalls = property.Value.GetBoolean(); continue; } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs index e3aa03d008e0..a15465abf330 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs @@ -57,7 +57,7 @@ public partial class ThreadRun /// /// The overridden enabled tools used for this agent thread run. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// The Unix timestamp, in seconds, representing when this object was created. /// The Unix timestamp, in seconds, representing when this item expires. @@ -73,8 +73,9 @@ public partial class ThreadRun /// Controls whether or not and which tool is called by the model. /// The response format of the tool calls used in this run. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + /// Determines if tools can be executed in parallel within the run. /// , , , , or is null. - internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails? incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata) + internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, bool parallelToolCalls) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); @@ -105,6 +106,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta ToolChoice = toolChoice; ResponseFormat = responseFormat; Metadata = metadata; + ParallelToolCalls = parallelToolCalls; } /// Initializes a new instance of . @@ -124,7 +126,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta /// /// The overridden enabled tools used for this agent thread run. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// The Unix timestamp, in seconds, representing when this object was created. /// The Unix timestamp, in seconds, representing when this item expires. @@ -145,7 +147,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. /// Determines if tools can be executed in parallel within the run. /// Keeps track of any properties unknown to the library. - internal ThreadRun(string id, string @object, string threadId, string assistantId, RunStatus status, RequiredAction requiredAction, RunError lastError, string model, string instructions, IReadOnlyList tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails? incompleteDetails, RunCompletionUsage usage, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, UpdateToolResourcesOptions toolResources, bool? parallelToolCalls, IDictionary serializedAdditionalRawData) + internal ThreadRun(string id, string @object, string threadId, string assistantId, RunStatus status, RequiredAction requiredAction, RunError lastError, string model, string instructions, IReadOnlyList tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, UpdateToolResourcesOptions toolResources, bool parallelToolCalls, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -207,7 +209,7 @@ internal ThreadRun() /// /// The overridden enabled tools used for this agent thread run. /// 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 . + /// The available derived classes include , , , , , , , and . /// public IReadOnlyList Tools { get; } /// The Unix timestamp, in seconds, representing when this object was created. @@ -223,7 +225,7 @@ internal ThreadRun() /// The Unix timestamp, in seconds, representing when this failed. public DateTimeOffset? FailedAt { get; } /// Details on why the run is incomplete. Will be `null` if the run is not incomplete. - public IncompleteRunDetails? IncompleteDetails { get; } + public IncompleteRunDetails IncompleteDetails { get; } /// Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). public RunCompletionUsage Usage { get; } /// The sampling temperature used for this run. If not set, defaults to 1. @@ -331,6 +333,6 @@ internal ThreadRun() /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. public UpdateToolResourcesOptions ToolResources { get; } /// Determines if tools can be executed in parallel within the run. - public bool? ParallelToolCalls { get; } + public bool ParallelToolCalls { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs index f0969e099cd3..9b4fec134cef 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs @@ -10,7 +10,7 @@ namespace Azure.AI.Projects { - /// A set of connection resources currently used by either the `bing_grounding`, `microsoft_fabric`, or `sharepoint_grounding` tools. + /// A set of connection resources currently used by either the `bing_grounding`, `fabric_aiskill`, or `sharepoint_grounding` tools. public partial class ToolConnectionList { /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs index 6a49db04a1ef..24642ea0f9fc 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs @@ -78,11 +78,13 @@ internal static ToolDefinition DeserializeToolDefinition(JsonElement element, Mo switch (discriminator.GetString()) { case "azure_ai_search": return AzureAISearchToolDefinition.DeserializeAzureAISearchToolDefinition(element, options); + case "azure_function": return AzureFunctionToolDefinition.DeserializeAzureFunctionToolDefinition(element, options); case "bing_grounding": return BingGroundingToolDefinition.DeserializeBingGroundingToolDefinition(element, options); case "code_interpreter": return CodeInterpreterToolDefinition.DeserializeCodeInterpreterToolDefinition(element, options); + case "fabric_aiskill": return MicrosoftFabricToolDefinition.DeserializeMicrosoftFabricToolDefinition(element, options); case "file_search": return FileSearchToolDefinition.DeserializeFileSearchToolDefinition(element, options); case "function": return FunctionToolDefinition.DeserializeFunctionToolDefinition(element, options); - case "microsoft_fabric": return MicrosoftFabricToolDefinition.DeserializeMicrosoftFabricToolDefinition(element, options); + case "openapi": return OpenApiToolDefinition.DeserializeOpenApiToolDefinition(element, options); case "sharepoint_grounding": return SharepointToolDefinition.DeserializeSharepointToolDefinition(element, options); } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs index f55e42475173..212407f403df 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Projects /// /// An abstract representation of an input tool definition that an agent can use. /// 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 . + /// The available derived classes include , , , , , , , and . /// public abstract partial class ToolDefinition { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs index 28193fd49d85..f3bc125c78b5 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs @@ -55,7 +55,7 @@ public ToolResources() } /// Initializes a new instance of . - /// Resources to be used by the `code_interpreter tool` consisting of file IDs. + /// Resources to be used by the `code_interpreter` tool consisting of file IDs. /// Resources to be used by the `file_search` tool consisting of vector store IDs. /// Resources to be used by the `azure_ai_search` tool consisting of index IDs and names. /// Keeps track of any properties unknown to the library. @@ -67,7 +67,7 @@ internal ToolResources(CodeInterpreterToolResource codeInterpreter, FileSearchTo _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Resources to be used by the `code_interpreter tool` consisting of file IDs. + /// Resources to be used by the `code_interpreter` tool consisting of file IDs. public CodeInterpreterToolResource CodeInterpreter { get; set; } /// Resources to be used by the `file_search` tool consisting of vector store IDs. public FileSearchToolResource FileSearch { get; set; } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.Serialization.cs new file mode 100644 index 000000000000..34ec6852a21e --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + internal partial class UnknownOpenApiAuthDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OpenApiAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenApiAuthDetails(document.RootElement, options); + } + + internal static UnknownOpenApiAuthDetails DeserializeUnknownOpenApiAuthDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OpenApiAuthType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new OpenApiAuthType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownOpenApiAuthDetails(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support writing '{options.Format}' format."); + } + } + + OpenApiAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenApiAuthDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownOpenApiAuthDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownOpenApiAuthDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.cs new file mode 100644 index 000000000000..4844d77a2185 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Unknown version of OpenApiAuthDetails. + internal partial class UnknownOpenApiAuthDetails : OpenApiAuthDetails + { + /// Initializes a new instance of . + /// The type of authentication, must be anonymous/connection/managed_identity. + /// Keeps track of any properties unknown to the library. + internal UnknownOpenApiAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownOpenApiAuthDetails() + { + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs index 518491348498..b83961c08f5a 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs @@ -60,7 +60,7 @@ internal UpdateAgentRequest() /// /// The modified collection of tools to enable for the agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, @@ -105,7 +105,7 @@ internal UpdateAgentRequest(string model, string name, string description, strin /// /// The modified collection of tools to enable for the agent. /// 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 . + /// The available derived classes include , , , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs index fa09eb23ce13..817dc0f97056 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs @@ -37,7 +37,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("uri"u8); writer.WriteStringValue(AssetIdentifier); writer.WritePropertyName("type"u8); - writer.WriteStringValue(AssetType.ToSerialString()); + writer.WriteStringValue(AssetType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -88,7 +88,7 @@ internal static VectorStoreDataSource DeserializeVectorStoreDataSource(JsonEleme } if (property.NameEquals("type"u8)) { - type = property.Value.GetString().ToVectorStoreDataSourceAssetType(); + type = new VectorStoreDataSourceAssetType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs deleted file mode 100644 index 86bb19f43769..000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.AI.Projects -{ - internal static partial class VectorStoreDataSourceAssetTypeExtensions - { - public static string ToSerialString(this VectorStoreDataSourceAssetType value) => value switch - { - VectorStoreDataSourceAssetType.UriAsset => "uri_asset", - VectorStoreDataSourceAssetType.IdAsset => "id_asset", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VectorStoreDataSourceAssetType value.") - }; - - public static VectorStoreDataSourceAssetType ToVectorStoreDataSourceAssetType(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "uri_asset")) return VectorStoreDataSourceAssetType.UriAsset; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "id_asset")) return VectorStoreDataSourceAssetType.IdAsset; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VectorStoreDataSourceAssetType value."); - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs index 29861bedb611..8a121dac0aef 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs @@ -5,17 +5,50 @@ #nullable disable +using System; +using System.ComponentModel; + namespace Azure.AI.Projects { /// /// Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, /// in the case of id_asset it should contain the data ID. /// - public enum VectorStoreDataSourceAssetType + public readonly partial struct VectorStoreDataSourceAssetType : IEquatable { - /// uri_asset. - UriAsset, - /// id_asset. - IdAsset + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorStoreDataSourceAssetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UriAssetValue = "uri_asset"; + private const string IdAssetValue = "id_asset"; + + /// Azure URI. + public static VectorStoreDataSourceAssetType UriAsset { get; } = new VectorStoreDataSourceAssetType(UriAssetValue); + /// The data ID. + public static VectorStoreDataSourceAssetType IdAsset { get; } = new VectorStoreDataSourceAssetType(IdAssetValue); + /// Determines if two values are the same. + public static bool operator ==(VectorStoreDataSourceAssetType left, VectorStoreDataSourceAssetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorStoreDataSourceAssetType left, VectorStoreDataSourceAssetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorStoreDataSourceAssetType(string value) => new VectorStoreDataSourceAssetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorStoreDataSourceAssetType other && Equals(other); + /// + public bool Equals(VectorStoreDataSourceAssetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs index cd886e226df3..05eefeb61296 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs @@ -10,7 +10,7 @@ namespace Azure.AI.Projects { - /// Details on the error that may have ocurred while processing a file for this vector store. + /// Details on the error that may have occurred while processing a file for this vector store. public partial class VectorStoreFileError { /// diff --git a/sdk/ai/Azure.AI.Projects/tests/AIProjectsTestEnvironment.cs b/sdk/ai/Azure.AI.Projects/tests/AIProjectsTestEnvironment.cs index 9e97874fba9c..79be1bc28e73 100644 --- a/sdk/ai/Azure.AI.Projects/tests/AIProjectsTestEnvironment.cs +++ b/sdk/ai/Azure.AI.Projects/tests/AIProjectsTestEnvironment.cs @@ -10,5 +10,6 @@ public class AIProjectsTestEnvironment : TestEnvironment public string AzureAICONNECTIONSTRING => GetRecordedVariable("PROJECT_CONNECTION_STRING"); public string BINGCONNECTIONNAME => GetRecordedVariable("BING_CONNECTION_NAME"); public string MODELDEPLOYMENTNAME => GetRecordedVariable("MODEL_DEPLOYMENT_NAME"); + public string STORAGE_QUEUE_URI => GetRecordedVariable("STORAGE_QUEUE_URI"); } } diff --git a/sdk/ai/Azure.AI.Projects/tests/Samples/Agent/Sample_Agent_Azure_Functions.cs b/sdk/ai/Azure.AI.Projects/tests/Samples/Agent/Sample_Agent_Azure_Functions.cs new file mode 100644 index 000000000000..400af35f18d1 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/tests/Samples/Agent/Sample_Agent_Azure_Functions.cs @@ -0,0 +1,121 @@ +// 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.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Projects.Tests; + +public partial class Sample_Agent_Azure_Functions : SamplesBase +{ + [Test] + public async Task AzureFunctionCallingExample() + { + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + var storageQueueUri = TestEnvironment.STORAGE_QUEUE_URI; + AgentsClient client = new(connectionString, new DefaultAzureCredential()); + + #region Snippet:AzureFunctionsDefineFunctionTools + AzureFunctionToolDefinition azureFnTool = new( + name: "foo", + description: "Get answers from the foo bot.", + inputBinding: new AzureFunctionBinding( + new AzureFunctionStorageQueue( + queueName: "azure-function-foo-input", + storageServiceEndpoint: storageQueueUri + ) + ), + outputBinding: new AzureFunctionBinding( + new AzureFunctionStorageQueue( + queueName: "azure-function-tool-output", + storageServiceEndpoint: storageQueueUri + ) + ), + parameters: BinaryData.FromObjectAsJson( + new + { + Type = "object", + Properties = new + { + query = new + { + Type = "string", + Description = "The question to ask.", + }, + outputqueueuri = new + { + Type = "string", + Description = "The full output queue uri." + } + }, + }, + new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase } + ) + ); + #endregion + + #region Snippet:AzureFunctionsCreateAgentWithFunctionTools + Response agentResponse = await client.CreateAgentAsync( + model: "gpt-4", + name: "azure-function-agent-foo", + instructions: "You are a helpful support agent. Use the provided function any " + + "time the prompt contains the string 'What would foo say?'. When you invoke " + + "the function, ALWAYS specify the output queue uri parameter as " + + $"'{storageQueueUri}/azure-function-tool-output'. Always responds with " + + "\"Foo says\" and then the response from the tool.", + tools: new List { azureFnTool } + ); + Agent agent = agentResponse.Value; + #endregion + + Response threadResponse = await client.CreateThreadAsync(); + AgentThread thread = threadResponse.Value; + + #region Snippet:AzureFunctionsHandlePollingWithRequiredAction + Response messageResponse = await client.CreateMessageAsync( + thread.Id, + MessageRole.User, + "What is the most prevalent element in the universe? What would foo say?"); + ThreadMessage message = messageResponse.Value; + + Response runResponse = await client.CreateRunAsync(thread, agent); + + do + { + await Task.Delay(TimeSpan.FromMilliseconds(500)); + runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id); + } + while (runResponse.Value.Status == RunStatus.Queued + || runResponse.Value.Status == RunStatus.InProgress + || runResponse.Value.Status == RunStatus.RequiresAction); + #endregion + + Response> afterRunMessagesResponse + = await client.GetMessagesAsync(thread.Id); + IReadOnlyList messages = afterRunMessagesResponse.Value.Data; + + // Note: messages iterate from newest to oldest, with the messages[0] being the most recent + foreach (ThreadMessage threadMessage in messages) + { + Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: "); + foreach (MessageContent contentItem in threadMessage.ContentItems) + { + if (contentItem is MessageTextContent textItem) + { + Console.Write(textItem.Text); + } + else if (contentItem is MessageImageFileContent imageFileItem) + { + Console.Write($" +{ + private static string GetFile([CallerFilePath] string pth = "") + { + var dirName = Path.GetDirectoryName(pth) ?? ""; + return Path.Combine(dirName, "weather_openapi.json"); + } + + [Test] + public async Task OpenAPICallingExample() + { + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + var storageQueueUri = TestEnvironment.STORAGE_QUEUE_URI; + AgentsClient client = new(connectionString, new DefaultAzureCredential()); + var file_path = GetFile(); + + #region Snippet:OpenAPIDefineFunctionTools + OpenApiAnonymousAuthDetails oaiAuth = new(); + OpenApiToolDefinition openapiTool = new( + name: "get_weather", + description: "Retrieve weather information for a location", + spec: BinaryData.FromBytes(File.ReadAllBytes(file_path)), + auth: oaiAuth + ); + + Response agentResponse = await client.CreateAgentAsync( + model: "gpt-4", + name: "azure-function-agent-foo", + instructions: "You are a helpful assistant.", + tools: new List { openapiTool } + ); + Agent agent = agentResponse.Value; + #endregion + + Response threadResponse = await client.CreateThreadAsync(); + AgentThread thread = threadResponse.Value; + + #region Snippet:OpenAPIHandlePollingWithRequiredAction + Response messageResponse = await client.CreateMessageAsync( + thread.Id, + MessageRole.User, + "What's the weather in Seattle?"); + ThreadMessage message = messageResponse.Value; + + Response runResponse = await client.CreateRunAsync(thread, agent); + + do + { + await Task.Delay(TimeSpan.FromMilliseconds(500)); + runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id); + } + while (runResponse.Value.Status == RunStatus.Queued + || runResponse.Value.Status == RunStatus.InProgress + || runResponse.Value.Status == RunStatus.RequiresAction); + #endregion + + Response> afterRunMessagesResponse + = await client.GetMessagesAsync(thread.Id); + IReadOnlyList messages = afterRunMessagesResponse.Value.Data; + + // Note: messages iterate from newest to oldest, with the messages[0] being the most recent + foreach (ThreadMessage threadMessage in messages) + { + Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: "); + foreach (MessageContent contentItem in threadMessage.ContentItems) + { + if (contentItem is MessageTextContent textItem) + { + Console.Write(textItem.Text); + } + else if (contentItem is MessageImageFileContent imageFileItem) + { + Console.Write($" NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/README.md b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/README.md index 15e100906e3d..17e91691beb0 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/README.md +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/CHANGELOG.md b/sdk/analysisservices/Azure.ResourceManager.Analysis/CHANGELOG.md index 484c1f8379ee..19b866147d97 100644 --- a/sdk/analysisservices/Azure.ResourceManager.Analysis/CHANGELOG.md +++ b/sdk/analysisservices/Azure.ResourceManager.Analysis/CHANGELOG.md @@ -60,7 +60,7 @@ New design of track 2 initial commit. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the type of property `ResourceType` of ExistingResourceSkuDetails from `String` to `ResourceType`. - The value of the int type generates an error when using ToSerialString() for type conversion, so the modelAsString in the corresponding property['x-ms-enum'] is converted to true in the autorest.md -- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Prepended `AnalysisServices` prefix to all single / simple model names - Optimized the name of some models and functions. @@ -76,5 +76,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/README.md b/sdk/analysisservices/Azure.ResourceManager.Analysis/README.md index a661b7317191..4b6a1f0ebfff 100644 --- a/sdk/analysisservices/Azure.ResourceManager.Analysis/README.md +++ b/sdk/analysisservices/Azure.ResourceManager.Analysis/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md b/sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md index 34f39d6e3861..b30cdb77933a 100644 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md +++ b/sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md @@ -245,7 +245,7 @@ These code samples show common scenario operations with the Azure Anomaly Detect ### Additional documentation -For more extensive documentation on Azure Anomaly Detector, see the [Anomaly Detector documentation](https://learn.microsoft.com/azure/cognitive-services/anomaly-detector/overview) on docs.microsoft.com. +For more extensive documentation on Azure Anomaly Detector, see the [Anomaly Detector documentation](https://learn.microsoft.com/azure/cognitive-services/anomaly-detector/overview) on learn.microsoft.com. ## Contributing @@ -257,18 +257,18 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [anomalydetector_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/anomalydetector/Azure.AI.AnomalyDetector/src -[anomalydetector_docs]: https://docs.microsoft.com/azure/cognitive-services/anomaly-detector/ +[anomalydetector_docs]: https://learn.microsoft.com/azure/cognitive-services/anomaly-detector/ [anomalydetector_refdocs]: https://azure.github.io/azure-sdk-for-net/cognitiveservices.html [anomalydetector_nuget_package]: https://www.nuget.org/packages/Azure.AI.AnomalyDetector [anomaly_detector_client_class]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectorClient.cs [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[aad_grant_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[aad_grant_access]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[cognitive_resource_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli [logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ [azure_portal]: https://portal.azure.com diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample4_MultivariateDetect.md b/sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample4_MultivariateDetect.md index 31a02097774a..3b1330d1d94b 100755 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample4_MultivariateDetect.md +++ b/sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample4_MultivariateDetect.md @@ -191,5 +191,5 @@ private void DeleteModel(AnomalyDetectorClient client, string modelId) [README]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md [datasource]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/anomalydetector/Azure.AI.AnomalyDetector/tests/samples/data/sample_data_20_3000.zip -[upload_blob]: https://docs.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-portal#upload-a-block-blob -[generate_sas]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-sas-tokens-for-blobs-in-the-azure-portal +[upload_blob]: https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-portal#upload-a-block-blob +[generate_sas]: https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-sas-tokens-for-blobs-in-the-azure-portal diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/tsp-location.yaml b/sdk/anomalydetector/Azure.AI.AnomalyDetector/tsp-location.yaml index d9c5a24606c8..7e9b3be5ffe1 100644 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/tsp-location.yaml +++ b/sdk/anomalydetector/Azure.AI.AnomalyDetector/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/cognitiveservices/AnomalyDetector -commit: 0410d404c68289cb1737d06bba92133bb84b515c +commit: 7e22a66617633d162735fe65388c2852127b4aac repo: Azure/azure-rest-api-specs diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/CHANGELOG.md b/sdk/apicenter/Azure.ResourceManager.ApiCenter/CHANGELOG.md index e37587da0582..767c166f233d 100644 --- a/sdk/apicenter/Azure.ResourceManager.ApiCenter/CHANGELOG.md +++ b/sdk/apicenter/Azure.ResourceManager.ApiCenter/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/README.md b/sdk/apicenter/Azure.ResourceManager.ApiCenter/README.md index a690be35cc60..4dfbbda17020 100644 --- a/sdk/apicenter/Azure.ResourceManager.ApiCenter/README.md +++ b/sdk/apicenter/Azure.ResourceManager.ApiCenter/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/CHANGELOG.md b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/CHANGELOG.md index 0e48946f2389..716b8780a241 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/CHANGELOG.md +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/CHANGELOG.md @@ -115,8 +115,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -147,4 +147,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/README.md b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/README.md index 7c1627a66387..1df555669bf5 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/README.md +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/CHANGELOG.md b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/CHANGELOG.md index 5599526ae0c2..411370e42fab 100644 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/CHANGELOG.md +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/CHANGELOG.md @@ -70,4 +70,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/README.md b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/README.md index 6fd2272785e6..c5ad78ec8ec0 100644 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/README.md +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md index ca6536496897..631f2f0c68a4 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md @@ -250,23 +250,23 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fappconfiguration%2FAzure.Data.AppConfiguration%2FREADME.png) -[azconfig_docs]: https://docs.microsoft.com/azure/azure-app-configuration/ +[azconfig_docs]: https://learn.microsoft.com/azure/azure-app-configuration/ [azconfig_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/CONTRIBUTING.md -[azconfig_setting_concepts]: https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value -[azconfig_asof_snapshot]: https://docs.microsoft.com/azure/azure-app-configuration/concept-point-time-snapshot -[aad_grant_access]: https://docs.microsoft.com/powershell/module/az.Resources/New-azRoleAssignment?view=azps-1.8.0 -[aad_register_app]: https://docs.microsoft.com/azure/app-service/configure-authentication-provider-aad#-configure-with-advanced-settings +[azconfig_setting_concepts]: https://learn.microsoft.com/azure/azure-app-configuration/concept-key-value +[azconfig_asof_snapshot]: https://learn.microsoft.com/azure/azure-app-configuration/concept-point-time-snapshot +[aad_grant_access]: https://learn.microsoft.com/powershell/module/az.Resources/New-azRoleAssignment?view=azps-1.8.0 +[aad_register_app]: https://learn.microsoft.com/azure/app-service/configure-authentication-provider-aad#-configure-with-advanced-settings [azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity [azure_identity_dac]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [azure_portal]: https://portal.azure.com [source_root]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/Azure.Data.AppConfiguration/src [source_samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/Azure.Data.AppConfiguration/samples [reference_docs]: https://azure.github.io/azure-sdk-for-net/appconfiguration.html -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [configuration_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/Azure.Data.AppConfiguration/src/ConfigurationClient.cs -[configuration_store]: https://docs.microsoft.com/azure/azure-app-configuration/quickstart-dotnet-core-app#create-an-app-configuration-store -[label_concept]: https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value#label-keys +[configuration_store]: https://learn.microsoft.com/azure/azure-app-configuration/quickstart-dotnet-core-app#create-an-app-configuration-store +[label_concept]: https://learn.microsoft.com/azure/azure-app-configuration/concept-key-value#label-keys [nuget]: https://www.nuget.org/ [package]: https://www.nuget.org/packages/Azure.Data.AppConfiguration/ [samples_readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/README.md diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/TROUBLESHOOTING.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/TROUBLESHOOTING.md index fab207b274bd..75e9085f1861 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/TROUBLESHOOTING.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/TROUBLESHOOTING.md @@ -15,7 +15,7 @@ This troubleshooting guide contains instructions to diagnose issues encountered ## General troubleshooting -All app configuration service operations will throw a [RequestFailedException](https://docs.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet) on failure. When you interact with the library, errors returned by the service correspond to the same HTTP status codes returned for [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api/) requests. For example, if you try to retrieve a Configuration Setting that doesn't exist in your Configuration Store, an HTTP `404` status is returned, indicating `Not Found`. +All app configuration service operations will throw a [RequestFailedException](https://learn.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet) on failure. When you interact with the library, errors returned by the service correspond to the same HTTP status codes returned for [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api/) requests. For example, if you try to retrieve a Configuration Setting that doesn't exist in your Configuration Store, an HTTP `404` status is returned, indicating `Not Found`. Here's an example of how to catch an exception: @@ -56,9 +56,9 @@ Content-Length: 0 ### Enable client logging -To troubleshoot issues with the library, first enable logging to monitor the behavior of the application. The errors and warnings in the logs generally provide useful insights into what went wrong and sometimes include corrective actions to fix issues. To learn more about the approach used for logging, see [Logging with the Azure SDK for .NET](https://docs.microsoft.com/dotnet/azure/sdk/logging). +To troubleshoot issues with the library, first enable logging to monitor the behavior of the application. The errors and warnings in the logs generally provide useful insights into what went wrong and sometimes include corrective actions to fix issues. To learn more about the approach used for logging, see [Logging with the Azure SDK for .NET](https://learn.microsoft.com/dotnet/azure/sdk/logging). -Basic information about HTTP sessions, such as URLs and headers, is logged at the `INFO` level. The simplest way to see the logs is to enable console logging. To create an Azure SDK log listener that outputs messages to the console, use the [AzureEventSourceListener.CreateConsoleLogger](https://docs.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener.createconsolelogger?view=azure-dotnet) method: +Basic information about HTTP sessions, such as URLs and headers, is logged at the `INFO` level. The simplest way to see the logs is to enable console logging. To create an Azure SDK log listener that outputs messages to the console, use the [AzureEventSourceListener.CreateConsoleLogger](https://learn.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener.createconsolelogger?view=azure-dotnet) method: ```csharp using Azure.Core.Diagnostics; @@ -125,7 +125,7 @@ To reduce number of requests made to App Configuration service, please check out ## Troubleshooting authentication issues -In addition to connection strings, Azure App Configuration supports [role-based access control](https://learn.microsoft.com/azure/role-based-access-control/overview) (RBAC) using Azure Active Directory authentication. The `Azure.Identity` package is used to obtain credentials for RBAC. For more information on getting started, see the [Azure App Configuration library's README](https://learn.microsoft.com/dotnet/api/overview/azure/data.appconfiguration-readme?view=azure-dotnet#authenticate-the-client). For details on the credential types supported in `Azure.Identity`, see the [Azure Identity documentation](https://docs.microsoft.com/dotnet/api/overview/azure/Identity-readme). +In addition to connection strings, Azure App Configuration supports [role-based access control](https://learn.microsoft.com/azure/role-based-access-control/overview) (RBAC) using Azure Active Directory authentication. The `Azure.Identity` package is used to obtain credentials for RBAC. For more information on getting started, see the [Azure App Configuration library's README](https://learn.microsoft.com/dotnet/api/overview/azure/data.appconfiguration-readme?view=azure-dotnet#authenticate-the-client). For details on the credential types supported in `Azure.Identity`, see the [Azure Identity documentation](https://learn.microsoft.com/dotnet/api/overview/azure/Identity-readme). When authentication or authorization fail, you're most likely to see one of the following errors: diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample12_GetSettingsUsingTags.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample12_GetSettingsUsingTags.md index 0af559c81ca0..b0a76ef9a3a7 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample12_GetSettingsUsingTags.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample12_GetSettingsUsingTags.md @@ -31,7 +31,7 @@ await client.AddConfigurationSettingAsync(betaEndpoint); ## Search by tags filter -To gather all the information available for settings grouped by a specific tag, call `GetConfigurationSettingsAsync` with a setting selector that filters for settings with the "someKey=someValue" tag. This will retrieve all the Configuration Settings in the store that satisfy that condition. See App Configuration [REST API](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-key-value#filtering) for more information about filtering. +To gather all the information available for settings grouped by a specific tag, call `GetConfigurationSettingsAsync` with a setting selector that filters for settings with the "someKey=someValue" tag. This will retrieve all the Configuration Settings in the store that satisfy that condition. See App Configuration [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api-key-value#filtering) for more information about filtering. ```C# Snippet:AzConfigSample12_GetConfigurationSettingsAsync var selector = new SettingSelector(); diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md index 28fb4b70edf1..940c61b0af47 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md @@ -51,7 +51,7 @@ await client.SetConfigurationSettingAsync(instancesToUpdate); ## Search by label filter -To gather all the information available for the "production" environment, call `GetConfigurationSettingsAsync` with a setting selector that filters for settings with the "production" label. This will retrieve all the Configuration Settings in the store that satisfy that condition. See App Configuration [REST API](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-key-value#filtering) for more information about filtering. +To gather all the information available for the "production" environment, call `GetConfigurationSettingsAsync` with a setting selector that filters for settings with the "production" label. This will retrieve all the Configuration Settings in the store that satisfy that condition. See App Configuration [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api-key-value#filtering) for more information about filtering. ```C# Snippet:AzConfigSample2_GetConfigurationSettingsAsync var selector = new SettingSelector { LabelFilter = "production" }; @@ -65,7 +65,7 @@ await foreach (ConfigurationSetting setting in client.GetConfigurationSettingsAs # Retrieve labels -To gather all the labels whose names start with the "production" environment, call `GetLabelsAsync` with a label selector that filters for labels that start with the "production" label name. This will retrieve all the labels in the store that satisfy that condition. See App Configuration [REST API](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-labels#filtering) for more information about filtering. +To gather all the labels whose names start with the "production" environment, call `GetLabelsAsync` with a label selector that filters for labels that start with the "production" label name. This will retrieve all the labels in the store that satisfy that condition. See App Configuration [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api-labels#filtering) for more information about filtering. ```C# Snippet:AzConfigSample2_GetLabelsAsync var labelsSelector = new SettingLabelSelector { NameFilter = "production*" }; diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample4_ReadRevisionHistory.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample4_ReadRevisionHistory.md index 35865c24a569..2384699f67f8 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample4_ReadRevisionHistory.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample4_ReadRevisionHistory.md @@ -35,7 +35,7 @@ await client.SetConfigurationSettingAsync(setting); ## Retrieve revisions of the setting -To asynchronously get all unexpired revisions, call `GetRevisionsAsync` with a setting selector that has `KeyFilter` equal to `settings.Key`. This will retrieve all revisions of this setting in the store. See App Configuration [REST API](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-revisions#filtering) for more information about filtering. +To asynchronously get all unexpired revisions, call `GetRevisionsAsync` with a setting selector that has `KeyFilter` equal to `settings.Key`. This will retrieve all revisions of this setting in the store. See App Configuration [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api-revisions#filtering) for more information about filtering. ```C# Snippet:AzConfigSample4_GetRevisions var selector = new SettingSelector { KeyFilter = setting.Key }; diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample5_GetSettingIfChanged.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample5_GetSettingIfChanged.md index e4c3116dbba5..cde193b7dd35 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample5_GetSettingIfChanged.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample5_GetSettingIfChanged.md @@ -4,7 +4,7 @@ This sample illustrates how to get a setting from the configuration store only i ## Define method `GetConfigurationSettingIfChanged` -When `GetConfigurationSetting` is called with `onlyIfChanged: true`, it adds an `If-None-Match` header to the HTTP request. The response will have an HTTP status code equals to either 200 if the setting value was modified or 304 otherwise. See App Configuration [REST API](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-key-value#get-conditionally) and [Azure API design](https://azure.github.io/azure-sdk/general_design.html#conditional-requests) for more information about conditional requests. +When `GetConfigurationSetting` is called with `onlyIfChanged: true`, it adds an `If-None-Match` header to the HTTP request. The response will have an HTTP status code equals to either 200 if the setting value was modified or 304 otherwise. See App Configuration [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api-key-value#get-conditionally) and [Azure API design](https://azure.github.io/azure-sdk/general_design.html#conditional-requests) for more information about conditional requests. This logic can be encapsulated into a helper method that will return either a setting from the response if it was changed in the configuration store or the current local setting otherwise. The method must check the response's HTTP status code before accessing the response value. If `response.Value` is accessed when no value was returned, an exception will be thrown. diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample6_UpdateSettingIfUnchanged.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample6_UpdateSettingIfUnchanged.md index b7c95b52a792..869ddbb17e11 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample6_UpdateSettingIfUnchanged.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample6_UpdateSettingIfUnchanged.md @@ -20,7 +20,7 @@ private int ReleaseVMs(int vmsToRelease) ## Define method `UpdateAvailableVms` -When `SetConfigurationSetting` is called with `onlyIfUnchanged: true`, it adds optional `If-Match` header to the HTTP request. Response will have HTTP status code equals to either 200 if client setting ETag matched the service one and setting has been successfully updated or 412 otherwise. See App Configuration [REST API](https://docs.microsoft.com/azure/azure-app-configuration/rest-api-key-value#get-conditionally) and [Azure API design](https://azure.github.io/azure-sdk/general_design.html#conditional-requests) for more information about conditional requests. +When `SetConfigurationSetting` is called with `onlyIfUnchanged: true`, it adds optional `If-Match` header to the HTTP request. Response will have HTTP status code equals to either 200 if client setting ETag matched the service one and setting has been successfully updated or 412 otherwise. See App Configuration [REST API](https://learn.microsoft.com/azure/azure-app-configuration/rest-api-key-value#get-conditionally) and [Azure API design](https://azure.github.io/azure-sdk/general_design.html#conditional-requests) for more information about conditional requests. To increase the number of available VMs, we need to get current number of VMs, add the number of released ones and send this number back to the service. If the `available_vms` setting has been modified since the last time our client retrieved it from the service, we need to catch `RequestFailedException` exception and re-apply our update logic before attempting to set it again on the service. This logic can be encapsulates into a helper method that will return the number of available VMs after the update. diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample8_ChangeNotification.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample8_ChangeNotification.md index 9494fb7c33b4..00a4ce351635 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample8_ChangeNotification.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample8_ChangeNotification.md @@ -1,6 +1,6 @@ # React to Settings Change Notifications -The AppConfiguration service supports [EventGrid-based setting change notifications](https://docs.microsoft.com/azure/azure-app-configuration/howto-app-configuration-event). This sample shows how to use the Azure.Data.AppConfiguration library to process these notifications. +The AppConfiguration service supports [EventGrid-based setting change notifications](https://learn.microsoft.com/azure/azure-app-configuration/howto-app-configuration-event). This sample shows how to use the Azure.Data.AppConfiguration library to process these notifications. This sample assumes you have a shared long-lived instance of `ConfigurationClient`: diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample9_FeatureFlags.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample9_FeatureFlags.md index da7bd3634f11..c3d4d37d744c 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample9_FeatureFlags.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample9_FeatureFlags.md @@ -1,6 +1,6 @@ # Create, Retrieve and Delete a Feature Flag -The AppConfiguration service supports [Feature flags](https://docs.microsoft.com/azure/azure-app-configuration/concept-feature-management). +The AppConfiguration service supports [Feature flags](https://learn.microsoft.com/azure/azure-app-configuration/concept-feature-management). Feature flags are settings that follow specific JSON schema for the `Value`, have key prefixed with the `.appconfig.featureflag/`, and the `application/vnd.microsoft.appconfig.ff+json;charset=utf-8` content type. The `Azure.Data.AppConfiguration` library provides a strongly-typed way of managing feature flags. This sample shows how to use the library to create, retrieve, and delete feature flags. diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md index f3b66c4eb347..311f7c7f4af1 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/CHANGELOG.md @@ -73,8 +73,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -141,4 +141,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/README.md b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/README.md index 6e9e4e93b3d7..299cde65dbd9 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/README.md +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/CHANGELOG.md b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/CHANGELOG.md index 272e9bab43f5..27788ba66571 100644 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/CHANGELOG.md +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/CHANGELOG.md @@ -90,4 +90,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/README.md b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/README.md index 853872f73cb6..8e06234df1ea 100644 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/README.md +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/CHANGELOG.md b/sdk/appplatform/Azure.ResourceManager.AppPlatform/CHANGELOG.md index b39107a4ac43..a83684cb416f 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/CHANGELOG.md +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/CHANGELOG.md @@ -77,8 +77,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -110,5 +110,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/README.md b/sdk/appplatform/Azure.ResourceManager.AppPlatform/README.md index 92666e7dbff8..91839cee28cb 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/README.md +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/CHANGELOG.md b/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/CHANGELOG.md index f3b51c96ad61..4ca2288d10b2 100644 --- a/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/CHANGELOG.md +++ b/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/CHANGELOG.md @@ -75,4 +75,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/README.md b/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/README.md index e8f858af5912..502141529b9a 100644 --- a/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/README.md +++ b/sdk/arc-scvmm/Azure.ResourceManager.ScVmm/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/astronomer/Azure.ResourceManager.Astro/CHANGELOG.md b/sdk/astronomer/Azure.ResourceManager.Astro/CHANGELOG.md index 25c098569b9b..12ce890acc40 100644 --- a/sdk/astronomer/Azure.ResourceManager.Astro/CHANGELOG.md +++ b/sdk/astronomer/Azure.ResourceManager.Astro/CHANGELOG.md @@ -30,4 +30,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/astronomer/Azure.ResourceManager.Astro/README.md b/sdk/astronomer/Azure.ResourceManager.Astro/README.md index d13428898e61..937dab3ab640 100644 --- a/sdk/astronomer/Azure.ResourceManager.Astro/README.md +++ b/sdk/astronomer/Azure.ResourceManager.Astro/README.md @@ -41,7 +41,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/CHANGELOG.md b/sdk/attestation/Azure.ResourceManager.Attestation/CHANGELOG.md index 9a6068fb068a..c4bc061bd248 100644 --- a/sdk/attestation/Azure.ResourceManager.Attestation/CHANGELOG.md +++ b/sdk/attestation/Azure.ResourceManager.Attestation/CHANGELOG.md @@ -63,4 +63,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/README.md b/sdk/attestation/Azure.ResourceManager.Attestation/README.md index f404fa0f49c0..7db553b09d48 100644 --- a/sdk/attestation/Azure.ResourceManager.Attestation/README.md +++ b/sdk/attestation/Azure.ResourceManager.Attestation/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/attestation/Azure.Security.Attestation/CHANGELOG.md b/sdk/attestation/Azure.Security.Attestation/CHANGELOG.md index b10cd5e550a0..6ec527dae139 100644 --- a/sdk/attestation/Azure.Security.Attestation/CHANGELOG.md +++ b/sdk/attestation/Azure.Security.Attestation/CHANGELOG.md @@ -33,8 +33,8 @@ Debug.Assert(attestationPolicyHash.SequenceEqual(setResult.Value.PolicyTokenHash - The JSON Web Token associated properties in the `AttestationToken` class have been converted to nullable types to allow the AttestationToken class to express JSON Web Signature objects. - The token validation related properties in the `AttestationClientOptions` class (validateAttestationTokens, validationCallback) have been moved into the new `TokenValidationOptions` class. - The `TokenValidationOptions` class contains a number of options to tweak the JSON Web Token validation process, modeled extremely loosely after constructs in [Nimbus JWT](https://connect2id.com/products/nimbus-jose-jwt) and [PyJWT](https://pypi.org/project/PyJWT/). -- The validationCallback in the `TokenValidationOptions` object has been moved to a `TokenValidated` event on the `TokenValidationOptions` class. The `TokenValidated` event derives from the [SyncAsyncEventHandler](https://docs.microsoft.com/dotnet/api/azure.core.syncasynceventhandler-1) class, enabling both synchronous and asynchronous event handlers. -- The `TokenBody` and `TokenHeader` properties have been removed from the [AttestationToken](https://docs.microsoft.com/dotnet/api/azure.security.attestation.attestationtoken) object since they were redundant. +- The validationCallback in the `TokenValidationOptions` object has been moved to a `TokenValidated` event on the `TokenValidationOptions` class. The `TokenValidated` event derives from the [SyncAsyncEventHandler](https://learn.microsoft.com/dotnet/api/azure.core.syncasynceventhandler-1) class, enabling both synchronous and asynchronous event handlers. +- The `TokenBody` and `TokenHeader` properties have been removed from the [AttestationToken](https://learn.microsoft.com/dotnet/api/azure.security.attestation.attestationtoken) object since they were redundant. - The `TokenSigningKey` type has been renamed `AttestationTokenSigningKey`. - The `PolicyResult` type has been renamed `PolicyModificationResult`. - The constructor for the `AttestationToken` class has been changed from taking an `object` to taking a `BinaryData`. This allows callers to use their preferred serialization diff --git a/sdk/attestation/Azure.Security.Attestation/README.md b/sdk/attestation/Azure.Security.Attestation/README.md index 1f38a0c6763d..709f8a75ad1e 100644 --- a/sdk/attestation/Azure.Security.Attestation/README.md +++ b/sdk/attestation/Azure.Security.Attestation/README.md @@ -10,7 +10,7 @@ Azure Attestation receives evidence from compute entities, turns them into a set > NOTE: This is a preview SDK for the Microsoft Azure Attestation service. It provides all the essential functionality to access the Azure Attestation service, it should be considered 'as-is" and is subject to changes in the future which may break compatibility with previous versions. - [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/attestation/Azure.Security.Attestation) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Security.Attestation) | [API reference documentation][API_reference] | [Product documentation](https://docs.microsoft.com/azure/attestation/) + [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/attestation/Azure.Security.Attestation) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Security.Attestation) | [API reference documentation][API_reference] | [Product documentation](https://learn.microsoft.com/azure/attestation/) ## Getting started @@ -121,7 +121,7 @@ The [`AttestationResponse`][attestation_response] object contains two main prope Each attestation service instance has a policy applied to it which defines additional criteria which the customer has defined. -For more information on attestation policies, see [Attestation Policy](https://docs.microsoft.com/azure/attestation/author-sign-policy) +For more information on attestation policies, see [Attestation Policy](https://learn.microsoft.com/azure/attestation/author-sign-policy) ### Policy Management certificate management @@ -149,7 +149,7 @@ RuntimeData refers to data which is presented to the Intel SGX Quote generation InitTime data refers to data which is used to configure the SGX enclave being attested. -> Note that InitTime data is not supported on Azure [DCsv2-Series](https://docs.microsoft.com/azure/virtual-machines/dcv2-series) virtual machines. +> Note that InitTime data is not supported on Azure [DCsv2-Series](https://learn.microsoft.com/azure/virtual-machines/dcv2-series) virtual machines. ### Thread safety @@ -316,11 +316,11 @@ catch (RequestFailedException ex) } ``` -Additional troubleshooting information for the MAA service can be found [here](https://docs.microsoft.com/azure/attestation/troubleshoot-guide) +Additional troubleshooting information for the MAA service can be found [here](https://learn.microsoft.com/azure/attestation/troubleshoot-guide) ## Next steps -For more information about the Microsoft Azure Attestation service, please see our [documentation page](https://docs.microsoft.com/azure/attestation/). +For more information about the Microsoft Azure Attestation service, please see our [documentation page](https://learn.microsoft.com/azure/attestation/). ## Contributing @@ -333,19 +333,19 @@ This project has adopted the [Microsoft Open Source Code of Conduct][microsoft_c See [CONTRIBUTING.md][contributing] for details on building, testing, and contributing to these libraries. -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide [microsoft_code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[API_reference]: https://docs.microsoft.com/dotnet/api/azure.security.attestation?view=azure-dotnet-preview -[attestation_admin_client]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.attestationadministrationclient -[attestation_client]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.attestationclient -[attestation_response]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.attestationresponse-1 -[attestation_response_token]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.attestationresponse-1.token -[attestation_response_value]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.attestationresponse-1.value -[attestation_policy_modification_result]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.policymodificationresult -[attestation_policy_modification_result_signer]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.policymodificationresult.policysigner -[attestation_policy_modification_result_token_hash]: https://docs.microsoft.com/dotnet/api/azure.security.attestation.policymodificationresult.policytokenhash -[azure_cli]: https://docs.microsoft.com/cli/azure +[API_reference]: https://learn.microsoft.com/dotnet/api/azure.security.attestation?view=azure-dotnet-preview +[attestation_admin_client]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.attestationadministrationclient +[attestation_client]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.attestationclient +[attestation_response]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.attestationresponse-1 +[attestation_response_token]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.attestationresponse-1.token +[attestation_response_value]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.attestationresponse-1.value +[attestation_policy_modification_result]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.policymodificationresult +[attestation_policy_modification_result_signer]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.policymodificationresult.policysigner +[attestation_policy_modification_result_token_hash]: https://learn.microsoft.com/dotnet/api/azure.security.attestation.policymodificationresult.policytokenhash +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [azure_sub]: https://azure.microsoft.com/free/dotnet/ [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/CHANGELOG.md b/sdk/authorization/Azure.ResourceManager.Authorization/CHANGELOG.md index 074025076434..15a9a74c2956 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/CHANGELOG.md +++ b/sdk/authorization/Azure.ResourceManager.Authorization/CHANGELOG.md @@ -91,8 +91,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -127,4 +127,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/README.md b/sdk/authorization/Azure.ResourceManager.Authorization/README.md index d9aa824d2b8d..c96822a4cea2 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/README.md +++ b/sdk/authorization/Azure.ResourceManager.Authorization/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/CHANGELOG.md b/sdk/automanage/Azure.ResourceManager.Automanage/CHANGELOG.md index d7fcaadddd68..067bb574608a 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/CHANGELOG.md +++ b/sdk/automanage/Azure.ResourceManager.Automanage/CHANGELOG.md @@ -79,5 +79,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/README.md b/sdk/automanage/Azure.ResourceManager.Automanage/README.md index 54f8df01b60e..324114cf49ee 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/README.md +++ b/sdk/automanage/Azure.ResourceManager.Automanage/README.md @@ -39,13 +39,13 @@ Key concepts of the Azure .NET SDK can be found [here](https://azure.github.io/a Documentation is available to help you learn how to use this package - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md) -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet) +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet) - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md) ## Examples Code samples for using the management library for .NET can be found in the following locations -- [.NET Management Library Code Samples](https://docs.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) +- [.NET Management Library Code Samples](https://learn.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) ## Troubleshooting diff --git a/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md b/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md index 9677747351f0..24e9853621de 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md +++ b/sdk/automation/Azure.ResourceManager.Automation/CHANGELOG.md @@ -64,7 +64,7 @@ Polishing since last public beta release: - Corrected the format of all `Uri` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -96,4 +96,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/automation/Azure.ResourceManager.Automation/README.md b/sdk/automation/Azure.ResourceManager.Automation/README.md index e17dc8bc95ae..bacf6eb0c6e3 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/README.md +++ b/sdk/automation/Azure.ResourceManager.Automation/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/avs/Azure.ResourceManager.Avs/CHANGELOG.md b/sdk/avs/Azure.ResourceManager.Avs/CHANGELOG.md index c72d9ff81125..3a7787632cca 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/CHANGELOG.md +++ b/sdk/avs/Azure.ResourceManager.Avs/CHANGELOG.md @@ -102,4 +102,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/avs/Azure.ResourceManager.Avs/README.md b/sdk/avs/Azure.ResourceManager.Avs/README.md index 43031ddab110..d1d6b8cef4d2 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/README.md +++ b/sdk/avs/Azure.ResourceManager.Avs/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/CHANGELOG.md b/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/CHANGELOG.md index 5b3461d97548..c6c7722e3668 100644 --- a/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/CHANGELOG.md +++ b/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/CHANGELOG.md @@ -26,4 +26,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/README.md b/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/README.md index 0ac941914757..273a474656c9 100644 --- a/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/README.md +++ b/sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/README.md @@ -43,7 +43,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/CHANGELOG.md b/sdk/azurestackhci/Azure.ResourceManager.Hci/CHANGELOG.md index 4cc3872326bc..343c1da1be05 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/CHANGELOG.md +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/CHANGELOG.md @@ -65,8 +65,8 @@ This release is the first stable release of the Azure Stack HCI Management clien Polishing since last public beta release: - Prepended `Hci` prefix to all single / simple model names. - Corrected the format of all `Guid` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -141,4 +141,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/README.md b/sdk/azurestackhci/Azure.ResourceManager.Hci/README.md index 80f0d7c6684e..65d07da517ce 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/README.md +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/batch/Azure.Compute.Batch/CHANGELOG.md b/sdk/batch/Azure.Compute.Batch/CHANGELOG.md index 335dc61a5db0..d3420305b5e6 100644 --- a/sdk/batch/Azure.Compute.Batch/CHANGELOG.md +++ b/sdk/batch/Azure.Compute.Batch/CHANGELOG.md @@ -22,4 +22,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/batch/Azure.Compute.Batch/tsp-location.yaml b/sdk/batch/Azure.Compute.Batch/tsp-location.yaml index 2ee0a19d69f9..399863ae4a83 100644 --- a/sdk/batch/Azure.Compute.Batch/tsp-location.yaml +++ b/sdk/batch/Azure.Compute.Batch/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/batch/Azure.Batch -commit: 54ba891230da9c06f73b697a2192a1937575dfef +commit: 9df71d5a717e4ed5e6728e7e6ba2fead60f62243 repo: Azure/azure-rest-api-specs diff --git a/sdk/batch/Azure.ResourceManager.Batch/CHANGELOG.md b/sdk/batch/Azure.ResourceManager.Batch/CHANGELOG.md index eb901be46ec4..7cd9216517e9 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/CHANGELOG.md +++ b/sdk/batch/Azure.ResourceManager.Batch/CHANGELOG.md @@ -156,8 +156,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -188,4 +188,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/batch/Azure.ResourceManager.Batch/README.md b/sdk/batch/Azure.ResourceManager.Batch/README.md index d94a58e209e6..04d10fcfc530 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/README.md +++ b/sdk/batch/Azure.ResourceManager.Batch/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/CHANGELOG.md b/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/CHANGELOG.md index 4c4c1a9f5a62..d759341931ee 100644 --- a/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/CHANGELOG.md +++ b/sdk/batch/Microsoft.Azure.Batch.Conventions.Files/CHANGELOG.md @@ -43,7 +43,7 @@ The changes incorporated in this version are the product of migrating from the d - JobOutputStorage - Replaced all instances of `CloudStorageAccount` with **BlobServiceClient** - Replaced all instances of `CloudBlobContainer` with **BlobContainerClient** - - Removed the `IRetryPolicy` reference from the constructors as it is no longer supported in the new storage sdk. If you wish to specify how retry attempts are made, you will have to do so by specifying the `Retry` property within the `BlobClientOptions` passed into the **BlobServiceClient** object. More information can be found [here](https://docs.microsoft.com/dotnet/api/azure.storage.blobs.blobclientoptions) + - Removed the `IRetryPolicy` reference from the constructors as it is no longer supported in the new storage sdk. If you wish to specify how retry attempts are made, you will have to do so by specifying the `Retry` property within the `BlobClientOptions` passed into the **BlobServiceClient** object. More information can be found [here](https://learn.microsoft.com/dotnet/api/azure.storage.blobs.blobclientoptions) - Renamed the `GetOutputAsync` method to **GetOutput** as the method is no longer asynchronous, also removed the `CancellationToken` parameter. - OutputFileReference @@ -54,7 +54,7 @@ The changes incorporated in this version are the product of migrating from the d - TaskOutputStorage - Replaced all instances of `CloudStorageAccount` with **BlobServiceClient** - Replaced all instances of `CloudBlobContainer` with **BlobContainerClient** - - Removed the `IRetryPolicy` reference from the constructors as it is no longer supported in the new storage sdk. If you wish to specify how retry attempts are made, you will have to do so by specifying the `Retry` property within the `BlobClientOptions` passed into the **BlobServiceClient** object. More information can be found [here](https://docs.microsoft.com/dotnet/api/azure.storage.blobs.blobclientoptions) + - Removed the `IRetryPolicy` reference from the constructors as it is no longer supported in the new storage sdk. If you wish to specify how retry attempts are made, you will have to do so by specifying the `Retry` property within the `BlobClientOptions` passed into the **BlobServiceClient** object. More information can be found [here](https://learn.microsoft.com/dotnet/api/azure.storage.blobs.blobclientoptions) - Renamed the `GetOutputAsync` method to **GetOutput** as the method is no longer asynchronous, also removed the `CancellationToken` parameter. - TrackedFile diff --git a/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md b/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md index 4e2f087a290b..9acdba55d1fb 100644 --- a/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md +++ b/sdk/batch/Microsoft.Azure.Batch/CHANGELOG.md @@ -291,7 +291,7 @@ This version of the Batch .NET client library targets version 2018-08-01.7.0 of ### Features - Added the ability to see what version of the Azure Batch Node Agent is running on each of the VMs in a pool, via the new `NodeAgentInformation` property on `ComputeNode`. -- Added the ability to specify a `Filter` on the `Result` of a task. See [here](https://docs.microsoft.com/rest/api/batchservice/odata-filters-in-batch) for more details. +- Added the ability to specify a `Filter` on the `Result` of a task. See [here](https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch) for more details. - This enables the often requested scenario of performing a server-side query to find all tasks which failed. - **[Breaking]** Added a default retry policy to `BatchClient`. - Note that this policy may not be sufficient for every case. If the old behavior (a `BatchClient` that doesn't perform any retries) is desired, the default policy can be removed from a `BatchClient` with `client.CustomBehaviors = client.CustomBehaviors.Where(behavior => !(behavior is RetryPolicyProvider)).ToList()`. diff --git a/sdk/billing/Azure.ResourceManager.Billing/CHANGELOG.md b/sdk/billing/Azure.ResourceManager.Billing/CHANGELOG.md index cc01f314381f..81c2c0d303b8 100644 --- a/sdk/billing/Azure.ResourceManager.Billing/CHANGELOG.md +++ b/sdk/billing/Azure.ResourceManager.Billing/CHANGELOG.md @@ -91,4 +91,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/billing/Azure.ResourceManager.Billing/README.md b/sdk/billing/Azure.ResourceManager.Billing/README.md index d061ec172763..5b846b3bdaed 100644 --- a/sdk/billing/Azure.ResourceManager.Billing/README.md +++ b/sdk/billing/Azure.ResourceManager.Billing/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/CHANGELOG.md b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/CHANGELOG.md index c9d7fe3c9acc..da6273638e92 100644 --- a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/CHANGELOG.md +++ b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/CHANGELOG.md @@ -48,4 +48,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/README.md b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/README.md index 50f335b4ffe2..0b404d47de56 100644 --- a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/README.md +++ b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/CHANGELOG.md b/sdk/blueprint/Azure.ResourceManager.Blueprint/CHANGELOG.md index 47721cb817fd..c3f24a6dd1e9 100644 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/CHANGELOG.md +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/CHANGELOG.md @@ -63,4 +63,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/README.md b/sdk/blueprint/Azure.ResourceManager.Blueprint/README.md index 3d80856d48a2..d483ea88c076 100644 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/README.md +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/botservice/Azure.ResourceManager.BotService/CHANGELOG.md b/sdk/botservice/Azure.ResourceManager.BotService/CHANGELOG.md index 5ae5a28656b2..4df1bcae450f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/CHANGELOG.md +++ b/sdk/botservice/Azure.ResourceManager.BotService/CHANGELOG.md @@ -79,4 +79,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/botservice/Azure.ResourceManager.BotService/README.md b/sdk/botservice/Azure.ResourceManager.BotService/README.md index ea6a64ccb78d..662a6368c5c5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/README.md +++ b/sdk/botservice/Azure.ResourceManager.BotService/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/CHANGELOG.md b/sdk/cdn/Azure.ResourceManager.Cdn/CHANGELOG.md index 9474c7332748..a44abee6b49e 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/CHANGELOG.md +++ b/sdk/cdn/Azure.ResourceManager.Cdn/CHANGELOG.md @@ -94,8 +94,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Optimized the name of some models and properties. - Flattened property from a read-only model no longer has setters. @@ -176,4 +176,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/README.md b/sdk/cdn/Azure.ResourceManager.Cdn/README.md index 2c7b7fa26932..51faee3bc515 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/README.md +++ b/sdk/cdn/Azure.ResourceManager.Cdn/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/CHANGELOG.md b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/CHANGELOG.md index c96d7d3f4f72..7dde00cbbd4b 100644 --- a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/CHANGELOG.md +++ b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/CHANGELOG.md @@ -78,4 +78,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/README.md b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/README.md index b30b48b4443d..d228c0433748 100644 --- a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/README.md +++ b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/README.md @@ -42,7 +42,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/CHANGELOG.md b/sdk/chaos/Azure.ResourceManager.Chaos/CHANGELOG.md index cc3206611df7..cf908f5d82a3 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/CHANGELOG.md +++ b/sdk/chaos/Azure.ResourceManager.Chaos/CHANGELOG.md @@ -100,4 +100,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/README.md b/sdk/chaos/Azure.ResourceManager.Chaos/README.md index 44b8b125999f..d7c1d1a8bfa3 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/README.md +++ b/sdk/chaos/Azure.ResourceManager.Chaos/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/cloudmachine/Azure.CloudMachine.All/src/Azure.CloudMachine.All.csproj b/sdk/cloudmachine/Azure.CloudMachine.All/src/Azure.CloudMachine.All.csproj index 38cea841c695..1632a21bf7a4 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.All/src/Azure.CloudMachine.All.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine.All/src/Azure.CloudMachine.All.csproj @@ -12,6 +12,7 @@ + diff --git a/sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/CHANGELOG.md similarity index 55% rename from sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/CHANGELOG.md index 3f2cb968cbeb..13dd08af78ab 100644 --- a/sdk/maps/Azure.Maps.TimeZone/CHANGELOG.md +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/CHANGELOG.md @@ -4,4 +4,8 @@ ### Features Added -- Initial release +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/README.md b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/README.md new file mode 100644 index 000000000000..534fb96ad872 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/README.md @@ -0,0 +1,57 @@ +# AI extensions for Azure CloudMachine client library for .NET + +TODO + +## Getting started + +### Install the package + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.CloudMachine --prerelease +``` + +### Prerequisites + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +## Key concepts + +TODO. + +## Examples + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs new file mode 100644 index 000000000000..696013d944e8 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs @@ -0,0 +1,71 @@ +namespace Azure.CloudMachine.OpenAI +{ + public enum AIModelKind + { + Chat = 0, + Embedding = 1, + } + public static partial class AzureOpenAIExtensions + { + public static void Add(this System.Collections.Generic.List messages, OpenAI.Chat.ChatCompletion completion) { } + public static void Add(this System.Collections.Generic.List messages, System.Collections.Generic.IEnumerable entries) { } + public static void Add(this System.Collections.Generic.List messages, System.Collections.Generic.IEnumerable toolCallResults) { } + public static string AsText(this OpenAI.Chat.ChatCompletion completion) { throw null; } + public static string AsText(this OpenAI.Chat.ChatMessageContent content) { throw null; } + public static string AsText(this System.ClientModel.ClientResult completionResult) { throw null; } + public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static void Trim(this System.Collections.Generic.List messages) { } + } + public partial class ChatTools + { + public ChatTools(params System.Type[] tools) { } + public System.Collections.Generic.IList Definitions { get { throw null; } } + public void Add(System.Reflection.MethodInfo function) { } + public void Add(System.Type functions) { } + public string Call(OpenAI.Chat.ChatToolCall call) { throw null; } + public string Call(string name, object[] arguments) { throw null; } + public System.Collections.Generic.IEnumerable CallAll(System.Collections.Generic.IEnumerable toolCalls) { throw null; } + public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.CloudMachine.OpenAI.ChatTools tools) { throw null; } + } + public partial class EmbeddingsVectorbase + { + public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.CloudMachine.OpenAI.VectorbaseStore? store = null, int factChunkSize = 1000) { } + public void Add(System.BinaryData data) { } + public void Add(string text) { } + public System.Collections.Generic.IEnumerable Find(string text, Azure.CloudMachine.OpenAI.FindOptions? options = null) { throw null; } + } + public partial class FindOptions + { + public FindOptions() { } + public int MaxEntries { get { throw null; } set { } } + public float Threshold { get { throw null; } set { } } + } + public partial class OpenAIModelFeature : Azure.CloudMachine.Core.CloudMachineFeature + { + public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine.OpenAI.AIModelKind kind = Azure.CloudMachine.OpenAI.AIModelKind.Chat) { } + public string Model { get { throw null; } } + public string ModelVersion { get { throw null; } } + protected override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected override void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VectorbaseEntry + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorbaseEntry(System.ReadOnlyMemory vector, System.BinaryData data, int? id = default(int?)) { throw null; } + public System.BinaryData Data { get { throw null; } } + public int? Id { get { throw null; } } + public System.ReadOnlyMemory Vector { get { throw null; } } + } + public abstract partial class VectorbaseStore + { + protected VectorbaseStore() { } + public abstract int Add(Azure.CloudMachine.OpenAI.VectorbaseEntry entry); + public abstract void Add(System.Collections.Generic.IReadOnlyList entry); + public static float CosineSimilarity(System.ReadOnlySpan x, System.ReadOnlySpan y) { throw null; } + public abstract System.Collections.Generic.IEnumerable Find(System.ReadOnlyMemory vector, Azure.CloudMachine.OpenAI.FindOptions options); + } +} diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs new file mode 100644 index 000000000000..696013d944e8 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs @@ -0,0 +1,71 @@ +namespace Azure.CloudMachine.OpenAI +{ + public enum AIModelKind + { + Chat = 0, + Embedding = 1, + } + public static partial class AzureOpenAIExtensions + { + public static void Add(this System.Collections.Generic.List messages, OpenAI.Chat.ChatCompletion completion) { } + public static void Add(this System.Collections.Generic.List messages, System.Collections.Generic.IEnumerable entries) { } + public static void Add(this System.Collections.Generic.List messages, System.Collections.Generic.IEnumerable toolCallResults) { } + public static string AsText(this OpenAI.Chat.ChatCompletion completion) { throw null; } + public static string AsText(this OpenAI.Chat.ChatMessageContent content) { throw null; } + public static string AsText(this System.ClientModel.ClientResult completionResult) { throw null; } + public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } + public static void Trim(this System.Collections.Generic.List messages) { } + } + public partial class ChatTools + { + public ChatTools(params System.Type[] tools) { } + public System.Collections.Generic.IList Definitions { get { throw null; } } + public void Add(System.Reflection.MethodInfo function) { } + public void Add(System.Type functions) { } + public string Call(OpenAI.Chat.ChatToolCall call) { throw null; } + public string Call(string name, object[] arguments) { throw null; } + public System.Collections.Generic.IEnumerable CallAll(System.Collections.Generic.IEnumerable toolCalls) { throw null; } + public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.CloudMachine.OpenAI.ChatTools tools) { throw null; } + } + public partial class EmbeddingsVectorbase + { + public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.CloudMachine.OpenAI.VectorbaseStore? store = null, int factChunkSize = 1000) { } + public void Add(System.BinaryData data) { } + public void Add(string text) { } + public System.Collections.Generic.IEnumerable Find(string text, Azure.CloudMachine.OpenAI.FindOptions? options = null) { throw null; } + } + public partial class FindOptions + { + public FindOptions() { } + public int MaxEntries { get { throw null; } set { } } + public float Threshold { get { throw null; } set { } } + } + public partial class OpenAIModelFeature : Azure.CloudMachine.Core.CloudMachineFeature + { + public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine.OpenAI.AIModelKind kind = Azure.CloudMachine.OpenAI.AIModelKind.Chat) { } + public string Model { get { throw null; } } + public string ModelVersion { get { throw null; } } + protected override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected override void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VectorbaseEntry + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorbaseEntry(System.ReadOnlyMemory vector, System.BinaryData data, int? id = default(int?)) { throw null; } + public System.BinaryData Data { get { throw null; } } + public int? Id { get { throw null; } } + public System.ReadOnlyMemory Vector { get { throw null; } } + } + public abstract partial class VectorbaseStore + { + protected VectorbaseStore() { } + public abstract int Add(Azure.CloudMachine.OpenAI.VectorbaseEntry entry); + public abstract void Add(System.Collections.Generic.IReadOnlyList entry); + public static float CosineSimilarity(System.ReadOnlySpan x, System.ReadOnlySpan y) { throw null; } + public abstract System.Collections.Generic.IEnumerable Find(System.ReadOnlyMemory vector, Azure.CloudMachine.OpenAI.FindOptions options); + } +} diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj new file mode 100644 index 000000000000..b4af8fe0dfed --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/Azure.CloudMachine.OpenAI.csproj @@ -0,0 +1,25 @@ + + + + AI extensions for Azure.CloudMachine + 1.0.0-beta.1 + $(RequiredTargetFrameworks) + 12 + enable + + + CS1591 + OPENAI001 + + + + + + + + + + + + + diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/AzureOpenAIExtensions.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs similarity index 93% rename from sdk/cloudmachine/Azure.CloudMachine/src/extensions/AzureOpenAIExtensions.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs index 741d05b5eeed..fe65791080ef 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/AzureOpenAIExtensions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs @@ -142,4 +142,12 @@ public static void Add(this List messages, IEnumerable public static void Add(this List messages, ChatCompletion completion) => messages.Add(ChatMessage.CreateAssistantMessage(completion)); + + /// + /// Adds a list of tool chat messages to the list of chat messages. + /// + /// + /// + public static void Add(this List messages, IEnumerable toolCallResults) + => messages.AddRange(toolCallResults); } diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/ChatTools.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/ChatTools.cs similarity index 95% rename from sdk/cloudmachine/Azure.CloudMachine/src/extensions/ChatTools.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/ChatTools.cs index be51567ab0f6..cc50493304f0 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/ChatTools.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/ChatTools.cs @@ -82,8 +82,8 @@ public void Add(MethodInfo function) public string Call(string name, object[] arguments) { MethodInfo method = _methods[name]; - object result = method.Invoke(null, arguments); - return result.ToString(); + object? result = method.Invoke(null, arguments); + return result!.ToString()!; } /// @@ -146,7 +146,7 @@ public IEnumerable CallAll(IEnumerable toolCalls) private static string MethodInfoToDescription(MethodInfo function) { var description = function.Name; - DescriptionAttribute attribute = function.GetCustomAttribute(); + DescriptionAttribute? attribute = function.GetCustomAttribute(); if (attribute != null) { description = attribute.Description; @@ -154,10 +154,10 @@ private static string MethodInfoToDescription(MethodInfo function) return description; } - private static string ParameterInfoToDescription(ParameterInfo parameter) + private static string? ParameterInfoToDescription(ParameterInfo parameter) { - var description = parameter.Name; - DescriptionAttribute attribute = parameter.GetCustomAttribute(); + string? description = parameter.Name; + DescriptionAttribute? attribute = parameter.GetCustomAttribute(); if (attribute != null) { description = attribute.Description; diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/EmbeddingsVectorbase.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/EmbeddingsVectorbase.cs similarity index 98% rename from sdk/cloudmachine/Azure.CloudMachine/src/extensions/EmbeddingsVectorbase.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/EmbeddingsVectorbase.cs index ab1cf6a63892..53565411ad2d 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/EmbeddingsVectorbase.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/EmbeddingsVectorbase.cs @@ -23,7 +23,7 @@ public class EmbeddingsVectorbase /// /// /// - public EmbeddingsVectorbase(EmbeddingClient client, VectorbaseStore store = default, int factChunkSize = 1000) + public EmbeddingsVectorbase(EmbeddingClient client, VectorbaseStore? store = default, int factChunkSize = 1000) { _client = client; _store = store ?? new MemoryVectorbaseStore(); @@ -59,7 +59,7 @@ public void Add(BinaryData data) /// /// /// - public IEnumerable Find(string text, FindOptions options = default) + public IEnumerable Find(string text, FindOptions? options = default) { options ??= new FindOptions(); if (_todo.Count > 0) diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/MemoryVectorbaseStore.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/MemoryVectorbaseStore.cs similarity index 100% rename from sdk/cloudmachine/Azure.CloudMachine/src/extensions/MemoryVectorbaseStore.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/MemoryVectorbaseStore.cs diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/OpenAIFeature.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs similarity index 86% rename from sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/OpenAIFeature.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs index 8ce12b0bf57a..88ef347e71a1 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/OpenAIFeature.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.Collections.Generic; + +using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.CognitiveServices; using Azure.Provisioning.Primitives; @@ -24,7 +23,7 @@ protected override ProvisionableResource EmitResources(CloudMachineInfrastructur return cognitiveServices; } - protected internal override void EmitConnections(ConnectionCollection connections, string cmId) + protected override void EmitConnections(ConnectionCollection connections, string cmId) { ClientConnection connection = new("Azure.AI.OpenAI.AzureOpenAIClient", $"https://{cmId}.openai.azure.com"); @@ -33,6 +32,8 @@ protected internal override void EmitConnections(ConnectionCollection connection connections.Add(connection); } } + internal void EmitConnectionsInternal(ConnectionCollection connections, string cmId) + => EmitConnections(connections, cmId); internal static CognitiveServicesAccount CreateOpenAIAccount(CloudMachineInfrastructure cm) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/OpenAIModelFeature.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs similarity index 73% rename from sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/OpenAIModelFeature.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs index 6efcbd3b9892..96e774cd70b1 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/OpenAIModelFeature.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs @@ -2,30 +2,50 @@ // Licensed under the MIT License. using System; -using System.Diagnostics; using System.Linq; +using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.CognitiveServices; using Azure.Provisioning.Primitives; namespace Azure.CloudMachine.OpenAI; +/// +/// CloudMachine feature for OpenAI models. +/// public class OpenAIModelFeature : CloudMachineFeature { + /// + /// Create a new OpenAI model feature. + /// + /// + /// + /// public OpenAIModelFeature(string model, string modelVersion, AIModelKind kind = AIModelKind.Chat) { Kind = kind; Model = model; ModelVersion = modelVersion; } + /// + /// The model name. + /// public string Model { get; } + + /// + /// The model version. + /// public string ModelVersion { get; } private AIModelKind Kind { get; } internal OpenAIFeature Account { get; set; } = default!; - protected internal override void EmitFeatures(FeatureCollection features, string cmId) + /// + /// Emit the feature. + /// + /// + /// + protected override void EmitFeatures(FeatureCollection features, string cmId) { // TODO: is it OK that we return the first one? OpenAIFeature? openAI = features.FindAll().FirstOrDefault(); @@ -38,9 +58,15 @@ protected internal override void EmitFeatures(FeatureCollection features, string features.Add(this); } - protected internal override void EmitConnections(ConnectionCollection connections, string cmId) + /// + /// Emit the connections. + /// + /// + /// + /// + protected override void EmitConnections(ConnectionCollection connections, string cmId) { - Account.EmitConnections(connections, cmId); + Account.EmitConnectionsInternal(connections, cmId); // add connections switch (Kind) { @@ -55,6 +81,13 @@ protected internal override void EmitConnections(ConnectionCollection connection } } + /// + /// Emit the resources. + /// + /// + /// + /// + /// protected override ProvisionableResource EmitResources(CloudMachineInfrastructure cm) { if (Account == null) throw new InvalidOperationException("Account must be set before emitting"); @@ -117,8 +150,17 @@ protected override ProvisionableResource EmitResources(CloudMachineInfrastructur } } +/// +/// The kind of OpenAI model. +/// public enum AIModelKind { + /// + /// Chat model. + /// Chat, + /// + /// Embedding model. + /// Embedding, } diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/extensions/VectorbaseStore.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/VectorbaseStore.cs similarity index 100% rename from sdk/cloudmachine/Azure.CloudMachine/src/extensions/VectorbaseStore.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/VectorbaseStore.cs diff --git a/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/Azure.CloudMachine.OpenAI.Tests.csproj b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/Azure.CloudMachine.OpenAI.Tests.csproj new file mode 100644 index 000000000000..138a0ebc1ed2 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/Azure.CloudMachine.OpenAI.Tests.csproj @@ -0,0 +1,16 @@ + + + 12 + + + + + + + + + + + + + diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests_rag.cs b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs similarity index 98% rename from sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests_rag.cs rename to sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs index c4061f87c55f..13a77362ff81 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests_rag.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs @@ -34,7 +34,7 @@ public void RagDemo() "Do you think I would like the weather there?", ]; - CloudMachineClient cm = new(default, new MockConfiguration("cmec4615e3fdfa44e")); + CloudMachineClient cm = new(new MockConfiguration("cmec4615e3fdfa44e"), default); var chat = cm.GetOpenAIChatClient(); var embeddings = cm.GetOpenAIEmbeddingsClient(); diff --git a/sdk/cloudmachine/Azure.CloudMachine.Web/README.md b/sdk/cloudmachine/Azure.CloudMachine.Web/README.md index 920e25a208f0..6b00b17ca078 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.Web/README.md +++ b/sdk/cloudmachine/Azure.CloudMachine.Web/README.md @@ -1,4 +1,4 @@ -# ASP.NET COre extensions for Azure CloudMachine client library for .NET +# ASP.NET Core extensions for Azure CloudMachine client library for .NET TODO diff --git a/sdk/cloudmachine/Azure.CloudMachine.Web/api/Azure.CloudMachine.Web.net8.0.cs b/sdk/cloudmachine/Azure.CloudMachine.Web/api/Azure.CloudMachine.Web.net8.0.cs index 097b70d30b9b..97fe7a285a9b 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.Web/api/Azure.CloudMachine.Web.net8.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.Web/api/Azure.CloudMachine.Web.net8.0.cs @@ -2,6 +2,7 @@ namespace Azure.CloudMachine { public static partial class CloudMachineExtensions { + public static void MapCloudMachineApplication(this Microsoft.AspNetCore.Builder.WebApplication application) where T : class { } public static void Map(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder routeBuilder, T serviceImplementation) where T : class { } public static System.Threading.Tasks.Task UploadFormAsync(this Azure.CloudMachine.StorageServices storage, Microsoft.AspNetCore.Http.HttpRequest multiPartFormData) { throw null; } } diff --git a/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs b/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs index bec28911b0ff..15d2e1837e8b 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine.Web/src/CloudMachineExtensions.cs @@ -7,10 +7,13 @@ using System.Reflection; using System.Threading.Tasks; using Azure.CloudMachine; +using Azure.Core; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; namespace Azure.CloudMachine; @@ -19,6 +22,18 @@ namespace Azure.CloudMachine; /// public static class CloudMachineExtensions { + /// + /// Maps TSP endpoints. CloudMachineClient needs to be in the container for this method to work. + /// + /// + /// + public static void MapCloudMachineApplication(this WebApplication application) where T : class + { + CloudMachineClient cm = application.Services.GetRequiredService(); + T service = (T)Activator.CreateInstance(typeof(T), cm)!; + application.Map(service); + } + /// /// Uploads a document to the storage service. /// diff --git a/sdk/cloudmachine/Azure.CloudMachine.sln b/sdk/cloudmachine/Azure.CloudMachine.sln index c35251a1e5e9..25a4c0070dae 100644 --- a/sdk/cloudmachine/Azure.CloudMachine.sln +++ b/sdk/cloudmachine/Azure.CloudMachine.sln @@ -9,6 +9,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine", "Azure EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.Tests", "Azure.CloudMachine\tests\Azure.CloudMachine.Tests.csproj", "{8C1A29AE-E357-4C40-ACCC-7215FBFB368C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Azure.CloudMachine.OpenAI", "Azure.CloudMachine.OpenAI", "{637A5F7C-2741-4841-9617-A60E28AB54CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.OpenAI", "Azure.CloudMachine.OpenAI\src\Azure.CloudMachine.OpenAI.csproj", "{C743EA41-2CBD-464C-9C5E-141B785804A4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.OpenAI.Tests", "Azure.CloudMachine.OpenAI\tests\Azure.CloudMachine.OpenAI.Tests.csproj", "{27CF03E3-50A8-4E15-B74D-2F4225E6E43F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,9 +32,19 @@ Global {8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C1A29AE-E357-4C40-ACCC-7215FBFB368C}.Release|Any CPU.Build.0 = Release|Any CPU + {C743EA41-2CBD-464C-9C5E-141B785804A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C743EA41-2CBD-464C-9C5E-141B785804A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C743EA41-2CBD-464C-9C5E-141B785804A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C743EA41-2CBD-464C-9C5E-141B785804A4}.Release|Any CPU.Build.0 = Release|Any CPU + {27CF03E3-50A8-4E15-B74D-2F4225E6E43F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27CF03E3-50A8-4E15-B74D-2F4225E6E43F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27CF03E3-50A8-4E15-B74D-2F4225E6E43F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27CF03E3-50A8-4E15-B74D-2F4225E6E43F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {0EA29D2F-41E0-4826-9CD4-111109A2CFF7} = {780138CF-68C6-4323-982F-F18989E2FA86} {8C1A29AE-E357-4C40-ACCC-7215FBFB368C} = {780138CF-68C6-4323-982F-F18989E2FA86} + {C743EA41-2CBD-464C-9C5E-141B785804A4} = {637A5F7C-2741-4841-9617-A60E28AB54CD} + {27CF03E3-50A8-4E15-B74D-2F4225E6E43F} = {637A5F7C-2741-4841-9617-A60E28AB54CD} EndGlobalSection EndGlobal diff --git a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs index 1e6b182bb3f1..28ff9a545065 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.net8.0.cs @@ -1,53 +1,19 @@ -namespace Azure -{ - public partial class RestCallFailedException : System.Exception - { - public RestCallFailedException(string message, System.ClientModel.Primitives.PipelineResponse response) { } - } - public partial class RestClient - { - public RestClient() { } - public RestClient(System.ClientModel.Primitives.PipelinePolicy auth) { } - public static Azure.RestClient Shared { get { throw null; } } - public System.ClientModel.Primitives.PipelineMessage Create(string method, System.Uri uri) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Get(string uri, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Patch(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Post(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Put(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Send(System.ClientModel.Primitives.PipelineMessage message, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - } - public partial class RestClientOptions : System.ClientModel.Primitives.ClientPipelineOptions - { - public RestClientOptions() { } - } -} -namespace Azure.AI.OpenAI -{ - public partial class TokenCredentialAuthenticationPolicy : System.ClientModel.Primitives.PipelinePolicy - { - public TokenCredentialAuthenticationPolicy(Azure.Core.TokenCredential credential, System.Collections.Generic.IEnumerable scopes, System.TimeSpan? refreshOffset = default(System.TimeSpan?)) { } - public override void Process(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { } - public override System.Threading.Tasks.ValueTask ProcessAsync(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { throw null; } - } -} namespace Azure.CloudMachine { - public partial class CloudMachineClient : Azure.CloudMachine.CloudMachineWorkspace - { - protected CloudMachineClient() : base (default(Azure.Core.TokenCredential), default(Microsoft.Extensions.Configuration.IConfiguration), default(System.Collections.Generic.IEnumerable)) { } - public CloudMachineClient(Azure.Core.TokenCredential credential = null, Microsoft.Extensions.Configuration.IConfiguration configuration = null, System.Collections.Generic.IEnumerable connections = null) : base (default(Azure.Core.TokenCredential), default(Microsoft.Extensions.Configuration.IConfiguration), default(System.Collections.Generic.IEnumerable)) { } - public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } - public Azure.CloudMachine.StorageServices Storage { get { throw null; } } - } - public partial class CloudMachineWorkspace : Azure.Core.ClientWorkspace + public partial class CloudMachineClient : Azure.Core.ClientWorkspace { - public CloudMachineWorkspace(Azure.Core.TokenCredential credential = null, Microsoft.Extensions.Configuration.IConfiguration configuration = null, System.Collections.Generic.IEnumerable connections = null) : base (default(Azure.Core.TokenCredential)) { } + protected CloudMachineClient() : base (default(Azure.Core.TokenCredential)) { } + public CloudMachineClient(Microsoft.Extensions.Configuration.IConfiguration configuration, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + public CloudMachineClient(System.Collections.Generic.IEnumerable connections = null, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public Azure.CloudMachine.ConnectionCollection Connections { get { throw null; } } + public Azure.Core.ConnectionCollection Connections { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string Id { get { throw null; } } + public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } + public Azure.CloudMachine.StorageServices Storage { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } + public override System.Collections.Generic.IEnumerable GetAllConnectionOptions() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Core.ClientConnection GetConnectionOptions(string connectionId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -57,11 +23,6 @@ public CloudMachineWorkspace(Azure.Core.TokenCredential credential = null, Micro [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public partial class ConnectionCollection : System.Collections.ObjectModel.KeyedCollection - { - public ConnectionCollection() { } - protected override string GetKeyForItem(Azure.Core.ClientConnection item) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MessagingServices { @@ -117,62 +78,6 @@ public static partial class KeyVaultExtensions public static Azure.Security.KeyVault.Secrets.SecretClient GetKeyVaultSecretsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } } } -namespace Azure.CloudMachine.OpenAI -{ - public static partial class AzureOpenAIExtensions - { - public static void Add(this System.Collections.Generic.List messages, OpenAI.Chat.ChatCompletion completion) { } - public static void Add(this System.Collections.Generic.List messages, System.Collections.Generic.IEnumerable entries) { } - public static string AsText(this OpenAI.Chat.ChatCompletion completion) { throw null; } - public static string AsText(this OpenAI.Chat.ChatMessageContent content) { throw null; } - public static string AsText(this System.ClientModel.ClientResult completionResult) { throw null; } - public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace) { throw null; } - public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } - public static void Trim(this System.Collections.Generic.List messages) { } - } - public partial class ChatTools - { - public ChatTools(params System.Type[] tools) { } - public System.Collections.Generic.IList Definitions { get { throw null; } } - public void Add(System.Reflection.MethodInfo function) { } - public void Add(System.Type functions) { } - public string Call(OpenAI.Chat.ChatToolCall call) { throw null; } - public string Call(string name, object[] arguments) { throw null; } - public System.Collections.Generic.IEnumerable CallAll(System.Collections.Generic.IEnumerable toolCalls) { throw null; } - public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.CloudMachine.OpenAI.ChatTools tools) { throw null; } - } - public partial class EmbeddingsVectorbase - { - public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.CloudMachine.OpenAI.VectorbaseStore store = null, int factChunkSize = 1000) { } - public void Add(System.BinaryData data) { } - public void Add(string text) { } - public System.Collections.Generic.IEnumerable Find(string text, Azure.CloudMachine.OpenAI.FindOptions options = null) { throw null; } - } - public partial class FindOptions - { - public FindOptions() { } - public int MaxEntries { get { throw null; } set { } } - public float Threshold { get { throw null; } set { } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct VectorbaseEntry - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public VectorbaseEntry(System.ReadOnlyMemory vector, System.BinaryData data, int? id = default(int?)) { throw null; } - public System.BinaryData Data { get { throw null; } } - public int? Id { get { throw null; } } - public System.ReadOnlyMemory Vector { get { throw null; } } - } - public abstract partial class VectorbaseStore - { - protected VectorbaseStore() { } - public abstract int Add(Azure.CloudMachine.OpenAI.VectorbaseEntry entry); - public abstract void Add(System.Collections.Generic.IReadOnlyList entry); - public static float CosineSimilarity(System.ReadOnlySpan x, System.ReadOnlySpan y) { throw null; } - public abstract System.Collections.Generic.IEnumerable Find(System.ReadOnlyMemory vector, Azure.CloudMachine.OpenAI.FindOptions options); - } -} namespace Azure.Core { public enum ClientAuthenticationMethod @@ -209,6 +114,40 @@ protected ClientWorkspace(Azure.Core.TokenCredential credential) { } public Azure.Core.TokenCredential Credential { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ClientCache Subclients { get { throw null; } } + public abstract System.Collections.Generic.IEnumerable GetAllConnectionOptions(); public abstract Azure.Core.ClientConnection GetConnectionOptions(string connectionId); } + public static partial class CloudMachineClientConfiguration + { + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConnections(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.Core.ConnectionCollection connections) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineId(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string id) { throw null; } + } + public partial class ConnectionCollection : System.Collections.ObjectModel.KeyedCollection + { + public ConnectionCollection() { } + protected override string GetKeyForItem(Azure.Core.ClientConnection item) { throw null; } + } +} +namespace Azure.Core.Rest +{ + public partial class RestCallFailedException : System.Exception + { + public RestCallFailedException(string message, System.ClientModel.Primitives.PipelineResponse response) { } + } + public partial class RestClient + { + public RestClient() { } + public RestClient(System.ClientModel.Primitives.PipelinePolicy auth) { } + public static Azure.Core.Rest.RestClient Shared { get { throw null; } } + public System.ClientModel.Primitives.PipelineMessage Create(string method, System.Uri uri) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Get(string uri, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Patch(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Post(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Put(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Send(System.ClientModel.Primitives.PipelineMessage message, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + } + public partial class RestClientOptions : System.ClientModel.Primitives.ClientPipelineOptions + { + public RestClientOptions() { } + } } diff --git a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs index 1e6b182bb3f1..28ff9a545065 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/api/Azure.CloudMachine.netstandard2.0.cs @@ -1,53 +1,19 @@ -namespace Azure -{ - public partial class RestCallFailedException : System.Exception - { - public RestCallFailedException(string message, System.ClientModel.Primitives.PipelineResponse response) { } - } - public partial class RestClient - { - public RestClient() { } - public RestClient(System.ClientModel.Primitives.PipelinePolicy auth) { } - public static Azure.RestClient Shared { get { throw null; } } - public System.ClientModel.Primitives.PipelineMessage Create(string method, System.Uri uri) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Get(string uri, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Patch(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Post(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Put(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - public System.ClientModel.Primitives.PipelineResponse Send(System.ClientModel.Primitives.PipelineMessage message, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } - } - public partial class RestClientOptions : System.ClientModel.Primitives.ClientPipelineOptions - { - public RestClientOptions() { } - } -} -namespace Azure.AI.OpenAI -{ - public partial class TokenCredentialAuthenticationPolicy : System.ClientModel.Primitives.PipelinePolicy - { - public TokenCredentialAuthenticationPolicy(Azure.Core.TokenCredential credential, System.Collections.Generic.IEnumerable scopes, System.TimeSpan? refreshOffset = default(System.TimeSpan?)) { } - public override void Process(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { } - public override System.Threading.Tasks.ValueTask ProcessAsync(System.ClientModel.Primitives.PipelineMessage message, System.Collections.Generic.IReadOnlyList pipeline, int currentIndex) { throw null; } - } -} namespace Azure.CloudMachine { - public partial class CloudMachineClient : Azure.CloudMachine.CloudMachineWorkspace - { - protected CloudMachineClient() : base (default(Azure.Core.TokenCredential), default(Microsoft.Extensions.Configuration.IConfiguration), default(System.Collections.Generic.IEnumerable)) { } - public CloudMachineClient(Azure.Core.TokenCredential credential = null, Microsoft.Extensions.Configuration.IConfiguration configuration = null, System.Collections.Generic.IEnumerable connections = null) : base (default(Azure.Core.TokenCredential), default(Microsoft.Extensions.Configuration.IConfiguration), default(System.Collections.Generic.IEnumerable)) { } - public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } - public Azure.CloudMachine.StorageServices Storage { get { throw null; } } - } - public partial class CloudMachineWorkspace : Azure.Core.ClientWorkspace + public partial class CloudMachineClient : Azure.Core.ClientWorkspace { - public CloudMachineWorkspace(Azure.Core.TokenCredential credential = null, Microsoft.Extensions.Configuration.IConfiguration configuration = null, System.Collections.Generic.IEnumerable connections = null) : base (default(Azure.Core.TokenCredential)) { } + protected CloudMachineClient() : base (default(Azure.Core.TokenCredential)) { } + public CloudMachineClient(Microsoft.Extensions.Configuration.IConfiguration configuration, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } + public CloudMachineClient(System.Collections.Generic.IEnumerable connections = null, Azure.Core.TokenCredential credential = null) : base (default(Azure.Core.TokenCredential)) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public Azure.CloudMachine.ConnectionCollection Connections { get { throw null; } } + public Azure.Core.ConnectionCollection Connections { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string Id { get { throw null; } } + public Azure.CloudMachine.MessagingServices Messaging { get { throw null; } } + public Azure.CloudMachine.StorageServices Storage { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } + public override System.Collections.Generic.IEnumerable GetAllConnectionOptions() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override Azure.Core.ClientConnection GetConnectionOptions(string connectionId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -57,11 +23,6 @@ public CloudMachineWorkspace(Azure.Core.TokenCredential credential = null, Micro [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public partial class ConnectionCollection : System.Collections.ObjectModel.KeyedCollection - { - public ConnectionCollection() { } - protected override string GetKeyForItem(Azure.Core.ClientConnection item) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MessagingServices { @@ -117,62 +78,6 @@ public static partial class KeyVaultExtensions public static Azure.Security.KeyVault.Secrets.SecretClient GetKeyVaultSecretsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } } } -namespace Azure.CloudMachine.OpenAI -{ - public static partial class AzureOpenAIExtensions - { - public static void Add(this System.Collections.Generic.List messages, OpenAI.Chat.ChatCompletion completion) { } - public static void Add(this System.Collections.Generic.List messages, System.Collections.Generic.IEnumerable entries) { } - public static string AsText(this OpenAI.Chat.ChatCompletion completion) { throw null; } - public static string AsText(this OpenAI.Chat.ChatMessageContent content) { throw null; } - public static string AsText(this System.ClientModel.ClientResult completionResult) { throw null; } - public static OpenAI.Chat.ChatClient GetOpenAIChatClient(this Azure.Core.ClientWorkspace workspace) { throw null; } - public static OpenAI.Embeddings.EmbeddingClient GetOpenAIEmbeddingsClient(this Azure.Core.ClientWorkspace workspace) { throw null; } - public static void Trim(this System.Collections.Generic.List messages) { } - } - public partial class ChatTools - { - public ChatTools(params System.Type[] tools) { } - public System.Collections.Generic.IList Definitions { get { throw null; } } - public void Add(System.Reflection.MethodInfo function) { } - public void Add(System.Type functions) { } - public string Call(OpenAI.Chat.ChatToolCall call) { throw null; } - public string Call(string name, object[] arguments) { throw null; } - public System.Collections.Generic.IEnumerable CallAll(System.Collections.Generic.IEnumerable toolCalls) { throw null; } - public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.CloudMachine.OpenAI.ChatTools tools) { throw null; } - } - public partial class EmbeddingsVectorbase - { - public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.CloudMachine.OpenAI.VectorbaseStore store = null, int factChunkSize = 1000) { } - public void Add(System.BinaryData data) { } - public void Add(string text) { } - public System.Collections.Generic.IEnumerable Find(string text, Azure.CloudMachine.OpenAI.FindOptions options = null) { throw null; } - } - public partial class FindOptions - { - public FindOptions() { } - public int MaxEntries { get { throw null; } set { } } - public float Threshold { get { throw null; } set { } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct VectorbaseEntry - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public VectorbaseEntry(System.ReadOnlyMemory vector, System.BinaryData data, int? id = default(int?)) { throw null; } - public System.BinaryData Data { get { throw null; } } - public int? Id { get { throw null; } } - public System.ReadOnlyMemory Vector { get { throw null; } } - } - public abstract partial class VectorbaseStore - { - protected VectorbaseStore() { } - public abstract int Add(Azure.CloudMachine.OpenAI.VectorbaseEntry entry); - public abstract void Add(System.Collections.Generic.IReadOnlyList entry); - public static float CosineSimilarity(System.ReadOnlySpan x, System.ReadOnlySpan y) { throw null; } - public abstract System.Collections.Generic.IEnumerable Find(System.ReadOnlyMemory vector, Azure.CloudMachine.OpenAI.FindOptions options); - } -} namespace Azure.Core { public enum ClientAuthenticationMethod @@ -209,6 +114,40 @@ protected ClientWorkspace(Azure.Core.TokenCredential credential) { } public Azure.Core.TokenCredential Credential { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ClientCache Subclients { get { throw null; } } + public abstract System.Collections.Generic.IEnumerable GetAllConnectionOptions(); public abstract Azure.Core.ClientConnection GetConnectionOptions(string connectionId); } + public static partial class CloudMachineClientConfiguration + { + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConnections(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.Core.ConnectionCollection connections) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineId(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string id) { throw null; } + } + public partial class ConnectionCollection : System.Collections.ObjectModel.KeyedCollection + { + public ConnectionCollection() { } + protected override string GetKeyForItem(Azure.Core.ClientConnection item) { throw null; } + } +} +namespace Azure.Core.Rest +{ + public partial class RestCallFailedException : System.Exception + { + public RestCallFailedException(string message, System.ClientModel.Primitives.PipelineResponse response) { } + } + public partial class RestClient + { + public RestClient() { } + public RestClient(System.ClientModel.Primitives.PipelinePolicy auth) { } + public static Azure.Core.Rest.RestClient Shared { get { throw null; } } + public System.ClientModel.Primitives.PipelineMessage Create(string method, System.Uri uri) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Get(string uri, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Patch(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Post(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Put(string uri, System.ClientModel.BinaryContent content, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + public System.ClientModel.Primitives.PipelineResponse Send(System.ClientModel.Primitives.PipelineMessage message, System.ClientModel.Primitives.RequestOptions options = null) { throw null; } + } + public partial class RestClientOptions : System.ClientModel.Primitives.ClientPipelineOptions + { + public RestClientOptions() { } + } } diff --git a/sdk/cloudmachine/Azure.CloudMachine/samples/README.md b/sdk/cloudmachine/Azure.CloudMachine/samples/README.md index e6bbe8bac48e..a781e6e64e78 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/samples/README.md +++ b/sdk/cloudmachine/Azure.CloudMachine/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.CloudMachine samples for .NET description: Samples for the Azure.CloudMachine client library. diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/AppConfigHelpers.cs b/sdk/cloudmachine/Azure.CloudMachine/src/AppConfigHelpers.cs index fa4be22d4f3e..57cc4f8ab1f0 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/AppConfigHelpers.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/AppConfigHelpers.cs @@ -33,7 +33,12 @@ internal static string ReadOrCreateCloudMachineId() } using FileStream json = new FileStream(appsettings, FileMode.Open, FileAccess.Read, FileShare.Read); - using JsonDocument jd = JsonDocument.Parse(json); + JsonDocumentOptions jsonDocumentOptions = new() + { + AllowTrailingCommas = true, + CommentHandling = JsonCommentHandling.Skip, + }; + using JsonDocument jd = JsonDocument.Parse(json, jsonDocumentOptions); JsonElement je = jd.RootElement; // attempt to read CM configuration from existing configuration file if (je.TryGetProperty("CloudMachine"u8, out JsonElement cm)) diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj b/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj index 5b22c0e7c7fd..5930a01f54ae 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine/src/Azure.CloudMachine.csproj @@ -13,14 +13,12 @@ - - - + diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/ClientWorkspace.cs b/sdk/cloudmachine/Azure.CloudMachine/src/ClientWorkspace.cs index 879e4099206c..0e11d59cda73 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/ClientWorkspace.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/ClientWorkspace.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Collections.Generic; using System.ComponentModel; namespace Azure.Core; @@ -27,6 +28,12 @@ protected ClientWorkspace(TokenCredential credential) /// The connection options for the specified client type and instance ID. public abstract ClientConnection GetConnectionOptions(string connectionId); + /// + /// Retrieves all connection options. + /// + /// + public abstract IEnumerable GetAllConnectionOptions(); + /// /// Gets the token credential. /// diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClient.cs b/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClient.cs index 2d3194788992..c5b477324eee 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClient.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClient.cs @@ -1,8 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; +using System.ComponentModel; using Azure.Core; +using Azure.Identity; using Microsoft.Extensions.Configuration; namespace Azure.CloudMachine; @@ -10,27 +13,79 @@ namespace Azure.CloudMachine; /// /// The cloud machine client. /// -public partial class CloudMachineClient : CloudMachineWorkspace +public partial class CloudMachineClient : ClientWorkspace { + /// + /// The cloud machine ID. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Id { get; } + + /// + /// subclient connections. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ConnectionCollection Connections { get; } = []; + /// /// Initializes a new instance of the class for mocking purposes.. /// - protected CloudMachineClient() + protected CloudMachineClient() : + this(credential: BuildCredential(default)) { + Id = AppConfigHelpers.ReadOrCreateCloudMachineId(); Messaging = new MessagingServices(this); Storage = new StorageServices(this); } + #pragma warning disable AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. /// /// Initializes a new instance of the class. /// - /// The token credential. /// The configuration settings. + /// The token credential. + public CloudMachineClient(IConfiguration configuration, TokenCredential credential = default) +#pragma warning restore AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + : base(BuildCredential(credential)) + { + Id = configuration["CloudMachine:ID"]; + if (Id == null) + { + Id = AppConfigHelpers.ReadOrCreateCloudMachineId(); + } + + IConfigurationSection connectionsSection = configuration.GetSection("CloudMachine:Connections"); + + foreach (IConfigurationSection connection in connectionsSection.GetChildren()) + { + string id = connection["Id"]; + if (id == null) continue; + string locator = connection["Locator"]; + + Connections.Add(new ClientConnection(id, locator, ClientAuthenticationMethod.EntraId)); + } + + Messaging = new MessagingServices(this); + Storage = new StorageServices(this); + } + +#pragma warning disable AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. + /// + /// Initializes a new instance of the class. + /// /// - public CloudMachineClient(TokenCredential credential = default, IConfiguration configuration = default, IEnumerable connections = default) + /// The token credential. + // TODO: we need to combine the configuration and the connections into a single parameter. + public CloudMachineClient(IEnumerable connections = default, TokenCredential credential = default) #pragma warning restore AZC0007 // DO provide a minimal constructor that takes only the parameters required to connect to the service. - : base(credential, configuration, connections) + : base(BuildCredential(credential)) { + if (connections != default) + { + Connections.AddRange(connections); + } + + Id = AppConfigHelpers.ReadOrCreateCloudMachineId(); Messaging = new MessagingServices(this); Storage = new StorageServices(this); } @@ -44,4 +99,57 @@ public CloudMachineClient(TokenCredential credential = default, IConfiguration c /// Gets the storage services. /// public StorageServices Storage { get; } + + /// + /// Retrieves the connection options for a specified client type and instance ID. + /// + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override ClientConnection GetConnectionOptions(string connectionId) + { + return Connections[connectionId]; + } + + private static TokenCredential BuildCredential(TokenCredential credential) + { + if (credential == default) + { + // This environment variable is set by the CloudMachine App Service feature during provisioning. + credential = Environment.GetEnvironmentVariable("CLOUDMACHINE_MANAGED_IDENTITY_CLIENT_ID") switch + { + string clientId when !string.IsNullOrEmpty(clientId) => new ManagedIdentityCredential(clientId), + _ => new ChainedTokenCredential(new AzureCliCredential(), new AzureDeveloperCliCredential()) + }; + } + + return credential; + } + + /// + /// Reads or creates the cloud machine ID. + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static string ReadOrCreateCloudMachineId() => AppConfigHelpers.ReadOrCreateCloudMachineId(); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => base.Equals(obj); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ToString() => Id; + + /// + /// Retrieves all connection options. + /// + /// + public override IEnumerable GetAllConnectionOptions() + => Connections; } diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClientConfiguration.cs b/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClientConfiguration.cs new file mode 100644 index 000000000000..7055da3b6170 --- /dev/null +++ b/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineClientConfiguration.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Primitives; +using System.Linq; + +namespace Azure.Core; + +/// +/// extensions. +/// +public static class CloudMachineClientConfiguration +{ + /// + /// Adds a connection to the collection. + /// + /// + /// + /// + public static IConfigurationBuilder AddCloudMachineConnections(this IConfigurationBuilder builder, ConnectionCollection connections) + { + var source = new ConnectionCollectionConfigurationSource(connections); + builder.Add(source); + return builder; + } + /// + /// Adds a connection to the collection. + /// + /// + /// + /// + public static IConfigurationBuilder AddCloudMachineId(this IConfigurationBuilder builder, string id) + { + var source = new CmidConfigurationSource(id); + builder.Add(source); + return builder; + } +} + +internal class ConnectionCollectionConfigurationProvider : IConfigurationProvider +{ + private readonly ConnectionCollection _connections; + public ConnectionCollectionConfigurationProvider(ConnectionCollection connections) + => _connections = connections; + + public IEnumerable GetChildKeys(IEnumerable earlierKeys, string parentPath) + { + foreach (string earlierKey in earlierKeys) + { + yield return earlierKey; + } + foreach (ClientConnection connection in _connections) + { + yield return connection.Id; + } + } + + public IChangeToken GetReloadToken() => null; + public void Load() { } + public void Set(string key, string value) => throw new NotImplementedException(); + public bool TryGet(string key, out string value) + { + string[] path = key.Split(':'); + + if (path.Length != 4 || + !path[0].Equals("CloudMachine", StringComparison.InvariantCultureIgnoreCase) || + !path[1].Equals("Connections", StringComparison.InvariantCultureIgnoreCase)) + { + value = null; + return false; + } + + if (!_connections.Contains(path[2])) + { + value = null; + return false; + } + + string id = path[2]; + ClientConnection connection = _connections[id]; + var property = path[3].ToLowerInvariant(); + + switch (property) + { + case "id": + value = connection.Id; + return true; + case "locator": + value = connection.Locator; + return true; + case "authentication": + value = connection.Authentication.ToString(); + return true; + default: + value = null; + return false; + } + } +} +internal class ConnectionCollectionConfigurationSource : IConfigurationSource +{ + private readonly ConnectionCollection _connections; + public ConnectionCollectionConfigurationSource(ConnectionCollection connections) + => _connections = connections; + + public IConfigurationProvider Build(IConfigurationBuilder builder) + => new ConnectionCollectionConfigurationProvider(_connections); +} + +internal class CmidConfigurationProvider(string cmid) : IConfigurationProvider +{ + public IEnumerable GetChildKeys(IEnumerable earlierKeys, string parentPath) + { + if (parentPath.Equals("CloudMachine", StringComparison.InvariantCultureIgnoreCase)) + return earlierKeys.Append("ID"); // todo: should this check if ID is not already in earlier keys + else + return earlierKeys; + } + + public IChangeToken GetReloadToken() => null; + public void Load() {} + public void Set(string key, string value) + => new NotSupportedException(); + + public bool TryGet(string key, out string value) + { + if (!key.Equals("CloudMachine:ID", StringComparison.InvariantCultureIgnoreCase)) + { + value = null; + return false; + } + value = cmid; + return true; + } +} +internal class CmidConfigurationSource(string cmid) : IConfigurationSource +{ + public IConfigurationProvider Build(IConfigurationBuilder builder) + => new CmidConfigurationProvider(cmid); +} diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineWorkspace.cs b/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineWorkspace.cs deleted file mode 100644 index 500365b346fc..000000000000 --- a/sdk/cloudmachine/Azure.CloudMachine/src/CloudMachineWorkspace.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Text.Json; -using System.Text.Json.Nodes; -using Azure.Core; -using Azure.Identity; -using Azure.Messaging.EventGrid.SystemEvents; -using Microsoft.Extensions.Configuration; - -namespace Azure.CloudMachine; - -/// -/// The cloud machine workspace. -/// -public class CloudMachineWorkspace : ClientWorkspace -{ - /// - /// subclient connections. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public ConnectionCollection Connections { get; } = []; - - /// - /// The cloud machine ID. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public string Id { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - [SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "")] - public CloudMachineWorkspace(TokenCredential credential = default, IConfiguration configuration = default, IEnumerable connections = default) - : base(BuildCredentail(credential)) - { - if (connections != default) - { - Connections.AddRange(connections); - } - - Id = configuration switch - { - null => AppConfigHelpers.ReadOrCreateCloudMachineId(), - _ => configuration["CloudMachine:ID"] ?? throw new Exception("CloudMachine:ID configuration value missing") - }; - } - - private static TokenCredential BuildCredentail(TokenCredential credential) - { - if (credential == default) - { - // This environment variable is set by the CloudMachine App Service feature during provisioning. - credential = Environment.GetEnvironmentVariable("CLOUDMACHINE_MANAGED_IDENTITY_CLIENT_ID") switch - { - string clientId when !string.IsNullOrEmpty(clientId) => new ManagedIdentityCredential(clientId), - _ => new ChainedTokenCredential(new AzureCliCredential(), new AzureDeveloperCliCredential()) - }; - } - - return credential; - } - - /// - /// Retrieves the connection options for a specified client type and instance ID. - /// - /// - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override ClientConnection GetConnectionOptions(string connectionId) - { - return Connections[connectionId]; - } - - /// - /// Reads or creates the cloud machine ID. - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static string ReadOrCreateCloudMachineId() => AppConfigHelpers.ReadOrCreateCloudMachineId(); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => base.Equals(obj); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => base.GetHashCode(); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override string ToString() => Id; -} diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/ConnectionCollection.cs b/sdk/cloudmachine/Azure.CloudMachine/src/ConnectionCollection.cs index 1a5087da74e3..3bdac3b4749e 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/ConnectionCollection.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/ConnectionCollection.cs @@ -4,16 +4,17 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; using System.Text.Json; using System.Text.Json.Serialization; -using Azure.Core; -namespace Azure.CloudMachine; +namespace Azure.Core; /// /// Represents the connection options for a client. /// [JsonConverter(typeof(ConnectionCollectionConverter))] +[DebuggerTypeProxy(typeof(ConnectionCollectionViewer))] public class ConnectionCollection : KeyedCollection { /// @@ -30,6 +31,20 @@ internal void AddRange(IEnumerable connections) } } +internal class ConnectionCollectionViewer(ConnectionCollection connections) +{ + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public ClientConnection[] Items + { + get + { + ClientConnection[] items = new ClientConnection[connections.Count]; + connections.CopyTo(items, 0); + return items; + } + } +} + internal class ConnectionCollectionConverter : JsonConverter { public override ConnectionCollection Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestCallFailedException.cs b/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestCallFailedException.cs index 22d7a0c98243..91ebad31292f 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestCallFailedException.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestCallFailedException.cs @@ -4,7 +4,7 @@ using System; using System.ClientModel.Primitives; -namespace Azure +namespace Azure.Core.Rest { /// /// Exception thrown when a REST call fails. diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClient.cs b/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClient.cs index 648044c38381..6ecbb64c72ca 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClient.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClient.cs @@ -5,7 +5,7 @@ using System.ClientModel.Primitives; using System.ClientModel; -namespace Azure +namespace Azure.Core.Rest { /// /// A simple REST client that sends HTTP requests and receives responses. diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClientOptions.cs b/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClientOptions.cs index daa6df9758e4..d44bb2dea92f 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClientOptions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/RestClientOptions.cs @@ -3,7 +3,7 @@ using System.ClientModel.Primitives; -namespace Azure +namespace Azure.Core.Rest { /// /// Options for the REST client. diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs b/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs index 57ea0ca07712..8bb710807d48 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/src/GlobalSuppressions.cs @@ -2,6 +2,5 @@ // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.RestClient.#ctor")] -[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.RestClient.#ctor(System.ClientModel.Primitives.PipelinePolicy)")] +[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.Core.Rest.RestClient.#ctor")] +[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.Core.Rest.RestClient.#ctor(System.ClientModel.Primitives.PipelinePolicy)")] diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj b/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj index 72514fb231b7..62bbcd8d0e93 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/Azure.CloudMachine.Tests.csproj @@ -3,6 +3,7 @@ 12 + diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests.cs b/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests.cs index 9546906bc19a..daaff10f5e00 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/CloudMachineTests.cs @@ -6,7 +6,6 @@ using System; using System.Threading; using Azure.Security.KeyVault.Secrets; -using Azure.CloudMachine.OpenAI; using Azure.CloudMachine.KeyVault; using NUnit.Framework; using OpenAI.Chat; diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs b/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs index 33e28a6dbde7..1978f8c574eb 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs +++ b/sdk/cloudmachine/Azure.CloudMachine/tests/ConnectionTests.cs @@ -6,11 +6,10 @@ using System; using System.Linq; using System.Text.Json; -using Azure.CloudMachine.KeyVault; -using Azure.CloudMachine.OpenAI; +using Azure.Core; using Azure.Storage.Blobs; +using Microsoft.Extensions.Configuration; using NUnit.Framework; -using OpenAI.Chat; [assembly: NonParallelizable] @@ -23,7 +22,6 @@ public class ConnectionTests public void TwoClients(string[] args) { CloudMachineInfrastructure infra = new(); - infra.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); if (args.Contains("-azd")) Azd.Init(infra); CloudMachineClient client = infra.GetClient(); @@ -38,13 +36,12 @@ public void TwoApps() { // app 1 (with a dependency on the CDK) CloudMachineInfrastructure infra = new(); - infra.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); //if (args.Contains("-azd")) Azd.Init(infra); BinaryData serializedConnections = BinaryData.FromObjectAsJson(infra.Connections); // app 2 (no dependency on the CDK) ConnectionCollection deserializedConnections = JsonSerializer.Deserialize(serializedConnections)!; - CloudMachineClient client = new(connections: deserializedConnections); + CloudMachineClient client = new(deserializedConnections); ValidateClient(client); } @@ -55,30 +52,51 @@ public void TwoApps() public void SingleClientAdd(string[] args) { CloudMachineClient client = new(); - client.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); if (args.Contains("-azd")) Azd.Init(client); + } + + [Test] + public void ConfigurationDemo() + { + CloudMachineInfrastructure infra = new(); + + IConfiguration configuration = new ConfigurationBuilder() + .AddCloudMachineConfiguration(infra) + .Build(); - ChatClient chat = client.GetOpenAIChatClient(); + CloudMachineClient client = new(configuration); } [Test] - public void SingleClientConfigure() + public void ConfigurationLowLevel() { - CloudMachineClient client = new(); - client.Configure((infrastructure) => - { - infrastructure.AddFeature(new KeyVaultFeature()); - infrastructure.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); - infrastructure.AddFeature(new OpenAIModelFeature("text-embedding-ada-002", "2", AIModelKind.Embedding)); - }); - ValidateClient(client); - var embeddings = client.GetOpenAIEmbeddingsClient(); + ConnectionCollection connections = new(); + connections.Add(new ClientConnection( + id: "Azure.AI.OpenAI.AzureOpenAIClient", + locator: "https://cm2c54b6e4637f4b1.openai.azure.com", + auth: ClientAuthenticationMethod.EntraId)); + + IConfiguration configuration = new ConfigurationBuilder() + .AddCloudMachineConnections(connections) + .AddCloudMachineId("aaaa-bbbb-cccc-dddd") + .Build(); + + var locator = configuration["CloudMachine:Connections:Azure.AI.OpenAI.AzureOpenAIClient:Locator"]; + Assert.AreEqual("https://cm2c54b6e4637f4b1.openai.azure.com", locator); + var id = configuration["CloudMachine:Id"]; + Assert.AreEqual("aaaa-bbbb-cccc-dddd", id); + + CloudMachineClient client = new(configuration); + Assert.AreEqual("aaaa-bbbb-cccc-dddd", client.Id); + + ClientConnection connection = client.Connections["Azure.AI.OpenAI.AzureOpenAIClient"]; + Assert.AreEqual("https://cm2c54b6e4637f4b1.openai.azure.com", connection.Locator); + Assert.AreEqual("aaaa-bbbb-cccc-dddd", client.Id); } private static void ValidateClient(CloudMachineClient client) { - ChatClient chat = client.GetOpenAIChatClient(); StorageServices storage = client.Storage; BlobContainerClient container = storage.GetContainer(default); MessagingServices messaging = client.Messaging; diff --git a/sdk/cloudmachine/Azure.CloudMachine/tests/GettingStarted.cs b/sdk/cloudmachine/Azure.CloudMachine/tests/GettingStarted.cs deleted file mode 100644 index ee097e04ba37..000000000000 --- a/sdk/cloudmachine/Azure.CloudMachine/tests/GettingStarted.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using Azure.CloudMachine.OpenAI; -using NUnit.Framework; -using System.Linq; -using OpenAI.Chat; - -namespace Azure.CloudMachine.Tests; - -public partial class CloudMachineTests -{ - [Test] - [TestCase([new string[] { "-azd" }])] - public void GettingStarted(string[] args) - { - CloudMachineInfrastructure infra = new(); - infra.AddFeature(new OpenAIModelFeature("gpt-35-turbo", "0125")); - - if (args.Contains("-azd")) { - Azd.Init(infra); - return; - } - - // TODO: we need to allow newing up the client. - CloudMachineClient client = infra.GetClient(); - - ChatClient chat = client.GetOpenAIChatClient(); - string completion = chat.CompleteChat("List all noble gases.").AsText(); - Console.WriteLine(completion); - } -} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln index 0cc453bfe0e2..15096878d369 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/Azure.CloudMachine.sln @@ -15,6 +15,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.Web", ". EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.All", "..\Azure.CloudMachine.All\src\Azure.CloudMachine.All.csproj", "{4E651FF9-EF43-4302-B77B-83C08D8FD117}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.OpenAI", "..\Azure.CloudMachine.OpenAI\src\Azure.CloudMachine.OpenAI.csproj", "{B2666D15-E689-4A9B-A33F-622319D5BA82}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.CloudMachine.OpenAI.Tests", "..\Azure.CloudMachine.OpenAI\tests\Azure.CloudMachine.OpenAI.Tests.csproj", "{6B820761-3C6B-4477-824D-173BC40BE562}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +49,14 @@ Global {4E651FF9-EF43-4302-B77B-83C08D8FD117}.Debug|Any CPU.Build.0 = Debug|Any CPU {4E651FF9-EF43-4302-B77B-83C08D8FD117}.Release|Any CPU.ActiveCfg = Release|Any CPU {4E651FF9-EF43-4302-B77B-83C08D8FD117}.Release|Any CPU.Build.0 = Release|Any CPU + {B2666D15-E689-4A9B-A33F-622319D5BA82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2666D15-E689-4A9B-A33F-622319D5BA82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2666D15-E689-4A9B-A33F-622319D5BA82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2666D15-E689-4A9B-A33F-622319D5BA82}.Release|Any CPU.Build.0 = Release|Any CPU + {6B820761-3C6B-4477-824D-173BC40BE562}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B820761-3C6B-4477-824D-173BC40BE562}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B820761-3C6B-4477-824D-173BC40BE562}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B820761-3C6B-4477-824D-173BC40BE562}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs index a526056e2055..af7b00e5592f 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.net8.0.cs @@ -4,31 +4,31 @@ public static partial class Azd { public static void Init(Azure.CloudMachine.CloudMachineClient client, string? infraDirectory = null) { } public static void Init(Azure.CloudMachine.CloudMachineInfrastructure infra, string? infraDirectory = null) { } + public static void InitDeployment(Azure.CloudMachine.CloudMachineInfrastructure infra, string? webProjectName) { } } public static partial class CloudMachineClientExtensions { - public static T AddFeature(this Azure.CloudMachine.CloudMachineClient client, T feature) where T : Azure.Provisioning.CloudMachine.CloudMachineFeature { throw null; } - public static void Configure(this Azure.CloudMachine.CloudMachineClient client, System.Action? configure = null) { } + public static T AddFeature(this Azure.CloudMachine.CloudMachineClient client, T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.CloudMachine.CloudMachineInfrastructure GetInfrastructure(this Azure.CloudMachine.CloudMachineClient client) { throw null; } } public static partial class CloudMachineCommands { - public static bool Execute(string[] args, System.Action? configure = null, bool exitProcessIfHandled = true) { throw null; } + public static bool TryExecuteCommand(this Azure.CloudMachine.CloudMachineInfrastructure cmi, string[] args) { throw null; } } public partial class CloudMachineInfrastructure { public CloudMachineInfrastructure(string? cmId = null) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public Azure.CloudMachine.ConnectionCollection Connections { get { throw null; } } - public Azure.CloudMachine.FeatureCollection Features { get { throw null; } } + public Azure.Core.ConnectionCollection Connections { get { throw null; } } + public Azure.CloudMachine.Core.FeatureCollection Features { get { throw null; } } public string Id { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Provisioning.Roles.UserAssignedIdentity Identity { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Provisioning.ProvisioningParameter PrincipalIdParameter { get { throw null; } } public void AddEndpoints() { } - public T AddFeature(T feature) where T : Azure.Provisioning.CloudMachine.CloudMachineFeature { throw null; } + public T AddFeature(T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public void AddResource(Azure.Provisioning.Primitives.NamedProvisionableConstruct resource) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -41,70 +41,22 @@ public void AddResource(Azure.Provisioning.Primitives.NamedProvisionableConstruc [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public partial class FeatureCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public static partial class CloudMachineInfrastructureConfiguration { - internal FeatureCollection() { } - public System.Collections.Generic.IEnumerable FindAll() where T : Azure.Provisioning.CloudMachine.CloudMachineFeature { throw null; } - public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class ServiceBusNamespaceFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public ServiceBusNamespaceFeature(string name, Azure.Provisioning.ServiceBus.ServiceBusSkuName sku = Azure.Provisioning.ServiceBus.ServiceBusSkuName.Standard, Azure.Provisioning.ServiceBus.ServiceBusSkuTier tier = Azure.Provisioning.ServiceBus.ServiceBusSkuTier.Standard) { } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } - } - public partial class ServiceBusSubscriptionFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public ServiceBusSubscriptionFeature(string name, Azure.CloudMachine.ServiceBusTopicFeature parent) { } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } - } - public partial class ServiceBusTopicFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public ServiceBusTopicFeature(string name, Azure.CloudMachine.ServiceBusNamespaceFeature parent) { } - public string Name { get { throw null; } } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddCloudMachine(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConfiguration(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } } } namespace Azure.CloudMachine.AppService { - public partial class AppServiceFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature + public partial class AppServiceFeature : Azure.CloudMachine.Core.CloudMachineFeature { public AppServiceFeature() { } public Azure.Provisioning.AppService.AppServiceSkuDescription Sku { get { throw null; } set { } } protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } } } -namespace Azure.CloudMachine.KeyVault -{ - public partial class KeyVaultFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public KeyVaultFeature(Azure.Provisioning.KeyVault.KeyVaultSku? sku = null) { } - public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } - } -} -namespace Azure.CloudMachine.OpenAI -{ - public enum AIModelKind - { - Chat = 0, - Embedding = 1, - } - public partial class OpenAIModelFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine.OpenAI.AIModelKind kind = Azure.CloudMachine.OpenAI.AIModelKind.Chat) { } - public string Model { get { throw null; } } - public string ModelVersion { get { throw null; } } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected internal override void EmitFeatures(Azure.CloudMachine.FeatureCollection features, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } - } -} -namespace Azure.Provisioning.CloudMachine +namespace Azure.CloudMachine.Core { public abstract partial class CloudMachineFeature { @@ -112,10 +64,10 @@ protected CloudMachineFeature() { } protected internal System.Collections.Generic.Dictionary RequiredSystemRoles { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Provisioning.Primitives.ProvisionableResource Resource { get { throw null; } } - protected internal virtual void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected internal virtual void EmitFeatures(Azure.CloudMachine.FeatureCollection features, string cmId) { } + protected internal virtual void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected internal virtual void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } protected abstract Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm); - protected static T EnsureEmits(Azure.Provisioning.CloudMachine.CloudMachineFeature feature) { throw null; } + protected static T EnsureEmits(Azure.CloudMachine.Core.CloudMachineFeature feature) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -123,6 +75,24 @@ protected internal virtual void EmitFeatures(Azure.CloudMachine.FeatureCollectio [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } + public partial class FeatureCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + internal FeatureCollection() { } + public void Add(Azure.CloudMachine.Core.CloudMachineFeature item) { } + public System.Collections.Generic.IEnumerable FindAll() where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } + public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } +} +namespace Azure.CloudMachine.KeyVault +{ + public partial class KeyVaultFeature : Azure.CloudMachine.Core.CloudMachineFeature + { + public KeyVaultFeature(Azure.Provisioning.KeyVault.KeyVaultSku? sku = null) { } + public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } + protected internal override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + } } namespace System.ClientModel.TypeSpec { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs index a526056e2055..af7b00e5592f 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/api/Azure.Provisioning.CloudMachine.netstandard2.0.cs @@ -4,31 +4,31 @@ public static partial class Azd { public static void Init(Azure.CloudMachine.CloudMachineClient client, string? infraDirectory = null) { } public static void Init(Azure.CloudMachine.CloudMachineInfrastructure infra, string? infraDirectory = null) { } + public static void InitDeployment(Azure.CloudMachine.CloudMachineInfrastructure infra, string? webProjectName) { } } public static partial class CloudMachineClientExtensions { - public static T AddFeature(this Azure.CloudMachine.CloudMachineClient client, T feature) where T : Azure.Provisioning.CloudMachine.CloudMachineFeature { throw null; } - public static void Configure(this Azure.CloudMachine.CloudMachineClient client, System.Action? configure = null) { } + public static T AddFeature(this Azure.CloudMachine.CloudMachineClient client, T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.CloudMachine.CloudMachineInfrastructure GetInfrastructure(this Azure.CloudMachine.CloudMachineClient client) { throw null; } } public static partial class CloudMachineCommands { - public static bool Execute(string[] args, System.Action? configure = null, bool exitProcessIfHandled = true) { throw null; } + public static bool TryExecuteCommand(this Azure.CloudMachine.CloudMachineInfrastructure cmi, string[] args) { throw null; } } public partial class CloudMachineInfrastructure { public CloudMachineInfrastructure(string? cmId = null) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public Azure.CloudMachine.ConnectionCollection Connections { get { throw null; } } - public Azure.CloudMachine.FeatureCollection Features { get { throw null; } } + public Azure.Core.ConnectionCollection Connections { get { throw null; } } + public Azure.CloudMachine.Core.FeatureCollection Features { get { throw null; } } public string Id { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Provisioning.Roles.UserAssignedIdentity Identity { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Provisioning.ProvisioningParameter PrincipalIdParameter { get { throw null; } } public void AddEndpoints() { } - public T AddFeature(T feature) where T : Azure.Provisioning.CloudMachine.CloudMachineFeature { throw null; } + public T AddFeature(T feature) where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public void AddResource(Azure.Provisioning.Primitives.NamedProvisionableConstruct resource) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -41,70 +41,22 @@ public void AddResource(Azure.Provisioning.Primitives.NamedProvisionableConstruc [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } - public partial class FeatureCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public static partial class CloudMachineInfrastructureConfiguration { - internal FeatureCollection() { } - public System.Collections.Generic.IEnumerable FindAll() where T : Azure.Provisioning.CloudMachine.CloudMachineFeature { throw null; } - public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class ServiceBusNamespaceFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public ServiceBusNamespaceFeature(string name, Azure.Provisioning.ServiceBus.ServiceBusSkuName sku = Azure.Provisioning.ServiceBus.ServiceBusSkuName.Standard, Azure.Provisioning.ServiceBus.ServiceBusSkuTier tier = Azure.Provisioning.ServiceBus.ServiceBusSkuTier.Standard) { } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } - } - public partial class ServiceBusSubscriptionFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public ServiceBusSubscriptionFeature(string name, Azure.CloudMachine.ServiceBusTopicFeature parent) { } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } - } - public partial class ServiceBusTopicFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public ServiceBusTopicFeature(string name, Azure.CloudMachine.ServiceBusNamespaceFeature parent) { } - public string Name { get { throw null; } } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddCloudMachine(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCloudMachineConfiguration(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } } } namespace Azure.CloudMachine.AppService { - public partial class AppServiceFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature + public partial class AppServiceFeature : Azure.CloudMachine.Core.CloudMachineFeature { public AppServiceFeature() { } public Azure.Provisioning.AppService.AppServiceSkuDescription Sku { get { throw null; } set { } } protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } } } -namespace Azure.CloudMachine.KeyVault -{ - public partial class KeyVaultFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public KeyVaultFeature(Azure.Provisioning.KeyVault.KeyVaultSku? sku = null) { } - public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } - } -} -namespace Azure.CloudMachine.OpenAI -{ - public enum AIModelKind - { - Chat = 0, - Embedding = 1, - } - public partial class OpenAIModelFeature : Azure.Provisioning.CloudMachine.CloudMachineFeature - { - public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine.OpenAI.AIModelKind kind = Azure.CloudMachine.OpenAI.AIModelKind.Chat) { } - public string Model { get { throw null; } } - public string ModelVersion { get { throw null; } } - protected internal override void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected internal override void EmitFeatures(Azure.CloudMachine.FeatureCollection features, string cmId) { } - protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm) { throw null; } - } -} -namespace Azure.Provisioning.CloudMachine +namespace Azure.CloudMachine.Core { public abstract partial class CloudMachineFeature { @@ -112,10 +64,10 @@ protected CloudMachineFeature() { } protected internal System.Collections.Generic.Dictionary RequiredSystemRoles { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Provisioning.Primitives.ProvisionableResource Resource { get { throw null; } } - protected internal virtual void EmitConnections(Azure.CloudMachine.ConnectionCollection connections, string cmId) { } - protected internal virtual void EmitFeatures(Azure.CloudMachine.FeatureCollection features, string cmId) { } + protected internal virtual void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected internal virtual void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { } protected abstract Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure cm); - protected static T EnsureEmits(Azure.Provisioning.CloudMachine.CloudMachineFeature feature) { throw null; } + protected static T EnsureEmits(Azure.CloudMachine.Core.CloudMachineFeature feature) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -123,6 +75,24 @@ protected internal virtual void EmitFeatures(Azure.CloudMachine.FeatureCollectio [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } } + public partial class FeatureCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + internal FeatureCollection() { } + public void Add(Azure.CloudMachine.Core.CloudMachineFeature item) { } + public System.Collections.Generic.IEnumerable FindAll() where T : Azure.CloudMachine.Core.CloudMachineFeature { throw null; } + public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } +} +namespace Azure.CloudMachine.KeyVault +{ + public partial class KeyVaultFeature : Azure.CloudMachine.Core.CloudMachineFeature + { + public KeyVaultFeature(Azure.Provisioning.KeyVault.KeyVaultSku? sku = null) { } + public Azure.Provisioning.KeyVault.KeyVaultSku Sku { get { throw null; } set { } } + protected internal override void EmitConnections(Azure.Core.ConnectionCollection connections, string cmId) { } + protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.CloudMachineInfrastructure infrastructure) { throw null; } + } } namespace System.ClientModel.TypeSpec { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj index 89a9b23ce3fc..5ac79e6053a8 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Azure.Provisioning.CloudMachine.csproj @@ -20,6 +20,7 @@ + diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs index 7559dd443762..c735cc00e425 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineClientExtensions.cs @@ -3,14 +3,14 @@ using System; using System.ComponentModel; +using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; namespace Azure.CloudMachine; public static class CloudMachineClientExtensions { - public static void Configure(this CloudMachineClient client, Action? configure = default) + private static void Configure(this CloudMachineClient client, Action? configure = default) { CloudMachineInfrastructure cmi = new(client.Id); if (configure != default) diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs index a43077e5db0b..ef8f00503640 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineFeature.cs @@ -4,10 +4,10 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using Azure.CloudMachine; +using Azure.Core; using Azure.Provisioning.Primitives; -namespace Azure.Provisioning.CloudMachine; +namespace Azure.CloudMachine.Core; public abstract class CloudMachineFeature { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineInfrastructure.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineInfrastructure.cs index 2e3c0adb9138..63dabfe88960 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineInfrastructure.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/CloudMachineInfrastructure.cs @@ -4,11 +4,18 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using Azure.CloudMachine.Core; +using Azure.CloudMachine.EventGrid; +using Azure.CloudMachine.ServiceBus; +using Azure.CloudMachine.Storage; +using Azure.Core; using Azure.Provisioning; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Expressions; using Azure.Provisioning.Primitives; using Azure.Provisioning.Roles; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; namespace Azure.CloudMachine; @@ -43,7 +50,7 @@ public CloudMachineInfrastructure(string? cmId = default) { if (cmId == default) { - cmId = CloudMachineWorkspace.ReadOrCreateCloudMachineId(); + cmId = CloudMachineClient.ReadOrCreateCloudMachineId(); } Id = cmId; @@ -62,7 +69,7 @@ public CloudMachineInfrastructure(string? cmId = default) AddFeature(new ServiceBusSubscriptionFeature("cm_servicebus_subscription_private", sbTopicPrivate)); // TODO: should private connections not be in the Connections collection? AddFeature(new ServiceBusSubscriptionFeature("cm_servicebus_subscription_default", sbTopicDefault)); var systemTopic = AddFeature(new EventGridSystemTopicFeature(Id, storage, "Microsoft.Storage.StorageAccounts")); - AddFeature(new SystemTopicEventSubscriptionFeature("cm_eventgrid_subscription_blob", systemTopic, sbTopicPrivate, sbNamespace)); + AddFeature(new SystemTopicEventSubscriptionFeature("cm-eventgrid-subscription-blob", systemTopic, sbTopicPrivate, sbNamespace)); } public T AddFeature(T feature) where T: CloudMachineFeature @@ -115,7 +122,7 @@ public ProvisioningPlan Build(ProvisioningBuildOptions? context = default) context ??= new ProvisioningBuildOptions(); // This must occur after the features have been emitted. - context.InfrastructureResolvers.Add(new RoleResolver(Features.RoleAnnotations, [Identity], [PrincipalIdParameter])); + context.InfrastructureResolvers.Add(new RoleResolver(Id, Features.RoleAnnotations, [Identity], [PrincipalIdParameter])); return _infrastructure.Build(context); } @@ -128,3 +135,31 @@ public ProvisioningPlan Build(ProvisioningBuildOptions? context = default) [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => base.Equals(obj); } + +public static class CloudMachineInfrastructureConfiguration +{ + /// + /// Adds a connections and CM ID to the config system. + /// + /// + /// + /// + public static IConfigurationBuilder AddCloudMachineConfiguration(this IConfigurationBuilder builder, CloudMachineInfrastructure cm) + { + builder.AddCloudMachineConnections(cm.Connections); + builder.AddCloudMachineId(cm.Id); + return builder; + } + + /// + /// Adds the CloudMachine to DI. + /// + /// + /// + /// + public static IHostApplicationBuilder AddCloudMachine(this IHostApplicationBuilder builder, CloudMachineInfrastructure cm) + { + builder.Services.AddSingleton(new CloudMachineClient(cm.Connections)); + return builder; + } +} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs index 07e24da9bd10..3e8d928e1c49 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/FeatureCollection.cs @@ -5,10 +5,9 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Primitives; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.Core; public class FeatureCollection : IEnumerable { @@ -34,7 +33,7 @@ public IEnumerable FindAll() where T : CloudMachineFeature } } - internal void Add(CloudMachineFeature item) + public void Add(CloudMachineFeature item) { if (_count == _items.Length) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/RoleResolver.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/RoleResolver.cs index f0958b7ca60f..2bf15a2a5054 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/RoleResolver.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/CloudMachineInfrastructure/RoleResolver.cs @@ -11,10 +11,11 @@ namespace Azure.CloudMachine; -internal class RoleResolver(Dictionary annotations, IEnumerable managedIdentities, IEnumerable> userPrincipals) : InfrastructureResolver +internal class RoleResolver(string id, Dictionary annotations, IEnumerable managedIdentities, IEnumerable> userPrincipals) : InfrastructureResolver { public override IEnumerable ResolveResources(IEnumerable resources, ProvisioningBuildOptions options) { + Dictionary roleCount = new(); foreach (Provisionable provisionable in base.ResolveResources(resources, options)) { yield return provisionable; @@ -24,9 +25,20 @@ public override IEnumerable ResolveResources(IEnumerable userPrincipal in userPrincipals) { - yield return new RoleAssignment($"{resource.BicepIdentifier}_{userPrincipal.Value.ToString().Replace('-', '_')}_{RoleName}") + string roleKey = $"{resource.BicepIdentifier}_{userPrincipal.Value.ToString()}_{RoleName}"; + if (roleCount.TryGetValue(roleKey, out int count)) { - Name = BicepFunction.CreateGuid(resource.BicepIdentifier, userPrincipal, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", RoleId)), + count = count + 1; + } + else + { + count = 1; + } + roleCount[roleKey] = count; + + yield return new RoleAssignment($"{resource.BicepIdentifier}_{count}_{RoleName}") + { + Name = BicepFunction.CreateGuid(resource.BicepIdentifier, id, userPrincipal, BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", RoleId)), Scope = new IdentifierExpression(resource.BicepIdentifier), PrincipalType = RoleManagementPrincipalType.User, RoleDefinitionId = BicepFunction.GetSubscriptionResourceId("Microsoft.Authorization/roleDefinitions", RoleId), diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs index 5f331be310e4..14723c51c54d 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/EventGridSystemTopicFeature.cs @@ -2,20 +2,21 @@ // Licensed under the MIT License. using Azure.CloudMachine.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.EventGrid; using Azure.Provisioning.Expressions; using Azure.Provisioning.Primitives; using Azure.Provisioning.Resources; using Azure.Provisioning.Storage; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.EventGrid; internal class EventGridSystemTopicFeature(string topicName, CloudMachineFeature source, string topicType) : CloudMachineFeature { + internal const string EventGridTopicVersion = "2022-06-15"; + protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) { - var topic = new SystemTopic("cm_eventgrid_topic", InternalConstants.EventGridTopicVersion) + var topic = new SystemTopic("cm_eventgrid_topic", EventGridTopicVersion) { TopicType = topicType, Source = EnsureEmits(source).Id, diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/InternalConstants.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/InternalConstants.cs deleted file mode 100644 index 6387aa81b001..000000000000 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/InternalConstants.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.CloudMachine.Core -{ - internal static class InternalConstants - { - internal const string EventGridTopicVersion = "2022-06-15"; - } -} diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs index 749b82feadb4..9df3f86fa3bc 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusNamespaceFeature.cs @@ -3,13 +3,12 @@ using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Primitives; using Azure.Provisioning.ServiceBus; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.ServiceBus; -public class ServiceBusNamespaceFeature(string name, ServiceBusSkuName sku = ServiceBusSkuName.Standard, ServiceBusSkuTier tier = ServiceBusSkuTier.Standard) : CloudMachineFeature +internal class ServiceBusNamespaceFeature(string name, ServiceBusSkuName sku = ServiceBusSkuName.Standard, ServiceBusSkuTier tier = ServiceBusSkuTier.Standard) : CloudMachineFeature { protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs index dd757020c184..72bacde5671f 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusSubscriptionFeature.cs @@ -2,14 +2,14 @@ // Licensed under the MIT License. using System; +using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Primitives; using Azure.Provisioning.ServiceBus; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.ServiceBus; -public class ServiceBusSubscriptionFeature(string name, ServiceBusTopicFeature parent) : CloudMachineFeature +internal class ServiceBusSubscriptionFeature(string name, ServiceBusTopicFeature parent) : CloudMachineFeature { protected override ProvisionableResource EmitResources(CloudMachineInfrastructure infrastructure) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs index e547085e4137..77a72f98b500 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/ServiceBusTopicFeature.cs @@ -2,14 +2,14 @@ // Licensed under the MIT License. using System; +using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Primitives; using Azure.Provisioning.ServiceBus; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.ServiceBus; -public class ServiceBusTopicFeature : CloudMachineFeature +internal class ServiceBusTopicFeature : CloudMachineFeature { public ServiceBusTopicFeature(string name, ServiceBusNamespaceFeature parent) { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs index 772ba9c7eaeb..86c6714dfd3b 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/StorageAccountFeature.cs @@ -1,18 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System.Collections.Generic; -using System.Linq; using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Expressions; using Azure.Provisioning.Primitives; using Azure.Provisioning.Resources; using Azure.Provisioning.Storage; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.Storage; internal class StorageAccountFeature : CloudMachineFeature { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs index ffc8fe92c4ee..3a5d158980e5 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesBuiltIn/SystemTopicEventSubscriptionFeature.cs @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Azure.CloudMachine.Core; +using Azure.CloudMachine.ServiceBus; using Azure.Provisioning.Authorization; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.EventGrid; using Azure.Provisioning.Expressions; using Azure.Provisioning.Primitives; using Azure.Provisioning.ServiceBus; -namespace Azure.CloudMachine; +namespace Azure.CloudMachine.EventGrid; internal class SystemTopicEventSubscriptionFeature(string name, EventGridSystemTopicFeature parent, ServiceBusTopicFeature destination, ServiceBusNamespaceFeature parentNamespace) : CloudMachineFeature { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs index 83d771f27482..4f9a308b1b6e 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/AppServiceFeature.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Expressions; using Azure.Provisioning.AppService; using Azure.Provisioning.Primitives; using Azure.Provisioning.Resources; +using Azure.CloudMachine.Core; namespace Azure.CloudMachine.AppService; diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs index 1e52c9d79ce2..6b366260ec53 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/FeaturesExtensions/KeyVaultFeature.cs @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; +using Azure.CloudMachine.Core; using Azure.Core; -using Azure.Provisioning.CloudMachine; using Azure.Provisioning.Expressions; using Azure.Provisioning.KeyVault; using Azure.Provisioning.Primitives; diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs index 4416e7cc32ab..af70f99778e7 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/GlobalSuppressions.cs @@ -5,4 +5,4 @@ [assembly: SuppressMessage("Usage", "AZC0005:DO provide protected parameterless constructor for mocking.", Justification = "", Scope = "type", Target = "~T:Azure.CloudMachine.CloudMachineClient")] [assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Identity.DefaultAzureCredential,Microsoft.Extensions.Configuration.IConfiguration)")] -[assembly: SuppressMessage("Usage", "AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Core.TokenCredential,Microsoft.Extensions.Configuration.IConfiguration)")] +[assembly: SuppressMessage("AZC0007:DO provide a minimal constructor that takes only the parameters required to connect to the service.", "Usage", Justification = "", Scope = "member", Target = "~M:Azure.CloudMachine.CloudMachineClient.#ctor(Azure.Core.TokenCredential,Microsoft.Extensions.Configuration.IConfiguration)")] diff --git a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/TokenCredentialAuthenticationPolicy.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/TokenCredentialAuthenticationPolicy.cs similarity index 96% rename from sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/TokenCredentialAuthenticationPolicy.cs rename to sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/TokenCredentialAuthenticationPolicy.cs index 3cb1ae80ccd1..a2d4811fc810 100644 --- a/sdk/cloudmachine/Azure.CloudMachine/src/Core/RestCLient/TokenCredentialAuthenticationPolicy.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/TokenCredentialAuthenticationPolicy.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core; using System; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -9,12 +8,12 @@ using System.Net; using System.Threading.Tasks; -namespace Azure.AI.OpenAI; +namespace Azure.Core; /// /// TokenCredentialAuthenticationPolicy is a pipeline policy that authenticates requests using a TokenCredential. /// -public partial class TokenCredentialAuthenticationPolicy : PipelinePolicy +internal partial class TokenCredentialAuthenticationPolicy : PipelinePolicy { private readonly TokenCredential _credential; private readonly string[] _scopes; @@ -99,7 +98,7 @@ private bool IsTokenFresh() private TokenRequestContext CreateRequestContext(PipelineRequest request) { - if (request.Headers.TryGetValue("x-ms-client-request-id", out string messageClientId)) + if (request.Headers.TryGetValue("x-ms-client-request-id", out string? messageClientId)) { return new TokenRequestContext(_scopes, messageClientId); } diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs index 9f5fcc7a1727..ce5ce5675935 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/Azd.cs @@ -6,6 +6,7 @@ using Azure.Provisioning.Primitives; using Azure.Provisioning.Resources; using Azure.Provisioning.Expressions; +using System.Linq; namespace Azure.CloudMachine; @@ -27,12 +28,13 @@ public static void Init(CloudMachineClient client, string? infraDirectory = defa public static void Init(CloudMachineInfrastructure infra, string? infraDirectory = default) { - if (infraDirectory == default) infraDirectory = Path.Combine(".", "infra"); + if (infraDirectory == default) + infraDirectory = Path.Combine(".", "infra"); Directory.CreateDirectory(infraDirectory); infra.Build().Save(infraDirectory); - var cmid = CloudMachineWorkspace.ReadOrCreateCloudMachineId(); + var cmid = CloudMachineClient.ReadOrCreateCloudMachineId(); // main.bicep var location = new ProvisioningParameter("location", typeof(string)); @@ -64,6 +66,28 @@ public static void Init(CloudMachineInfrastructure infra, string? infraDirectory WriteMainParametersFile(infraDirectory); } + + public static void InitDeployment(CloudMachineInfrastructure infra, string? webProjectName) + { + var webCsproj = webProjectName switch + { + null => ".", + _ => webProjectName.EndsWith(".csproj") ? webProjectName : $"{webProjectName}.csproj" + }; + var webProjDirectory = webCsproj switch + { + "." => null, + _ => Directory + .GetFiles(Directory.GetCurrentDirectory(), "*" + webCsproj, SearchOption.AllDirectories) + .SingleOrDefault() + }; + if (webProjDirectory != null) + { + webProjDirectory = Path.GetDirectoryName(webProjDirectory)?.Replace(Directory.GetCurrentDirectory(), "."); + } + WriteAzureYamlFile(webProjDirectory ?? "./", infra.Id); + } + private static void WriteMainParametersFile(string infraDirectory) { File.WriteAllText(Path.Combine(infraDirectory, $"{MainBicepName}.parameters.json"), @@ -85,4 +109,23 @@ private static void WriteMainParametersFile(string infraDirectory) } """); } + + private static void WriteAzureYamlFile(string webProjDirectory, string cmId, string? hostType = "appservice") + { + if (webProjDirectory == ".") + { + webProjDirectory = "./"; + } + + File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), "azure.yaml"), + $""" +name: {cmId} +resourceGroup: {cmId} +services: + {cmId}: + project: {webProjDirectory} # path to your web project + language: csharp # one of the supported languages + host: {hostType} # one of the supported Azure services +"""); + } } diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs index 4685dda5683e..9419d1d65a6f 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tooling/CloudMachineCommands.cs @@ -7,53 +7,54 @@ using System.Collections.Generic; using System.IO; using System.Text.Json; -using Azure.AI.OpenAI; using Azure.Core; +using Azure.Core.Rest; using Azure.Identity; namespace Azure.CloudMachine; public static class CloudMachineCommands { - public static bool Execute(string[] args, Action? configure = default, bool exitProcessIfHandled = true) + public static bool TryExecuteCommand(this CloudMachineInfrastructure cmi, string[] args) { if (args.Length < 1) return false; - string cmid = CloudMachineWorkspace.ReadOrCreateCloudMachineId(); - CloudMachineInfrastructure cmi = new(cmid); - if (configure != default) + string cmid = CloudMachineClient.ReadOrCreateCloudMachineId(); + + if (args[0] == "-bicep") { - configure(cmi); + Azd.Init(cmi); + return true; } - if (args[0] == "-bicep") + if (args[0] == "-init") { Azd.Init(cmi); - return Handled(exitProcessIfHandled); + + string? projName = default; + if (args.Length > 1) + { + projName = args[1]; + } + Azd.InitDeployment(cmi, projName); + return true; } if (args[0] == "-tsp") { GenerateTsp(cmi.Endpoints); - return Handled(exitProcessIfHandled); + return true; } if (args[0] == "-ai") { string? option = (args.Length > 1) ? args[1] : default; ListAzureOpenaAIModels(cmid, option); - return Handled(exitProcessIfHandled); + return true; } return false; - - static bool Handled(bool exitProcessIfHandled) - { - if (exitProcessIfHandled) - Environment.Exit(0); - return true; - } } // this implements: https://learn.microsoft.com/en-us/rest/api/azureopenai/models/list diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tsp/TypeSpecWriter.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tsp/TypeSpecWriter.cs index 2b1c6af5713b..5aa90be3907c 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tsp/TypeSpecWriter.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/src/Tsp/TypeSpecWriter.cs @@ -240,8 +240,7 @@ private static string ToTspType(this Type type) if (type == typeof(double)) return "float64"; - // TODO: - // return "safeint" if long is attributed with [SafeInt] + // TODO: return "safeint" if long is attributed with [SafeInt] // arrays if (type.IsClass) diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj index 9393c88763db..45b9e78d333f 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Azure.Provisioning.CloudMachine.Tests.csproj @@ -10,6 +10,7 @@ + diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs index 0afa31a6a375..c0bd9d479a06 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/CommandsTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Azure.CloudMachine.KeyVault; using NUnit.Framework; namespace Azure.CloudMachine.Tests; @@ -11,6 +12,22 @@ public class CommandsTests [Test] public void ListModels() { - CloudMachineCommands.Execute(["-ai", "chat"], exitProcessIfHandled: false); + CloudMachineInfrastructure cm = new(); + cm.TryExecuteCommand(["-ai", "chat"]); + } + + [Test] + public void GenerateBicep() + { + CloudMachineInfrastructure cm = new(); + cm.AddFeature(new KeyVaultFeature()); + cm.TryExecuteCommand(["-bicep"]); + } + + [Test] + public void DoInit() + { + CloudMachineInfrastructure cm = new(); + cm.TryExecuteCommand(["-init", "demo.csproj"]); } } diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/GenerateBicep.bicep b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/GenerateBicep.bicep index eebc294e692e..2a361a73d3d0 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/GenerateBicep.bicep +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/GenerateBicep.bicep @@ -28,8 +28,8 @@ resource cm_storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { } } -resource cm_storage_00000000_0000_0000_0000_000000000000_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_storage', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) +resource cm_storage_1_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_storage', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') @@ -48,8 +48,8 @@ resource cm_storage_cm_identity_StorageBlobDataContributor 'Microsoft.Authorizat scope: cm_storage } -resource cm_storage_00000000_0000_0000_0000_000000000000_StorageTableDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_storage', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) +resource cm_storage_1_StorageTableDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_storage', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3') @@ -87,8 +87,8 @@ resource cm_servicebus 'Microsoft.ServiceBus/namespaces@2024-01-01' = { } } -resource cm_servicebus_00000000_0000_0000_0000_000000000000_AzureServiceBusDataOwner 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_servicebus', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419')) +resource cm_servicebus_1_AzureServiceBusDataOwner 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_servicebus', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419') @@ -193,7 +193,7 @@ resource cm_eventgrid_topic 'Microsoft.EventGrid/systemTopics@2022-06-15' = { } resource cm_eventgrid_subscription_blob 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2022-06-15' = { - name: 'cm_eventgrid_subscription_blob' + name: 'cm-eventgrid-subscription-blob' properties: { deliveryWithResourceIdentity: { identity: { @@ -262,8 +262,8 @@ resource cm_kv 'Microsoft.KeyVault/vaults@2023-07-01' = { } } -resource cm_kv_00000000_0000_0000_0000_000000000000_KeyVaultAdministrator 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_kv', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483')) +resource cm_kv_1_KeyVaultAdministrator 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_kv', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483') @@ -295,8 +295,8 @@ resource openai 'Microsoft.CognitiveServices/accounts@2024-10-01' = { } } -resource openai_00000000_0000_0000_0000_000000000000_CognitiveServicesOpenAIContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('openai', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442')) +resource openai_1_CognitiveServicesOpenAIContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('openai', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442') diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/JustCloudMachine.bicep b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/JustCloudMachine.bicep index 4657dd5b9f34..be7556418fe9 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/JustCloudMachine.bicep +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/JustCloudMachine.bicep @@ -28,8 +28,8 @@ resource cm_storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { } } -resource cm_storage_00000000_0000_0000_0000_000000000000_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_storage', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) +resource cm_storage_1_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_storage', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') @@ -48,8 +48,8 @@ resource cm_storage_cm_identity_StorageBlobDataContributor 'Microsoft.Authorizat scope: cm_storage } -resource cm_storage_00000000_0000_0000_0000_000000000000_StorageTableDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_storage', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) +resource cm_storage_1_StorageTableDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_storage', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3') @@ -87,8 +87,8 @@ resource cm_servicebus 'Microsoft.ServiceBus/namespaces@2024-01-01' = { } } -resource cm_servicebus_00000000_0000_0000_0000_000000000000_AzureServiceBusDataOwner 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_servicebus', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419')) +resource cm_servicebus_1_AzureServiceBusDataOwner 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_servicebus', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419') @@ -193,7 +193,7 @@ resource cm_eventgrid_topic 'Microsoft.EventGrid/systemTopics@2022-06-15' = { } resource cm_eventgrid_subscription_blob 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2022-06-15' = { - name: 'cm_eventgrid_subscription_blob' + name: 'cm-eventgrid-subscription-blob' properties: { deliveryWithResourceIdentity: { identity: { diff --git a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/OpenAI.bicep b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/OpenAI.bicep index ef7b1529ef13..31460e2386b8 100644 --- a/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/OpenAI.bicep +++ b/sdk/cloudmachine/Azure.Provisioning.CloudMachine/tests/Data/OpenAI.bicep @@ -28,8 +28,8 @@ resource cm_storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { } } -resource cm_storage_00000000_0000_0000_0000_000000000000_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_storage', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) +resource cm_storage_1_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_storage', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') @@ -48,8 +48,8 @@ resource cm_storage_cm_identity_StorageBlobDataContributor 'Microsoft.Authorizat scope: cm_storage } -resource cm_storage_00000000_0000_0000_0000_000000000000_StorageTableDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_storage', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) +resource cm_storage_1_StorageTableDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_storage', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3') @@ -87,8 +87,8 @@ resource cm_servicebus 'Microsoft.ServiceBus/namespaces@2024-01-01' = { } } -resource cm_servicebus_00000000_0000_0000_0000_000000000000_AzureServiceBusDataOwner 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('cm_servicebus', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419')) +resource cm_servicebus_1_AzureServiceBusDataOwner 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('cm_servicebus', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '090c5cfd-751d-490a-894a-3ce6f1109419') @@ -193,7 +193,7 @@ resource cm_eventgrid_topic 'Microsoft.EventGrid/systemTopics@2022-06-15' = { } resource cm_eventgrid_subscription_blob 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2022-06-15' = { - name: 'cm_eventgrid_subscription_blob' + name: 'cm-eventgrid-subscription-blob' properties: { deliveryWithResourceIdentity: { identity: { @@ -250,8 +250,8 @@ resource openai 'Microsoft.CognitiveServices/accounts@2024-10-01' = { } } -resource openai_00000000_0000_0000_0000_000000000000_CognitiveServicesOpenAIContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('openai', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442')) +resource openai_1_CognitiveServicesOpenAIContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('openai', 'cm0c420d2f21084cd', principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442')) properties: { principalId: principalId roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a001fd3d-188f-4b5d-821b-7da978bf7442') diff --git a/sdk/cloudmachine/README.MD b/sdk/cloudmachine/README.MD deleted file mode 100644 index cb6c50be5a2a..000000000000 --- a/sdk/cloudmachine/README.MD +++ /dev/null @@ -1,272 +0,0 @@ -# Azure CloudMachine - -Write Azure apps in 5 minutes - -## Getting started - -### Prerequisites - -* You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). -* You must have .NET 8 (or higher) installed -* You must have Azure CLI (az) installed -* You must have Azure Developer CLI (azd) installed -* You must have npm installed -* You must be logged into Azure CLI and Azure Developer CLI - -### Walkthrough - -#### Create Server Project - -In a command line window type -```dotnetcli -mkdir cmdemo -cd cmdemo -mkdir server -cd server -dotnet new web -``` - -Add `Azure.CloudMachine.All` package -```dotnetcli -dotnet add package Azure.CloudMachine.All --prerelease -``` -#### Use Azure Developer CLI to provision CloudMachine - -Open `Program.cs` file and add the following two lines of code to the top of the file -```csharp -using Azure.CloudMachine; - -if (CloudMachineInfrastructure.Configure(args)) return; -``` -The `CloudMachineInfrastructure.Configure` call allows running the app with a `-bicep` switch, which will generate bicep files required to provision CloudMachine resources in Azure. Let's generate these bicep files now. -```dotnetcli -dotnet run -bicep -``` -As you can see, a folder called `infra` was created with several bicep files in it. Let's now initialize the project. -```dotnetcli -azd init -``` -select template, choose 'yes' when asked 'Continue initializing an app here?', choose the 'minimal' template, and use 'cmserver' as the environment name - -Once the initialization completes, let's provision the resources. Select `eastus` as the region -```dotnetcli -azd provision -``` -When provisioning finishes, you should see something like the following in the console output -```dotnetcli - (✓) Done: Resource group: cm125957681369428 (627ms) -``` -And if you go to your Azure portal, or execute the following az command, you can see the resource group created. The resource group will contain resources such as Storage, ServiceBus, and EventGrid. -```dotnetcli -az resource list --resource-group --output table -``` - -#### Use CDK to add resources to the CloudMachine - -Since we are writing an AI application, we need to provision Azure OpenAI resources. To do this, add the follwoing class to the end of the `Program.cs` file: -```csharp -class AssistantService { - internal static void Configure(CloudMachineInfrastructure cm) { - cm.AddFeature(new OpenAIFeature() { Chat = new AIModel("gpt-4o-mini", "2024-07-18") }); - } -} -``` -Then change the configuration call at the beginning of the file to: -```csharp -if (CloudMachineInfrastructure.Configure(args, AssistantService.Configure)) return; -``` -Now regenerate the bicep files and re-provision -```dotnetcli -dotnet run -bicep -azd provision -``` - -#### Call CloudMachine APIs - -You are now ready to call Azure OpenAI service from the app. To do this, add `CloudMachineClient` field and a `Chat` method to `AssistantService`: -```csharp -class AssistantService { - CloudMachineClient cm = new CloudMachineClient(); - - public async Task Chat(string message) { - var client = cm.GetOpenAIChatClient(); - ChatCompletion completion = await client.CompleteChatAsync(message); - return completion.Content[0].Text; - } -} -``` -Lastly, create an instance of the service and call the `Chat` method when the user navigates to the root URL: -```csharp -var service = new AssistantService(); -app.MapGet("/", async () => await service.Chat("List all noble gases")); -``` -The full program should now look like the following: -```csharp -using Azure.CloudMachine; -using Azure.CloudMachine.OpenAI; -using OpenAI.Chat; - -if (CloudMachineInfrastructure.Configure(args, AssistantService.Configure)) return; - -var builder = WebApplication.CreateBuilder(args); -var app = builder.Build(); - -var service = new AssistantService(); -app.MapGet("/", async () => await service.Chat("List all noble gases")); - -app.Run(); - -class AssistantService { - CloudMachineClient cm = new CloudMachineClient(); - - public async Task Chat(string message) { - var client = cm.GetOpenAIChatClient(); - ChatCompletion completion = await client.CompleteChatAsync(message); - return completion.Content[0].Text; - } - - internal static void Configure(CloudMachineInfrastructure cm) { - cm.AddFeature(new OpenAIFeature() { - Chat = new AIModel("gpt-4o-mini", "2024-07-18") - }); - } -} -``` -You can now start the application -```dotnetcli -dotnet run -``` -and navigate to the URL printed in the console. - -#### Use TDK to expose Web APIs and generate TypeSpec -First, let's define an API we want to expose. We will do it using a C# interface. Add the following interface to the end of `Program.cs`: -```csharp -interface IAssistantService { - Task Chat(string message); -} -``` -Make sure that the `AssistantService` class implements the interface: -```csharp -class AssistantService : IAssistantService -``` -Expose the service methods as web APIs by adding the following line after the existing `var service = new AssistantService();` line: -```csharp -app.Map(service); -``` -Lastly, add the ability to generate TypeSpec for the new API by adding a new statement to the `Configure` method -```csharp -cm.AddEndpoints(); -``` -Your program shoud now look like the following: -```csharp -using Azure.CloudMachine; -using Azure.CloudMachine.OpenAI; -using OpenAI.Chat; - -if (CloudMachineInfrastructure.Configure(args, AssistantService.Configure)) return; - -var builder = WebApplication.CreateBuilder(args); -var app = builder.Build(); - -var service = new AssistantService(); -app.Map(service); -app.MapGet("/", async () => await service.Chat("List all noble gases")); - -app.Run(); - -class AssistantService : IAssistantService { - CloudMachineClient cm = new CloudMachineClient(); - - public async Task Chat(string message) { - var client = cm.GetOpenAIChatClient(); - ChatCompletion completion = await client.CompleteChatAsync(message); - return completion.Content[0].Text; - } - - internal static void Configure(CloudMachineInfrastructure cm) { - cm.AddFeature(new OpenAIFeature() { - Chat = new AIModel("gpt-4o-mini", "2024-07-18") - }); - cm.AddEndpoints(); - } -} - -interface IAssistantService { - Task Chat(string message); -} -``` -You can now start the application and browse to the /chat endpoint [TBD on how to pass the parameter] - -But what's more interesting, you can run the app with the -tsp switch to generate TypeSpec for the endpoint: -```dotnetcli -dotnet run -tsp -``` -This will create a `tsp` directory, `AssistantService.tsp` file, with the following contents: -```tsp -import "@typespec/http"; -import "@typespec/rest"; -import "@azure-tools/typespec-client-generator-core"; - -@service({ - title: "AssistantService", -}) - -namespace AssistantService; - -using TypeSpec.Http; -using TypeSpec.Rest; -using Azure.ClientGenerator.Core; - -@client interface AssistantServiceClient { - @get @route("chat") Chat(@body message: string) : { - @statusCode statusCode: 200; - @body response : string; - }; -} -``` -#### Generate client libraries from TypeSpec -Let's now generate and build a C# client library from the `AssistantService.tsp` file: -```dotnetcli -cd .. -npm install @typespec/http-client-csharp -tsp compile .\server\tsp\AssistantService.tsp --emit "@typespec/http-client-csharp" -dotnet build tsp-output\@typespec\http-client-csharp\src\AssistantService.csproj -``` -You can also generate libraries for other languages, e.g. -```dotnetcli -npm install @typespec/http-client-python -tsp compile .\server\tsp\AssistantService.tsp --emit "@typespec/http-client-python" -``` - -#### Create command line client app for the service -```dotnetcli -mkdir cmdclient -cd cmdclient -dotnet new console -dotnet add reference ..\tsp-output\@typespec\http-client-csharp\src\AssistantService.csproj -``` -And change the `Program.cs` file to the following, replacing the client URI with the URI in your server's launchsettings.json file ('cmdemo\server\Properties' folder) - -```csharp -using AssistantService; - -var client = new AssistantServiceClient(new Uri("http://localhost:5121/")); - -while(true){ - string message = Console.ReadLine(); - var completion = client.Chat(message); - Console.WriteLine(completion); -} -``` -Now start the server -```dotnetcli -start cmd -cd.. -cd server -dotnet run -``` -Go back to the client project command window and start the client: -```dotnetcli -dotnet run -``` -You can use the simple command line app to ask Azure OpenAI some questions. diff --git a/sdk/cloudmachine/README.md b/sdk/cloudmachine/README.md new file mode 100644 index 000000000000..7899b1603498 --- /dev/null +++ b/sdk/cloudmachine/README.md @@ -0,0 +1,161 @@ +# Azure CloudMachine client library for .NET + +Write Azure apps in 5 minutes + +## Getting started + +### Install the package + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.CloudMachine.All --prerelease +``` + +### Authenticate the Client + +### Prerequisites + +* You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). +* You must have .NET 8 (or higher) installed +* You must have Azure CLI (az) installed +* You must have Azure Developer CLI (azd) installed +* You must have npm installed +* You must be logged into Azure CLI and Azure Developer CLI + +## Key concepts + +Write Azure apps in 5 minutes using simplified opinionated APIs and declarative resource provisioning. + +### Walkthrough + +#### Create Server Project + +In a command line window type +```dotnetcli +mkdir cmdemo +cd cmdemo +mkdir server +cd server +dotnet new web +``` + +Add `Azure.CloudMachine.All` package +```dotnetcli +dotnet add package Azure.CloudMachine.All --prerelease +``` +#### Use Azure Developer CLI to provision CloudMachine + +Open `Program.cs` file and add the following two lines of code to the top of the file +```csharp +using Azure.CloudMachine; + +CloudMachineInfrastructure infrastrucutre = new(); +if (infrastrucutre.TryExecuteCommand(args)) return; +``` + +The `TryExecuteCommand` call allows running the app with a `-init` switch, which will generate bicep files required to provision CloudMachine resources in Azure. Let's generate these bicep files now. +```dotnetcli +dotnet run -init +``` +As you can see, a folder called `infra` was created with several bicep files in it. Let's now initialize the project. + +```dotnetcli +azd init +``` +type 'demo' as the environment name, and then let's provision the resources (select `eastus` as the region): +```dotnetcli +azd provision +``` +When provisioning finishes, you should see something like the following in the console output +```dotnetcli + (✓) Done: Resource group: cm125957681369428 (627ms) +``` +And if you go to your Azure portal, or execute the following az command, you can see the resource group created. The resource group will contain resources such as Storage, ServiceBus, and EventGrid. +```dotnetcli +az resource list --resource-group --output table +``` + +#### Use CDK to add resources to the CloudMachine + +Since we are writing an AI application, we need to provision Azure OpenAI resources. To do this, add the follwoing line of code right below where the infrastructure instance is created: +```csharp +infrastrucutre.AddFeature(new OpenAIModelFeature("gpt-4o-mini", "2024-07-18")); +``` +Now regenerate the bicep files and re-provision +```dotnetcli +dotnet run -init +azd provision +``` + +#### Add CloudMachineClient to ASP.NET DI Container +You will be using `CloudMachineClient` to access rources provisioned in the cloud machine. Let's add such client to the DI container such that it is avaliable to ASP.NET handlers +```dotnetcli +builder.AddCloudMachine(infrastrucutre); +``` +#### Call CloudMachine APIs + +You are now ready to call Azure OpenAI service from the app. To do this, change the line of code that maps the application root to the following: + +```csharp +app.MapGet("/", (CloudMachineClient cm) => cm.GetOpenAIChatClient().CompleteChat("list all noble gases").AsText()); +``` + +The full program should now look like the following: +```csharp +using Azure.CloudMachine; +using Azure.CloudMachine.OpenAI; + +CloudMachineInfrastructure infrastrucutre = new(); +infrastrucutre.AddFeature(new OpenAIModelFeature("gpt-4o-mini", "2024-07-18")); +if (infrastrucutre.TryExecuteCommand(args)) return; + +var builder = WebApplication.CreateBuilder(args); +builder.AddCloudMachine(infrastrucutre); + +var app = builder.Build(); + +app.MapGet("/", (CloudMachineClient cm) => cm.GetOpenAIChatClient().CompleteChat("list all noble gases").AsText()); + +app.Run(); +``` + +You can now start the application +```dotnetcli +dotnet run +``` +and navigate to the URL printed in the console. + +## Examples + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/cloudmachine/ci.yml b/sdk/cloudmachine/ci.yml index 95b51890061f..d55b63530227 100644 --- a/sdk/cloudmachine/ci.yml +++ b/sdk/cloudmachine/ci.yml @@ -51,3 +51,11 @@ extends: Artifacts: - name: Azure.CloudMachine safeName: AzureCloudMachine + - name: Azure.CloudMachine.All + safeName: AzureCloudMachineAll + - name: Azure.CloudMachine.Web + safeName: AzureCloudMachineWeb + - name: Azure.CloudMachine.OpenAI + safeName: AzureCloudMachineOpenAI + - name: Azure.Provisioning.CloudMachine + safeName: AzureProvisioningCloudMachine diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/Azure.AI.Language.Conversations.Authoring.sln b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/Azure.AI.Language.Conversations.Authoring.sln new file mode 100644 index 000000000000..34f4723530d8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/Azure.AI.Language.Conversations.Authoring.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 +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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Conversations.Authoring", "src\Azure.AI.Language.Conversations.Authoring.csproj", "{6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Conversations.Authoring.Tests", "tests\Azure.AI.Language.Conversations.Authoring.Tests.csproj", "{7D7A2328-261A-42CE-88C4-46E5B3596582}" +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 + {6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6DE0AA5F-A83F-42D4-B2E8-CE59785E2F98}.Release|Any CPU.Build.0 = Release|Any CPU + {7D7A2328-261A-42CE-88C4-46E5B3596582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D7A2328-261A-42CE-88C4-46E5B3596582}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D7A2328-261A-42CE-88C4-46E5B3596582}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D7A2328-261A-42CE-88C4-46E5B3596582}.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/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/CHANGELOG.md new file mode 100644 index 000000000000..27ff5e3c4cb2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/CHANGELOG.md @@ -0,0 +1,15 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0-beta.1 + +- Initial preview of the Azure.AI.Language.Conversations.Authoring client library. diff --git a/sdk/maps/Azure.Maps.TimeZone/Directory.Build.props b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/Directory.Build.props similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/Directory.Build.props rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/Directory.Build.props diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md new file mode 100644 index 000000000000..89fca2f4b976 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.md @@ -0,0 +1,278 @@ +# Azure Authoring client library for .NET + +Azure Conversations Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that provides tools for creating, managing, and deploying conversational AI solutions. This client library offers the following features: + +* Creating and managing conversation projects +* Importing and exporting conversation projects +* Training models for conversational AI +* Evaluating trained models +* Deploying conversational AI models +* Swapping deployments for active models +* Canceling active training jobs +* Managing project snapshots +* Deleting trained models and deployments + +[Source code][source_root] | [Package (NuGet)][package]| [API reference documentation][text_refdocs] | [Product documentation][text_docs] | [Samples][source_samples] + +## 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 + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.AI.Language.Conversations.Authoring --prerelease +``` + +|SDK version |Supported API version of service +|-------------|------------------------------------------------------------- +|1.0.0-beta.1 | 2022-05-01, 2023-04-01, 2023-11-15-preview, 2024-11-15-preview (default) + +### Prerequisites + +* An [Azure subscription][azure_sub]. +* An existing Cognitive Services or Language service resource. + +### Authenticate the client + +In order to interact with the Conversations Authoring service, you'll need to create an instance of the [`AnalyzeConversationAuthoring`][conversationalAnalysisAuthoring_class] class. You will need an **endpoint**, and an **API key** to instantiate a client object. For more information regarding authenticating with Cognitive Services, see [Authenticate requests to Azure Cognitive Services][cognitive_auth]. + +#### Get an API key + +You can get the `endpoint` and `API key` from the Cognitive Services resource or Language service resource information in the [Azure Portal][azure_portal]. + +Alternatively, use the [Azure CLI][azure_cli] snippet below to get the API key from the Language service resource. + +```PowerShell +az cognitiveservices account keys list --resource-group --name +``` + +#### Create a AnalyzeConversationAuthoring Client + +To use the AnalyzeConversationAuthoring client, include the following namespace in your project: + +```C# +using Azure.AI.Language.Conversations.Authoring; +``` + +With your endpoint and API key, you can instantiate an AuthoringClient and create a AnalyzeConversationAuthoring client using specific service options: + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your-api-key"); +AuthoringClient client = new AuthoringClient(endpoint, credential); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +#### Create a client using Azure Active Directory authentication + +You can also create a `AnalyzeConversationAuthoring` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +Using the [DefaultAzureCredential] you can authenticate a service using Managed Identity or a service principal, authenticate as a developer working on an application, and more, all without changing code. + +Before you can use the `DefaultAzureCredential`, or any credential type from [Azure.Identity][azure_identity], you'll first need to [install the Azure.Identity package][azure_identity_install]. + +To use `DefaultAzureCredential` with a client ID and secret, you'll need to set the `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, and `AZURE_CLIENT_SECRET` environment variables; alternatively, you can pass those values +to the `ClientSecretCredential` also in Azure.Identity. + +Make sure you use the right namespace for `DefaultAzureCredential` at the top of your source file: + +```C# Snippet:Conversations_Identity_Namespace +using Azure.Identity; +using Azure.Core; +``` + +Then you can create an instance of `DefaultAzureCredential` and pass it to a new instance of your client: + +```C# Snippet:AnalyzeConversationAuthoring_CreateWithDefaultAzureCredential +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +DefaultAzureCredential credential = new DefaultAzureCredential(); +AuthoringClient client = new AuthoringClient(endpoint, credential); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +Note that regional endpoints do not support AAD authentication. Instead, create a [custom domain][custom_domain] name for your resource to use AAD authentication. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +If you do not select an api version we will default to the latest version available, which has the possibility of being a preview version. + +## Key concepts + +### AnalyzeConversationAuthoring + +The [`AnalyzeConversationAuthoring`][AnalyzeConversationAuthoring_class] is the primary interface for developers using the Azure AI Conversation Authoring client library. It provides both synchronous and asynchronous operations to access a specific use of conversation authoring, such as creating and managing conversation projects. + +### 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://learn.microsoft.com/dotnet/azure/sdk/unit-testing-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/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples). + +* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProjectAsync.md) +* [Import a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_Import.md) +* [Import a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_ImportAsync.md) +* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_Export.md) +* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_ExportAsync.md) +* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.md) +* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.md) +* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.md) +* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.md) +* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.md) + +## Troubleshooting + +### General + +When you interact with the Cognitive Language Services Conversations Authoring client library using the .NET SDK, errors returned by the service correspond to the same HTTP status codes returned for REST API requests. + +For example, if you attempt to create a project with an invalid configuration, a 400 error is returned indicating "Bad Request". + +```C# Snippet:AuthoringClient_BadRequest +try +{ + string invalidProjectName = "InvalidProject"; + + var projectData = new + { + projectName = invalidProjectName, + language = "invalid-lang", // Invalid language code + projectKind = "Conversation", + description = "This is a test for invalid configuration." + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = authoringClient.CreateProject(invalidProjectName, content); +} +catch (RequestFailedException ex) +{ + Console.WriteLine(ex.ToString()); +} +``` + +You will notice that additional information is logged, like the client request ID of the operation. + +```text +Azure.RequestFailedException: The input parameter is invalid. +Status: 400 (Bad Request) +ErrorCode: InvalidArgument + +Content: +Azure.RequestFailedException: Invalid Request. +Status: 400 (Bad Request) +ErrorCode: InvalidRequest + +Content: +{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"LanguageCodeInvalid","message":"The language code is invalid. Possible values are: en, es, fr, ..."}}} + +Headers: +Transfer-Encoding: chunked +x-envoy-upstream-service-time: REDACTED +apim-request-id: REDACTED +Strict-Transport-Security: REDACTED +X-Content-Type-Options: REDACTED +x-ms-region: REDACTED +Date: Wed, 24 Jul 2024 13:39:00 GMT +Content-Type: application/json; charset=utf-8 +``` + +### Setting up console logging + +The simplest way to see the logs is to enable the console logging. +To create an Azure SDK log listener that outputs messages to console use AzureEventSourceListener.CreateConsoleLogger method. + +```C# +// Setup a listener to monitor logged events. +using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(); +``` + +To learn more about other logging mechanisms see [here][logging]. + +## Next steps + +* View our [samples][source_samples]. +* Read about the different [features][text_docs] of the Conversations Authoring. + +## Contributing + +See the [CONTRIBUTING.md][contributing] for details on building, testing, and contributing to this library. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md +[cla]: https://cla.microsoft.com +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com +[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential +[azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md +[azure_identity_install]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#install-the-package +[custom_domain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[source_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples +[source_migration]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/MigrationGuide.md +[source_root]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src +[package]: https://www.nuget.org/packages/ +[text_refdocs]: https://learn.microsoft.com/dotnet/ +[text_docs]: https://learn.microsoft.com/azure/ai-services/language-service/conversational-language-understanding/overview +[azure_sub]: https://azure.microsoft.com/free/dotnet/ +[conversationalAnalysisAuthoring_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs +[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/ +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_portal]: https://portal.azure.com +[logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.net8.0.cs new file mode 100644 index 000000000000..dacd057d6a27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.net8.0.cs @@ -0,0 +1,1571 @@ +namespace Azure.AI.Language.Conversations.Authoring +{ + public partial class AnalyzeConversationAuthoring + { + protected AnalyzeConversationAuthoring() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> CopyProjectAuthorizationAsync(string projectName, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAuthorizationAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CreateProject(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateProjectAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeployment(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteProject(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssignedResourceDeployments(int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAssignedResourceDeployments(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAssignedResourceDeploymentsAsync(int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignedResourceDeploymentsAsync(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetCopyProjectStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetCopyProjectStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentAsync(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentAsync(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelAsync(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelAsync(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetImportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetImportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectAsync(string projectName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectDeletionStatusAsync(string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectDeletionStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSupportedLanguages(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSupportedLanguages(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> GetSupportedLanguagesAsync(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSupportedLanguagesAsync(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetSupportedPrebuiltEntities(string language, string multilingual, int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetSupportedPrebuiltEntities(string language = null, string multilingual = null, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSupportedPrebuiltEntitiesAsync(string language, string multilingual, int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetSupportedPrebuiltEntitiesAsync(string language = null, string multilingual = null, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingConfigVersions(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingConfigVersions(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainingConfigVersionsAsync(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainingConfigVersionsAsync(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainingStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainingStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.ExportedProject body, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string exportedProjectFormat = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.ExportedProject body, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string exportedProjectFormat = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation LoadSnapshot(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task LoadSnapshotAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class AuthoringClient + { + protected AuthoringClient() { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions options) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.AI.Language.Conversations.Authoring.AnalyzeConversationAuthoring GetAnalyzeConversationAuthoringClient(string apiVersion = "2024-11-15-preview") { throw null; } + } + public partial class AuthoringClientOptions : Azure.Core.ClientOptions + { + public AuthoringClientOptions(Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview) { } + public enum ServiceVersion + { + V2023_04_01 = 1, + V2023_04_15_Preview = 2, + V2024_11_15_Preview = 3, + } + } + public static partial class ConversationsAuthoringClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } + public static partial class ConversationsAuthoringModelFactory + { + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, System.Collections.Generic.IEnumerable deploymentsMetadata = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedResourceDeploymentsMetadata AssignedResourceDeploymentsMetadata(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsError AuthoringConversationsError(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode code = default(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode), string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsWarning AuthoringConversationsWarning(string code = null, string message = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix ConfusionMatrix(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = 0f, float rawValue = 0f) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixRow ConfusionMatrixRow(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedEntity ConversationExportedEntity(string category = null, Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting? compositionSetting = default(Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting?), Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList list = null, System.Collections.Generic.IEnumerable prebuilts = null, Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex regex = null, System.Collections.Generic.IEnumerable requiredComponents = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedUtterance ConversationExportedUtterance(System.Collections.Generic.IEnumerable entities = null, string text = null, string language = null, string intent = null, string dataset = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CopyProjectJobState CopyProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, System.Collections.Generic.IEnumerable assignedResourceIds = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails CreateProjectDetails(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind), Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentJobState DeploymentJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentResource DeploymentResource(string resourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentResourcesJobState DeploymentResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary EntitiesEvaluationSummary(Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary entities = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EntityEvaluationSummary EntityEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult EvaluationJobResult(Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobState EvaluationJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult result = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationSummary EvaluationSummary(Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary entitiesEvaluation = null, Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary intentsEvaluation = null, Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails evaluationOptions = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestrationDetails ExportedConversationOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration conversationOrchestration = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration ExportedLuisOrchestration(System.Guid appId = default(System.Guid), string appVersion = null, string slotName = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestrationDetails ExportedLuisOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration luisOrchestration = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedModelJobState ExportedModelJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedProject ExportedProject(string projectFileVersion = null, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType = default(Azure.AI.Language.Conversations.Authoring.Models.StringIndexType), Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails metadata = null, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets assets = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestrationDetails ExportedQuestionAnsweringOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastExportedModelDateTime = default(System.DateTimeOffset), System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportProjectJobState ExportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, string resultUrl = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ImportProjectJobState ImportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel InnerErrorModel(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode code = default(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode), string message = null, System.Collections.Generic.IReadOnlyDictionary details = null, string target = null, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.IntentEvaluationSummary IntentEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary IntentsEvaluationSummary(Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary intents = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedIntent OrchestrationExportedIntent(Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails orchestration = null, string category = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedUtterance OrchestrationExportedUtterance(string text = null, string language = null, string intent = null, string dataset = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntities PrebuiltEntities(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, System.Collections.Generic.IEnumerable assignedResources = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectMetadata ProjectMetadata(System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? lastTrainedDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastDeployedDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind), Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), int lastTrainingDurationInSeconds = 0, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, bool hasSnapshot = false) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState SubTrainingJobState(int percentComplete = 0, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguages SupportedLanguages(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersions TrainingConfigVersions(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode trainingMode = default(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode), Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails evaluationOptions = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode? trainingMode = default(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode?), Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState trainingStatus = null, Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState evaluationStatus = null, System.DateTimeOffset? estimatedEndDateTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingJobState TrainingJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult result = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult UtteranceEntitiesEvaluationResult(System.Collections.Generic.IEnumerable expectedEntities = null, System.Collections.Generic.IEnumerable predictedEntities = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntityEvaluationResult UtteranceEntityEvaluationResult(string category = null, int offset = 0, int length = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceEvaluationResult UtteranceEvaluationResult(string text = null, string language = null, Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult entitiesResult = null, Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult intentsResult = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult UtteranceIntentsEvaluationResult(string expectedIntent = null, string predictedIntent = null) { throw null; } + } +} +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable resourcesMetadata) { } + public System.Collections.Generic.IList ResourcesMetadata { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedDeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedDeploymentResource() { } + public string AzureResourceId { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentMetadata() { } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentsMetadata() { } + public System.Collections.Generic.IReadOnlyList DeploymentsMetadata { get { throw null; } } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedResourceDeploymentsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedResourceDeploymentsMetadata() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedResourceDeploymentsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedResourceDeploymentsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AuthoringConversationsError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AuthoringConversationsError() { } + public Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AuthoringConversationsWarning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AuthoringConversationsWarning() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsWarning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsWarning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CompositionSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CompositionSetting(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting CombineComponents { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting RequireExactOverlap { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting ReturnLongestOverlap { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting SeparateComponents { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting 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.Language.Conversations.Authoring.Models.CompositionSetting left, Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting left, Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConfusionMatrix : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrix() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixCell : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixCell() { } + public float NormalizedValue { get { throw null; } } + public float RawValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixRow : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixRow() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedEntity(string category) { } + public string Category { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting? CompositionSetting { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList List { get { throw null; } set { } } + public System.Collections.Generic.IList Prebuilts { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex Regex { get { throw null; } set { } } + public System.Collections.Generic.IList RequiredComponents { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedIntent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedIntent(string category) { } + public string Category { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedIntent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedIntent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedProjectAssets : Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedProjectAssets() { } + public System.Collections.Generic.IList Entities { get { throw null; } } + public System.Collections.Generic.IList Intents { get { throw null; } } + public System.Collections.Generic.IList Utterances { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedUtterance : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedUtterance(string text, string intent) { } + public string Dataset { get { throw null; } set { } } + public System.Collections.Generic.IList Entities { get { throw null; } } + public string Intent { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Text { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedUtterance System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedUtterance System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyProjectDetails(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string targetProjectName, string accessToken, System.DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) { } + public string AccessToken { get { throw null; } set { } } + public System.DateTimeOffset ExpiresAt { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectKind ProjectKind { get { throw null; } set { } } + public string TargetProjectName { get { throw null; } set { } } + public string TargetResourceId { get { throw null; } set { } } + public string TargetResourceRegion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CopyProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateDeploymentDetails(string trainedModelLabel) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateProjectDetails(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string projectName, string language) { } + public string Description { get { throw null; } set { } } + public string Language { get { throw null; } } + public bool? Multilingual { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings Settings { get { throw null; } set { } } + public string StorageInputContainerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeleteDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeleteDeploymentDetails() { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentDeleteFromResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentDeleteFromResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentResource() { } + public string Region { get { throw null; } } + public string ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntitiesEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntitiesEvaluationSummary() { } + public Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Entities { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntityEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntityEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ErrorCode(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchIndexLimitReached { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchIndexNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Conflict { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Forbidden { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode InternalServerError { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode InvalidArgument { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode NotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode OperationNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode ProjectNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode QuotaExceeded { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode ServiceUnavailable { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Timeout { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode TooManyRequests { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Unauthorized { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Warning { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode 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.Language.Conversations.Authoring.Models.ErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.ErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.ErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.ErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EvaluationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EvaluationDetails() { } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind? Kind { get { throw null; } set { } } + public int? TestingSplitPercentage { get { throw null; } set { } } + public int? TrainingSplitPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobResult() { } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + public string ModelLabel { get { throw null; } } + public int PercentComplete { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult Result { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EvaluationKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EvaluationKind(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind Manual { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind Percentage { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind 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.Language.Conversations.Authoring.Models.EvaluationKind left, Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind left, Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationSummary() { } + public Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary EntitiesEvaluation { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary IntentsEvaluation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedConversationOrchestration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedConversationOrchestration(string projectName, string deploymentName) { } + public string DeploymentName { get { throw null; } } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedConversationOrchestrationDetails : Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedConversationOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration conversationOrchestration) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration ConversationOrchestration { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityList : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityList() { } + public System.Collections.Generic.IList Sublists { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityListSynonym : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityListSynonym() { } + public string Language { get { throw null; } set { } } + public System.Collections.Generic.IList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityRegex : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityRegex() { } + public System.Collections.Generic.IList Expressions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityRegexExpression : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityRegexExpression() { } + public string Language { get { throw null; } set { } } + public string RegexKey { get { throw null; } set { } } + public string RegexPattern { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegexExpression System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegexExpression System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntitySublist : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntitySublist() { } + public string ListKey { get { throw null; } set { } } + public System.Collections.Generic.IList Synonyms { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedLuisOrchestration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedLuisOrchestration(System.Guid appId) { } + public System.Guid AppId { get { throw null; } } + public string AppVersion { get { throw null; } set { } } + public string SlotName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedLuisOrchestrationDetails : Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedLuisOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration luisOrchestration) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration LuisOrchestration { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedModelDetails(string trainedModelLabel) { } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedModelJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ExportedOrchestrationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ExportedOrchestrationDetails() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedPrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedPrebuiltEntity(string category) { } + public string Category { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedProject : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedProject(string projectFileVersion, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails metadata) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets Assets { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails Metadata { get { throw null; } } + public string ProjectFileVersion { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.StringIndexType StringIndexType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ExportedProjectAssets : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ExportedProjectAssets() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ExportedProjectFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ExportedProjectFormat(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat Conversation { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat Luis { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat 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.Language.Conversations.Authoring.Models.ExportedProjectFormat left, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat left, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ExportedQuestionAnsweringOrchestration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedQuestionAnsweringOrchestration(string projectName) { } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedQuestionAnsweringOrchestrationDetails : Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedQuestionAnsweringOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration QuestionAnsweringOrchestration { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedTrainedModel() { } + public string ExportedModelName { get { throw null; } } + public System.DateTimeOffset LastExportedModelDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedUtteranceEntityLabel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedUtteranceEntityLabel(string category, int offset, int length) { } + public string Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedUtteranceEntityLabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedUtteranceEntityLabel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public string ResultUrl { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct InnerErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InnerErrorCode(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode EmptyRequest { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode ExtractionFailure { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidCountryHint { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidDocument { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidDocumentBatch { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidParameterValue { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidRequestBodyFormat { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode KnowledgeBaseNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode MissingInputDocuments { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode ModelVersionIncorrect { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode UnsupportedLanguageCode { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode 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.Language.Conversations.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InnerErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InnerErrorModel() { } + public Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Details { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IntentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IntentEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IntentsEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IntentsEvaluationSummary() { } + public Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Intents { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobStatus(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Cancelled { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Cancelling { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Failed { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus NotStarted { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus PartiallyCompleted { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Running { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Succeeded { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.JobStatus 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.Language.Conversations.Authoring.Models.JobStatus left, Azure.AI.Language.Conversations.Authoring.Models.JobStatus right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.JobStatus (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.JobStatus left, Azure.AI.Language.Conversations.Authoring.Models.JobStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LoadSnapshotJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LoadSnapshotJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OrchestrationExportedIntent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OrchestrationExportedIntent(string category) { } + public string Category { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails Orchestration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedIntent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedIntent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OrchestrationExportedProjectAssets : Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OrchestrationExportedProjectAssets() { } + public System.Collections.Generic.IList Intents { get { throw null; } } + public System.Collections.Generic.IList Utterances { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OrchestrationExportedUtterance : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OrchestrationExportedUtterance(string text, string intent) { } + public string Dataset { get { throw null; } set { } } + public string Intent { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Text { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedUtterance System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedUtterance System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrebuiltEntities : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PrebuiltEntities() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntities System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntities System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PrebuiltEntity() { } + public string Category { get { throw null; } } + public string Description { get { throw null; } } + public string Examples { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeletionJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeletionJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeployment() { } + public System.Collections.Generic.IReadOnlyList AssignedResources { get { throw null; } } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProjectKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProjectKind(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectKind Conversation { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectKind CustomConversationSummarization { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectKind Orchestration { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind 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.Language.Conversations.Authoring.Models.ProjectKind left, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.ProjectKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind left, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProjectMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectMetadata() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public string Description { get { throw null; } } + public string Language { get { throw null; } } + public System.DateTimeOffset? LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastModifiedDateTime { get { throw null; } } + public System.DateTimeOffset? LastTrainedDateTime { get { throw null; } } + public bool? Multilingual { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings Settings { get { throw null; } } + public string StorageInputContainerName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectSettings(float confidenceThreshold) { } + public float ConfidenceThreshold { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectTrainedModel() { } + public bool HasSnapshot { get { throw null; } } + public string Label { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public int LastTrainingDurationInSeconds { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceMetadata(string azureResourceId, string customDomain, string region) { } + public string AzureResourceId { get { throw null; } } + public string CustomDomain { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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.Language.Conversations.Authoring.Models.StringIndexType Utf16CodeUnit { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.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.Language.Conversations.Authoring.Models.StringIndexType left, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.StringIndexType (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.StringIndexType left, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubTrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SubTrainingJobState() { } + public System.DateTimeOffset? EndDateTime { get { throw null; } } + public int PercentComplete { get { throw null; } } + public System.DateTimeOffset? StartDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SupportedLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SupportedLanguage() { } + public string LanguageCode { get { throw null; } } + public string LanguageName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SupportedLanguages : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SupportedLanguages() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguages System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguages System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) { } + public string FirstDeploymentName { get { throw null; } } + public string SecondDeploymentName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SwapDeploymentsJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingConfigVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingConfigVersion() { } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string TrainingConfigVersionProperty { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingConfigVersions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingConfigVersions() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TrainingJobDetails(string modelLabel, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode trainingMode) { } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } set { } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.TrainingMode TrainingMode { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobResult() { } + public System.DateTimeOffset? EstimatedEndDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState EvaluationStatus { get { throw null; } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.TrainingMode? TrainingMode { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState TrainingStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult Result { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TrainingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TrainingMode(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingMode Advanced { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingMode Standard { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode 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.Language.Conversations.Authoring.Models.TrainingMode left, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.TrainingMode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode left, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UnassignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UnassignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable assignedResourceIds) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceEntitiesEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceEntitiesEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedEntities { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedEntities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceEntityEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceEntityEvaluationResult() { } + public string Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntityEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntityEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceEvaluationResult() { } + public Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult EntitiesResult { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult IntentsResult { get { throw null; } } + public string Language { get { throw null; } } + public string Text { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceIntentsEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceIntentsEvaluationResult() { } + public string ExpectedIntent { get { throw null; } } + public string PredictedIntent { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.netstandard2.0.cs new file mode 100644 index 000000000000..dacd057d6a27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/api/Azure.AI.Language.Conversations.Authoring.netstandard2.0.cs @@ -0,0 +1,1571 @@ +namespace Azure.AI.Language.Conversations.Authoring +{ + public partial class AnalyzeConversationAuthoring + { + protected AnalyzeConversationAuthoring() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> CopyProjectAuthorizationAsync(string projectName, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAuthorizationAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CreateProject(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateProjectAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeployment(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteProject(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssignedResourceDeployments(int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAssignedResourceDeployments(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAssignedResourceDeploymentsAsync(int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignedResourceDeploymentsAsync(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetCopyProjectStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetCopyProjectStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentAsync(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentAsync(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelAsync(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelAsync(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetImportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetImportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectAsync(string projectName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectDeletionStatusAsync(string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectDeletionStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSupportedLanguages(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSupportedLanguages(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> GetSupportedLanguagesAsync(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSupportedLanguagesAsync(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetSupportedPrebuiltEntities(string language, string multilingual, int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetSupportedPrebuiltEntities(string language = null, string multilingual = null, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSupportedPrebuiltEntitiesAsync(string language, string multilingual, int? top, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetSupportedPrebuiltEntitiesAsync(string language = null, string multilingual = null, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingConfigVersions(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingConfigVersions(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainingConfigVersionsAsync(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainingConfigVersionsAsync(string projectKind, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainingStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainingStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.ExportedProject body, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string exportedProjectFormat = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.ExportedProject body, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat? exportedProjectFormat = default(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string exportedProjectFormat = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation LoadSnapshot(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task LoadSnapshotAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class AuthoringClient + { + protected AuthoringClient() { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions options) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.AI.Language.Conversations.Authoring.AnalyzeConversationAuthoring GetAnalyzeConversationAuthoringClient(string apiVersion = "2024-11-15-preview") { throw null; } + } + public partial class AuthoringClientOptions : Azure.Core.ClientOptions + { + public AuthoringClientOptions(Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Conversations.Authoring.AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview) { } + public enum ServiceVersion + { + V2023_04_01 = 1, + V2023_04_15_Preview = 2, + V2024_11_15_Preview = 3, + } + } + public static partial class ConversationsAuthoringClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } + public static partial class ConversationsAuthoringModelFactory + { + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, System.Collections.Generic.IEnumerable deploymentsMetadata = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AssignedResourceDeploymentsMetadata AssignedResourceDeploymentsMetadata(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsError AuthoringConversationsError(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode code = default(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode), string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsWarning AuthoringConversationsWarning(string code = null, string message = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix ConfusionMatrix(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = 0f, float rawValue = 0f) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixRow ConfusionMatrixRow(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedEntity ConversationExportedEntity(string category = null, Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting? compositionSetting = default(Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting?), Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList list = null, System.Collections.Generic.IEnumerable prebuilts = null, Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex regex = null, System.Collections.Generic.IEnumerable requiredComponents = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedUtterance ConversationExportedUtterance(System.Collections.Generic.IEnumerable entities = null, string text = null, string language = null, string intent = null, string dataset = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CopyProjectJobState CopyProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, System.Collections.Generic.IEnumerable assignedResourceIds = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails CreateProjectDetails(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind), Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentJobState DeploymentJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentResource DeploymentResource(string resourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.DeploymentResourcesJobState DeploymentResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary EntitiesEvaluationSummary(Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary entities = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EntityEvaluationSummary EntityEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult EvaluationJobResult(Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobState EvaluationJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult result = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationSummary EvaluationSummary(Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary entitiesEvaluation = null, Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary intentsEvaluation = null, Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails evaluationOptions = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestrationDetails ExportedConversationOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration conversationOrchestration = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration ExportedLuisOrchestration(System.Guid appId = default(System.Guid), string appVersion = null, string slotName = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestrationDetails ExportedLuisOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration luisOrchestration = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedModelJobState ExportedModelJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedProject ExportedProject(string projectFileVersion = null, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType = default(Azure.AI.Language.Conversations.Authoring.Models.StringIndexType), Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails metadata = null, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets assets = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestrationDetails ExportedQuestionAnsweringOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastExportedModelDateTime = default(System.DateTimeOffset), System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportProjectJobState ExportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, string resultUrl = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ImportProjectJobState ImportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel InnerErrorModel(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode code = default(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode), string message = null, System.Collections.Generic.IReadOnlyDictionary details = null, string target = null, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.IntentEvaluationSummary IntentEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary IntentsEvaluationSummary(Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary intents = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedIntent OrchestrationExportedIntent(Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails orchestration = null, string category = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedUtterance OrchestrationExportedUtterance(string text = null, string language = null, string intent = null, string dataset = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntities PrebuiltEntities(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, System.Collections.Generic.IEnumerable assignedResources = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectMetadata ProjectMetadata(System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? lastTrainedDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastDeployedDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind), Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), int lastTrainingDurationInSeconds = 0, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, bool hasSnapshot = false) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState SubTrainingJobState(int percentComplete = 0, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguages SupportedLanguages(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersions TrainingConfigVersions(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode trainingMode = default(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode), Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails evaluationOptions = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode? trainingMode = default(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode?), Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState trainingStatus = null, Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState evaluationStatus = null, System.DateTimeOffset? estimatedEndDateTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingJobState TrainingJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Conversations.Authoring.Models.JobStatus status = default(Azure.AI.Language.Conversations.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult result = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult UtteranceEntitiesEvaluationResult(System.Collections.Generic.IEnumerable expectedEntities = null, System.Collections.Generic.IEnumerable predictedEntities = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntityEvaluationResult UtteranceEntityEvaluationResult(string category = null, int offset = 0, int length = 0) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceEvaluationResult UtteranceEvaluationResult(string text = null, string language = null, Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult entitiesResult = null, Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult intentsResult = null) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult UtteranceIntentsEvaluationResult(string expectedIntent = null, string predictedIntent = null) { throw null; } + } +} +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable resourcesMetadata) { } + public System.Collections.Generic.IList ResourcesMetadata { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedDeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedDeploymentResource() { } + public string AzureResourceId { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentMetadata() { } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentsMetadata() { } + public System.Collections.Generic.IReadOnlyList DeploymentsMetadata { get { throw null; } } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedResourceDeploymentsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedResourceDeploymentsMetadata() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedResourceDeploymentsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AssignedResourceDeploymentsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AuthoringConversationsError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AuthoringConversationsError() { } + public Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AuthoringConversationsWarning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AuthoringConversationsWarning() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsWarning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.AuthoringConversationsWarning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CompositionSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CompositionSetting(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting CombineComponents { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting RequireExactOverlap { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting ReturnLongestOverlap { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting SeparateComponents { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting 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.Language.Conversations.Authoring.Models.CompositionSetting left, Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting left, Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConfusionMatrix : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrix() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixCell : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixCell() { } + public float NormalizedValue { get { throw null; } } + public float RawValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixRow : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixRow() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedEntity(string category) { } + public string Category { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.CompositionSetting? CompositionSetting { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList List { get { throw null; } set { } } + public System.Collections.Generic.IList Prebuilts { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex Regex { get { throw null; } set { } } + public System.Collections.Generic.IList RequiredComponents { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedIntent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedIntent(string category) { } + public string Category { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedIntent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedIntent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedProjectAssets : Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedProjectAssets() { } + public System.Collections.Generic.IList Entities { get { throw null; } } + public System.Collections.Generic.IList Intents { get { throw null; } } + public System.Collections.Generic.IList Utterances { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConversationExportedUtterance : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConversationExportedUtterance(string text, string intent) { } + public string Dataset { get { throw null; } set { } } + public System.Collections.Generic.IList Entities { get { throw null; } } + public string Intent { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Text { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedUtterance System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ConversationExportedUtterance System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyProjectDetails(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string targetProjectName, string accessToken, System.DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) { } + public string AccessToken { get { throw null; } set { } } + public System.DateTimeOffset ExpiresAt { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectKind ProjectKind { get { throw null; } set { } } + public string TargetProjectName { get { throw null; } set { } } + public string TargetResourceId { get { throw null; } set { } } + public string TargetResourceRegion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CopyProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateDeploymentDetails(string trainedModelLabel) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateProjectDetails(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind projectKind, string projectName, string language) { } + public string Description { get { throw null; } set { } } + public string Language { get { throw null; } } + public bool? Multilingual { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings Settings { get { throw null; } set { } } + public string StorageInputContainerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeleteDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeleteDeploymentDetails() { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentDeleteFromResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentDeleteFromResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentResource() { } + public string Region { get { throw null; } } + public string ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.DeploymentResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntitiesEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntitiesEvaluationSummary() { } + public Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Entities { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntityEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntityEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ErrorCode(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchIndexLimitReached { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchIndexNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Conflict { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Forbidden { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode InternalServerError { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode InvalidArgument { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode NotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode OperationNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode ProjectNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode QuotaExceeded { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode ServiceUnavailable { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Timeout { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode TooManyRequests { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Unauthorized { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ErrorCode Warning { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode 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.Language.Conversations.Authoring.Models.ErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.ErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.ErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.ErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.ErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EvaluationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EvaluationDetails() { } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind? Kind { get { throw null; } set { } } + public int? TestingSplitPercentage { get { throw null; } set { } } + public int? TrainingSplitPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobResult() { } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + public string ModelLabel { get { throw null; } } + public int PercentComplete { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobResult Result { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EvaluationKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EvaluationKind(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind Manual { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind Percentage { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind 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.Language.Conversations.Authoring.Models.EvaluationKind left, Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind left, Azure.AI.Language.Conversations.Authoring.Models.EvaluationKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationSummary() { } + public Azure.AI.Language.Conversations.Authoring.Models.EntitiesEvaluationSummary EntitiesEvaluation { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary IntentsEvaluation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedConversationOrchestration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedConversationOrchestration(string projectName, string deploymentName) { } + public string DeploymentName { get { throw null; } } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedConversationOrchestrationDetails : Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedConversationOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration conversationOrchestration) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestration ConversationOrchestration { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedConversationOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityList : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityList() { } + public System.Collections.Generic.IList Sublists { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityListSynonym : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityListSynonym() { } + public string Language { get { throw null; } set { } } + public System.Collections.Generic.IList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityRegex : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityRegex() { } + public System.Collections.Generic.IList Expressions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegex System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityRegexExpression : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityRegexExpression() { } + public string Language { get { throw null; } set { } } + public string RegexKey { get { throw null; } set { } } + public string RegexPattern { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegexExpression System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntityRegexExpression System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntitySublist : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntitySublist() { } + public string ListKey { get { throw null; } set { } } + public System.Collections.Generic.IList Synonyms { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedLuisOrchestration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedLuisOrchestration(System.Guid appId) { } + public System.Guid AppId { get { throw null; } } + public string AppVersion { get { throw null; } set { } } + public string SlotName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedLuisOrchestrationDetails : Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedLuisOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration luisOrchestration) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestration LuisOrchestration { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedLuisOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedModelDetails(string trainedModelLabel) { } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedModelJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ExportedOrchestrationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ExportedOrchestrationDetails() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedPrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedPrebuiltEntity(string category) { } + public string Category { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedProject : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedProject(string projectFileVersion, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails metadata) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets Assets { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.CreateProjectDetails Metadata { get { throw null; } } + public string ProjectFileVersion { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.StringIndexType StringIndexType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ExportedProjectAssets : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ExportedProjectAssets() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ExportedProjectFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ExportedProjectFormat(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat Conversation { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat Luis { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat 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.Language.Conversations.Authoring.Models.ExportedProjectFormat left, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat left, Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectFormat right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ExportedQuestionAnsweringOrchestration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedQuestionAnsweringOrchestration(string projectName) { } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedQuestionAnsweringOrchestrationDetails : Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedQuestionAnsweringOrchestrationDetails(Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) { } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestration QuestionAnsweringOrchestration { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedQuestionAnsweringOrchestrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedTrainedModel() { } + public string ExportedModelName { get { throw null; } } + public System.DateTimeOffset LastExportedModelDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedUtteranceEntityLabel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedUtteranceEntityLabel(string category, int offset, int length) { } + public string Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedUtteranceEntityLabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportedUtteranceEntityLabel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public string ResultUrl { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct InnerErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InnerErrorCode(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode EmptyRequest { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode ExtractionFailure { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidCountryHint { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidDocument { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidDocumentBatch { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidParameterValue { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode InvalidRequestBodyFormat { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode KnowledgeBaseNotFound { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode MissingInputDocuments { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode ModelVersionIncorrect { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode UnsupportedLanguageCode { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode 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.Language.Conversations.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InnerErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InnerErrorModel() { } + public Azure.AI.Language.Conversations.Authoring.Models.InnerErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Details { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IntentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IntentEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IntentsEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IntentsEvaluationSummary() { } + public Azure.AI.Language.Conversations.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Intents { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.IntentsEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobStatus(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Cancelled { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Cancelling { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Failed { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus NotStarted { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus PartiallyCompleted { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Running { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.JobStatus Succeeded { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.JobStatus 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.Language.Conversations.Authoring.Models.JobStatus left, Azure.AI.Language.Conversations.Authoring.Models.JobStatus right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.JobStatus (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.JobStatus left, Azure.AI.Language.Conversations.Authoring.Models.JobStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LoadSnapshotJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LoadSnapshotJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OrchestrationExportedIntent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OrchestrationExportedIntent(string category) { } + public string Category { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ExportedOrchestrationDetails Orchestration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedIntent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedIntent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OrchestrationExportedProjectAssets : Azure.AI.Language.Conversations.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OrchestrationExportedProjectAssets() { } + public System.Collections.Generic.IList Intents { get { throw null; } } + public System.Collections.Generic.IList Utterances { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OrchestrationExportedUtterance : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OrchestrationExportedUtterance(string text, string intent) { } + public string Dataset { get { throw null; } set { } } + public string Intent { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Text { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedUtterance System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.OrchestrationExportedUtterance System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrebuiltEntities : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PrebuiltEntities() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntities System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntities System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PrebuiltEntity() { } + public string Category { get { throw null; } } + public string Description { get { throw null; } } + public string Examples { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeletionJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeletionJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeployment() { } + public System.Collections.Generic.IReadOnlyList AssignedResources { get { throw null; } } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProjectKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProjectKind(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectKind Conversation { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectKind CustomConversationSummarization { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.ProjectKind Orchestration { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind 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.Language.Conversations.Authoring.Models.ProjectKind left, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.ProjectKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.ProjectKind left, Azure.AI.Language.Conversations.Authoring.Models.ProjectKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProjectMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectMetadata() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public string Description { get { throw null; } } + public string Language { get { throw null; } } + public System.DateTimeOffset? LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastModifiedDateTime { get { throw null; } } + public System.DateTimeOffset? LastTrainedDateTime { get { throw null; } } + public bool? Multilingual { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings Settings { get { throw null; } } + public string StorageInputContainerName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectSettings(float confidenceThreshold) { } + public float ConfidenceThreshold { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectTrainedModel() { } + public bool HasSnapshot { get { throw null; } } + public string Label { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public int LastTrainingDurationInSeconds { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceMetadata(string azureResourceId, string customDomain, string region) { } + public string AzureResourceId { get { throw null; } } + public string CustomDomain { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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.Language.Conversations.Authoring.Models.StringIndexType Utf16CodeUnit { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.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.Language.Conversations.Authoring.Models.StringIndexType left, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.StringIndexType (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.StringIndexType left, Azure.AI.Language.Conversations.Authoring.Models.StringIndexType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubTrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SubTrainingJobState() { } + public System.DateTimeOffset? EndDateTime { get { throw null; } } + public int PercentComplete { get { throw null; } } + public System.DateTimeOffset? StartDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SupportedLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SupportedLanguage() { } + public string LanguageCode { get { throw null; } } + public string LanguageName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SupportedLanguages : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SupportedLanguages() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguages System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SupportedLanguages System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) { } + public string FirstDeploymentName { get { throw null; } } + public string SecondDeploymentName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SwapDeploymentsJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingConfigVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingConfigVersion() { } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string TrainingConfigVersionProperty { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingConfigVersions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingConfigVersions() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingConfigVersions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TrainingJobDetails(string modelLabel, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode trainingMode) { } + public Azure.AI.Language.Conversations.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } set { } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } set { } } + public Azure.AI.Language.Conversations.Authoring.Models.TrainingMode TrainingMode { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobResult() { } + public System.DateTimeOffset? EstimatedEndDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState EvaluationStatus { get { throw null; } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.TrainingMode? TrainingMode { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.SubTrainingJobState TrainingStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.TrainingJobResult Result { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TrainingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TrainingMode(string value) { throw null; } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingMode Advanced { get { throw null; } } + public static Azure.AI.Language.Conversations.Authoring.Models.TrainingMode Standard { get { throw null; } } + public bool Equals(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode 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.Language.Conversations.Authoring.Models.TrainingMode left, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode right) { throw null; } + public static implicit operator Azure.AI.Language.Conversations.Authoring.Models.TrainingMode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Conversations.Authoring.Models.TrainingMode left, Azure.AI.Language.Conversations.Authoring.Models.TrainingMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UnassignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UnassignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable assignedResourceIds) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceEntitiesEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceEntitiesEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedEntities { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedEntities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceEntityEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceEntityEvaluationResult() { } + public string Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntityEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntityEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceEvaluationResult() { } + public Azure.AI.Language.Conversations.Authoring.Models.UtteranceEntitiesEvaluationResult EntitiesResult { get { throw null; } } + public Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult IntentsResult { get { throw null; } } + public string Language { get { throw null; } } + public string Text { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UtteranceIntentsEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UtteranceIntentsEvaluationResult() { } + public string ExpectedIntent { get { throw null; } } + public string PredictedIntent { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Conversations.Authoring.Models.UtteranceIntentsEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/README.md new file mode 100644 index 000000000000..00c190b4e107 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/README.md @@ -0,0 +1,42 @@ +--- +page_type: sample +languages: +- csharp +products: +- azure +name: Azure.AI.Language.Conversations.Authoring samples for .NET +description: Samples for the Azure.AI.Language.Conversations.Authoring client library. +--- + +# Azure.AI.Language.Conversations.Authoring Samples + +Azure Conversations Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that enables creating, managing, and deploying conversational AI solutions. This client library provides the following features: + +## Common Scenarios Samples + +* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProjectAsync.md) +* [Import a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_Import.md) +* [Import a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_ImportAsync.md) +* [Export a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_Export.md) +* [Export a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_ExportAsync.md) +* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.md) +* [Get Model Evaluation Results (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.md) +* [Get Model Evaluation Results (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.md) +* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.md) +* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.md) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshot.md new file mode 100644 index 000000000000..6d3b5f8d075f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshot.md @@ -0,0 +1,35 @@ +# Loading a Snapshot in Azure AI Language + +This sample demonstrates how to load a snapshot for a trained model using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Load a Snapshot + +To load a snapshot for a specific trained model, call LoadSnapshot on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample10_ConversationsAuthoring_LoadSnapshot +Operation operation = authoringClient.LoadSnapshot( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Snapshot loaded with operation status: {operation.GetRawResponse().Status}"); +``` + +To load a snapshot, call LoadSnapshot on the AnalyzeConversationAuthoring client. This method initiates the snapshot loading process and provides an operation response that includes the status and metadata about the operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.md new file mode 100644 index 000000000000..f6d2675d1f1b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.md @@ -0,0 +1,35 @@ +# Loading a Snapshot Asynchronously in Azure AI Language + +This sample demonstrates how to load a snapshot for a trained model asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Load a Snapshot Asynchronously + +To load a snapshot for a specific trained model, call LoadSnapshotAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample10_ConversationsAuthoring_LoadSnapshotAsync +Operation operation = await authoringClient.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Snapshot loaded with operation status: {operation.GetRawResponse().Status}"); +``` + +To load a snapshot asynchronously, call LoadSnapshotAsync on the AnalyzeConversationAuthoring client. This method initiates the snapshot loading process and provides an operation response that includes the status and metadata about the operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.md new file mode 100644 index 000000000000..c526d065b302 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.md @@ -0,0 +1,30 @@ +# Deleting a Trained Model in Azure AI Language + +This sample demonstrates how to delete a trained model using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Delete a Trained Model + +To delete a trained model, call DeleteTrainedModel on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample11_ConversationsAuthoring_DeleteTrainedModel +Response response = authoringClient.DeleteTrainedModel( + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +Console.WriteLine($"Delete Trained Model Response Status: {response.Status}"); +``` + +To delete a trained model, use the DeleteTrainedModel method on the AnalyzeConversationAuthoring client. A successful response will typically return a 204 (No Content) status, indicating the deletion was completed successfully. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.md new file mode 100644 index 000000000000..22c6688536e7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.md @@ -0,0 +1,29 @@ +# Deleting a Trained Model Asynchronously in Azure AI Language + +This sample demonstrates how to delete a trained model asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` +## Delete a Trained Model + +To delete a trained model asynchronously, call DeleteTrainedModelAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample11_ConversationsAuthoring_DeleteTrainedModelAsync +Response response = await authoringClient.DeleteTrainedModelAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +Console.WriteLine($"Delete Trained Model Async Response Status: {response.Status}"); +``` + +To delete a trained model asynchronously, use the DeleteTrainedModelAsync method on the AnalyzeConversationAuthoring client. A successful response will typically return a 204 (No Content) status, indicating the deletion was completed successfully. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeployments.md new file mode 100644 index 000000000000..2dfc8de81876 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeployments.md @@ -0,0 +1,34 @@ +# Swapping Deployments in Azure AI Language + +This sample demonstrates how to swap two deployments using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Swap Deployments + +To swap two deployments, call SwapDeployments on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample14_ConversationsAuthoring_SwapDeployments +Operation operation = authoringClient.SwapDeployments( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails +); + +// Extract operation-location from response headers +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; +Console.WriteLine($"Swap operation-location: {operationLocation}"); +Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); +``` + +Swapping deployments allows you to interchange the roles of two deployment environments (e.g., production and staging) to facilitate smooth transitions and testing in production-like environments. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.md new file mode 100644 index 000000000000..ad635e169c0c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.md @@ -0,0 +1,34 @@ +# Swapping Deployments Asynchronously in Azure AI Language + +This sample demonstrates how to asynchronously swap two deployments using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Swap Deployments Asynchronously + +To swap two deployments asynchronously, call SwapDeploymentsAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample14_ConversationsAuthoring_SwapDeploymentsAsync +Operation operation = await authoringClient.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails +); + +// Extract operation-location from response headers +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; +Console.WriteLine($"Swap operation-location: {operationLocation}"); +Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); +``` + +Asynchronously swapping deployments allows for a seamless interchange of roles between deployment environments (e.g., production and staging), enabling smooth transitions and minimizing downtime during deployment updates. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeployment.md new file mode 100644 index 000000000000..17889ea86875 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeployment.md @@ -0,0 +1,34 @@ +# Deleting a Deployment in Azure AI Language + +This sample demonstrates how to delete a deployment in a project using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Delete a Deployment + +To delete a deployment, call DeleteDeployment on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample13_ConversationsAuthoring_DeleteDeployment +Operation operation = authoringClient.DeleteDeployment( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName +); + +// Extract operation-location from response headers +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; +Console.WriteLine($"Delete operation-location: {operationLocation}"); +Console.WriteLine($"Delete operation completed with status: {operation.GetRawResponse().Status}"); +``` + +Deleting a deployment removes it from the specified project and ensures that resources associated with the deployment are released. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.md new file mode 100644 index 000000000000..709269c3fe74 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.md @@ -0,0 +1,34 @@ +# Deleting a Deployment Asynchronously in Azure AI Language + +This sample demonstrates how to delete a deployment asynchronously in a project using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Delete a Deployment Asynchronously + +To delete a deployment, call DeleteDeploymentAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample13_ConversationsAuthoring_DeleteDeploymentAsync +Operation operation = await authoringClient.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName +); + +// Extract operation-location from response headers +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; +Console.WriteLine($"Delete operation-location: {operationLocation}"); +Console.WriteLine($"Delete operation completed with status: {operation.GetRawResponse().Status}"); +``` + +Deleting a deployment asynchronously allows for non-blocking operations and ensures resources associated with the deployment are released efficiently. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProject.md new file mode 100644 index 000000000000..dd7616b393e3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProject.md @@ -0,0 +1,40 @@ +# Creating a New Project in Azure AI Language (Synchronous) + +This sample demonstrates how to create a new project synchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. You can define the project's properties, such as name, language, kind, and description. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the `endpoint` and apiKey variables can be retrieved from: Environment variables, configuration settings, or any other secure approach that works for your application. + +## Create a New Project + +To create a new project synchronously, call CreateProject on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample1_ConversationsAuthoring_CreateProject +string projectName = "MyNewProject"; +var projectData = new +{ + projectName = projectName, + language = "en", + projectKind = "Conversation", + description = "Project description", + multilingual = true +}; + +using RequestContent content = RequestContent.Create(projectData); +Response response = authoringClient.CreateProject(projectName, content); + +Console.WriteLine($"Project created with status: {response.Status}"); +``` + +To create a project, call CreateProject on the AnalyzeConversationAuthoring client, which returns a Response object containing the status of the creation request. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProjectAsync.md new file mode 100644 index 000000000000..ded138cf0fb3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample1_ConversationsAuthoring_CreateProjectAsync.md @@ -0,0 +1,40 @@ +# Creating a New Project in Azure AI Language + +This sample demonstrates how to create a new project using the `Azure.AI.Language.Conversations.Authoring` SDK. You can define the project's properties, such as name, language, kind, and description. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the `endpoint` and `apiKey` variables can be retrieved from: Environment variables, configuration settings, or any other secure approach that works for your application. + +## Create a New Project + +To create a new project, call `CreateProjectAsync` on the `AnalyzeConversationAuthoring` client. + +```C# Snippet:Sample1_ConversationsAuthoring_CreateProjectAsync +string projectName = "MyNewProjectAsync"; +var projectData = new +{ + projectName = projectName, + language = "en", + projectKind = "Conversation", + description = "Project description", + multilingual = true +}; + +using RequestContent content = RequestContent.Create(projectData); +Response response = await authoringClient.CreateProjectAsync(projectName, content); + +Console.WriteLine($"Project created with status: {response.Status}"); +``` + +To create a project, call `CreateProjectAsync` on the `AnalyzeConversationAuthoring` client, which returns a `Response` object containing the status of the creation request. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_Import.md new file mode 100644 index 000000000000..bb3c2c814021 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_Import.md @@ -0,0 +1,91 @@ +# Importing a Project in Azure AI Language (Synchronous) + +This sample demonstrates how to import a project synchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. You can define the project's metadata and assets before importing it into the service. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your-api-key"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from: Environment variables, configuration settings, or any other secure approach that works for your application. + +## Import a New Project + +To import a project synchronously, call Import on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample2_ConversationsAuthoring_Import +string projectName = "MyImportedProject"; + +var projectMetadata = new CreateProjectDetails( + projectKind: "Conversation", + projectName: projectName, + language: "en" +) +{ + Settings = new ProjectSettings(0.7F), + Multilingual = true, + Description = "Trying out CLU with assets" +}; + +var projectAssets = new ConversationExportedProjectAssets(); + +projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent1" )); +projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent2" )); + +projectAssets.Entities.Add(new ConversationExportedEntity ( category : "entity1" )); + +projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text1", + intent: "intent1" +) +{ + Language = "en", + Dataset = "dataset1" +}); + +projectAssets.Utterances[projectAssets.Utterances.Count - 1].Entities.Add(new ExportedUtteranceEntityLabel( + category: "entity1", + offset: 5, + length: 5 +)); + +projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text2", + intent: "intent2" +) +{ + Language = "en", + Dataset = "dataset1" +}); + +var exportedProject = new ExportedProject( + projectFileVersion: "2023-10-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata +) +{ + Assets = projectAssets +}; + +Operation operation = authoringClient.Import( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject, + exportedProjectFormat: ExportedProjectFormat.Conversation +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project import completed with status: {operation.GetRawResponse().Status}"); +``` + +To import a project, call Import on the AnalyzeConversationAuthoring client. The method returns an Operation object, which you can use to track the status of the operation. The operation-location header contains the location of the operation for further tracking. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_ImportAsync.md new file mode 100644 index 000000000000..f202729c5140 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample2_ConversationsAuthoring_ImportAsync.md @@ -0,0 +1,91 @@ +# Importing a Project in Azure AI Language + +This sample demonstrates how to import a project using the `Azure.AI.Language.Conversations.Authoring` SDK. You can define the project's metadata and assets to import it into the system. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Import a Project + +To import a project, call ImportAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample2_ConversationsAuthoring_ImportAsync +string projectName = "MyImportedProjectAsync"; + +var projectMetadata = new CreateProjectDetails( + projectKind: "Conversation", + projectName: projectName, + language: "en" +) +{ + Settings = new ProjectSettings(0.7F), + Multilingual = true, + Description = "Trying out CLU with assets" +}; + +var projectAssets = new ConversationExportedProjectAssets(); + +projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent1" )); +projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent2" )); + +projectAssets.Entities.Add(new ConversationExportedEntity ( category : "entity1" )); + +projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text1", + intent: "intent1" +) +{ + Language = "en", + Dataset = "dataset1" +}); + +projectAssets.Utterances[projectAssets.Utterances.Count - 1].Entities.Add(new ExportedUtteranceEntityLabel( + category: "entity1", + offset: 5, + length: 5 +)); + +projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text2", + intent: "intent2" +) +{ + Language = "en", + Dataset = "dataset1" +}); + +var exportedProject = new ExportedProject( + projectFileVersion: "2023-10-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata +) +{ + Assets = projectAssets +}; + +Operation operation = await authoringClient.ImportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject, + exportedProjectFormat: ExportedProjectFormat.Conversation +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project import completed with status: {operation.GetRawResponse().Status}"); +``` + +To import a project, call ImportAsync on the AnalyzeConversationAuthoring client, which returns an Operation object that tracks the progress and completion of the import operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_Export.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_Export.md new file mode 100644 index 000000000000..00ef1e7d1ac4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_Export.md @@ -0,0 +1,40 @@ +# Exporting a Project in Azure AI Language + +This sample demonstrates how to export a project using the `Azure.AI.Language.Conversations.Authoring` SDK. You can specify the project's name and export format to retrieve the project data. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Export a Project + +To export a project, call Export on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample3_ConversationsAuthoring_Export +string projectName = "MyExportedProject"; + +Operation operation = authoringClient.Export( + waitUntil: WaitUntil.Completed, + projectName: projectName, + stringIndexType: StringIndexType.Utf16CodeUnit, + exportedProjectFormat: ExportedProjectFormat.Conversation +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); +``` + +To export a project, call Export on the AnalyzeConversationAuthoring client, which returns an Operation object that tracks the progress and completion of the export operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_ExportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_ExportAsync.md new file mode 100644 index 000000000000..0d7f437ef75e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample3_ConversationsAuthoring_ExportAsync.md @@ -0,0 +1,40 @@ +# Exporting a Project Asynchronously in Azure AI Language + +This sample demonstrates how to export a project asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. You can specify the project's name and export format to retrieve the project data. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Export a Project Asynchronously + +To export a project asynchronously, call ExportAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample3_ConversationsAuthoring_ExportAsync +string projectName = "MyExportedProjectAsync"; + +Operation operation = await authoringClient.ExportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + stringIndexType: StringIndexType.Utf16CodeUnit, + exportedProjectFormat: ExportedProjectFormat.Conversation +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); +``` + +To export a project asynchronously, call ExportAsync on the AnalyzeConversationAuthoring client, which returns an Operation object that tracks the progress and completion of the export operation. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProject.md new file mode 100644 index 000000000000..a0c709b38565 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProject.md @@ -0,0 +1,40 @@ +# Retrieving Project Metadata in Azure AI Language + +This sample demonstrates how to retrieve metadata of a project using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Retrieve Project Metadata + +To retrieve metadata of a project, call GetProject on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample4_ConversationsAuthoring_GetProject +string projectName = "MySampleProject"; + +Response response = authoringClient.GetProject(projectName); +ProjectMetadata projectMetadata = response.Value; + +Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); +Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); +Console.WriteLine($"Last Trained DateTime: {projectMetadata.LastTrainedDateTime}"); +Console.WriteLine($"Last Deployed DateTime: {projectMetadata.LastDeployedDateTime}"); +Console.WriteLine($"Project Kind: {projectMetadata.ProjectKind}"); +Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); +Console.WriteLine($"Multilingual: {projectMetadata.Multilingual}"); +Console.WriteLine($"Description: {projectMetadata.Description}"); +Console.WriteLine($"Language: {projectMetadata.Language}"); +``` + +To retrieve project metadata, call GetProject on the AnalyzeConversationAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProjectAsync.md new file mode 100644 index 000000000000..cbccc89c7e37 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample4_ConversationsAuthoring_GetProjectAsync.md @@ -0,0 +1,40 @@ +# Retrieving Project Metadata Asynchronously in Azure AI Language + +This sample demonstrates how to retrieve metadata of a project asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Retrieve Project Metadata Asynchronously + +To retrieve metadata of a project, call GetProjectAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample4_ConversationsAuthoring_GetProjectAsync +string projectName = "MySampleProjectAsync"; + +Response response = await authoringClient.GetProjectAsync(projectName); +ProjectMetadata projectMetadata = response.Value; + +Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); +Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); +Console.WriteLine($"Last Trained DateTime: {projectMetadata.LastTrainedDateTime}"); +Console.WriteLine($"Last Deployed DateTime: {projectMetadata.LastDeployedDateTime}"); +Console.WriteLine($"Project Kind: {projectMetadata.ProjectKind}"); +Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); +Console.WriteLine($"Multilingual: {projectMetadata.Multilingual}"); +Console.WriteLine($"Description: {projectMetadata.Description}"); +Console.WriteLine($"Language: {projectMetadata.Language}"); +``` + +To retrieve project metadata asynchronously, call GetProjectAsync on the AnalyzeConversationAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProject.md new file mode 100644 index 000000000000..993ec7332a67 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProject.md @@ -0,0 +1,38 @@ +# Deleting a Project in Azure AI Language + +This sample demonstrates how to delete a project using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Delete a Project + +To delete a project, call DeleteProject on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample5_ConversationsAuthoring_DeleteProject +string projectName = "MySampleProject"; + +Operation operation = authoringClient.DeleteProject( + waitUntil: WaitUntil.Completed, + projectName: projectName +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a project, call DeleteProject on the AnalyzeConversationAuthoring client. The method returns an Operation object containing the status of the deletion request, and the operation-location header can be used to track the deletion process. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.md new file mode 100644 index 000000000000..c13380b160ae --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.md @@ -0,0 +1,38 @@ +# Deleting a Project in Azure AI Language Asynchronously + +This sample demonstrates how to delete a project asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Delete a Project Asynchronously + +To delete a project, call DeleteProjectAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample5_ConversationsAuthoring_DeleteProjectAsync +string projectName = "MySampleProjectAsync"; + +Operation operation = await authoringClient.DeleteProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a project, call DeleteProjectAsync on the AnalyzeConversationAuthoring client. The method returns an Operation object containing the status of the deletion request, and the operation-location header can be used to track the deletion process. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_Train.md new file mode 100644 index 000000000000..4d1727c4e85a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_Train.md @@ -0,0 +1,53 @@ +# Training a Model in Azure AI Language + +This sample demonstrates how to train a model using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Train a Model + +To train a model, call Train on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample6_ConversationsAuthoring_Train +string projectName = "MySampleProject"; + +var trainingJobDetails = new TrainingJobDetails( + modelLabel: "MyModel", + trainingMode: TrainingMode.Standard +) +{ + TrainingConfigVersion = "1.0", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } +}; + +Operation operation = authoringClient.Train( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); +``` + +To train a model, call Train on the AnalyzeConversationAuthoring client. The method returns an Operation object containing the status of the training job, and the operation-location header can be used to track the training process. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_TrainAsync.md new file mode 100644 index 000000000000..351692d72343 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample6_ConversationsAuthoring_TrainAsync.md @@ -0,0 +1,53 @@ +# Training a Model in Azure AI Language Asynchronously + +This sample demonstrates how to train a model asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Train a Model Asynchronously + +To train a model asynchronously, call TrainAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample6_ConversationsAuthoring_TrainAsync +string projectName = "MySampleProjectAsync"; + +var trainingJobDetails = new TrainingJobDetails( + modelLabel: "MyModel", + trainingMode: TrainingMode.Standard +) +{ + TrainingConfigVersion = "1.0", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } +}; + +Operation operation = await authoringClient.TrainAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails +); + + // Extract the operation-location header +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); +``` + +To train a model asynchronously, call TrainAsync on the AnalyzeConversationAuthoring client. The method returns an Operation object containing the status of the training job, and the operation-location header can be used to track the training process. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJob.md new file mode 100644 index 000000000000..560cc1f7ff9c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJob.md @@ -0,0 +1,40 @@ +# Cancelling a Training Job in Azure AI Language + +This sample demonstrates how to cancel a training job using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Cancel a Training Job + +To cancel a training job, call CancelTrainingJob on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample7_ConversationsAuthoring_CancelTrainingJob +string projectName = "MyProject"; +string jobId = "YourTrainingJobId"; + +Operation cancelOperation = authoringClient.CancelTrainingJob( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId +); + + // Extract the operation-location header +string operationLocation = cancelOperation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Training job cancellation completed with status: {cancelOperation.GetRawResponse().Status}"); +``` + +To cancel a training job, call CancelTrainingJob on the AnalyzeConversationAuthoring client. The method returns an Operation object, which contains the cancellation status, and the operation-location header can be used to track the cancellation process. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.md new file mode 100644 index 000000000000..3eebc35859ba --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.md @@ -0,0 +1,40 @@ +# Cancelling a Training Job Asynchronously in Azure AI Language + +This sample demonstrates how to asynchronously cancel a training job using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Cancel a Training Job Asynchronously + +To cancel a training job asynchronously, call CancelTrainingJobAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample7_ConversationsAuthoring_CancelTrainingJobAsync +string projectName = "MyProject"; +string jobId = "YourTrainingJobId"; + +Operation cancelOperation = await authoringClient.CancelTrainingJobAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId +); + + // Extract the operation-location header +string operationLocation = cancelOperation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); + +Console.WriteLine($"Training job cancellation completed with status: {cancelOperation.GetRawResponse().Status}"); +``` + +To cancel a training job asynchronously, call CancelTrainingJobAsync on the AnalyzeConversationAuthoring client. The method returns an Operation object, which contains the cancellation status, and the operation-location header can be used to track the cancellation process. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.md new file mode 100644 index 000000000000..104b6347d2f5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.md @@ -0,0 +1,59 @@ +# Retrieving Model Evaluation Summary in Azure AI Language + +This sample demonstrates how to retrieve a model evaluation summary for a specific trained model using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Get Model Evaluation Summary + +To retrieve a model evaluation summary, call GetModelEvaluationSummary on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample8_ConversationsAuthoring_GetModelEvaluationSummary +string projectName = "MyProject"; +string trainedModelLabel = "YourTrainedModelLabel"; + +Response evaluationSummaryResponse = authoringClient.GetModelEvaluationSummary( + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +// Print entities evaluation summary +var entitiesEval = evaluationSummaryResponse.Value.EntitiesEvaluation; +Console.WriteLine($"Entities - Micro F1: {entitiesEval.MicroF1}, Micro Precision: {entitiesEval.MicroPrecision}, Micro Recall: {entitiesEval.MicroRecall}"); +Console.WriteLine($"Entities - Macro F1: {entitiesEval.MacroF1}, Macro Precision: {entitiesEval.MacroPrecision}, Macro Recall: {entitiesEval.MacroRecall}"); + +// Print detailed metrics per entity +foreach (var entity in entitiesEval.Entities) +{ + Console.WriteLine($"Entity '{entity.Key}': F1 = {entity.Value.F1}, Precision = {entity.Value.Precision}, Recall = {entity.Value.Recall}"); + Console.WriteLine($" True Positives: {entity.Value.TruePositiveCount}, True Negatives: {entity.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {entity.Value.FalsePositiveCount}, False Negatives: {entity.Value.FalseNegativeCount}"); +} + +// Print intents evaluation summary +var intentsEval = evaluationSummaryResponse.Value.IntentsEvaluation; +Console.WriteLine($"Intents - Micro F1: {intentsEval.MicroF1}, Micro Precision: {intentsEval.MicroPrecision}, Micro Recall: {intentsEval.MicroRecall}"); +Console.WriteLine($"Intents - Macro F1: {intentsEval.MacroF1}, Macro Precision: {intentsEval.MacroPrecision}, Macro Recall: {intentsEval.MacroRecall}"); + +// Print detailed metrics per intent +foreach (var intent in intentsEval.Intents) +{ + Console.WriteLine($"Intent '{intent.Key}': F1 = {intent.Value.F1}, Precision = {intent.Value.Precision}, Recall = {intent.Value.Recall}"); + Console.WriteLine($" True Positives: {intent.Value.TruePositiveCount}, True Negatives: {intent.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {intent.Value.FalsePositiveCount}, False Negatives: {intent.Value.FalseNegativeCount}"); +} +``` + +To retrieve a model evaluation summary, call GetModelEvaluationSummary on the AnalyzeConversationAuthoring client, which returns a Response containing evaluation metrics for intents and entities. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.md new file mode 100644 index 000000000000..11567fdd0cfa --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.md @@ -0,0 +1,59 @@ +# Retrieving Model Evaluation Summary Asynchronously in Azure AI Language + +This sample demonstrates how to asynchronously retrieve a model evaluation summary for a specific trained model using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Get Model Evaluation Summary Asynchronously + +To asynchronously retrieve a model evaluation summary, call GetModelEvaluationSummaryAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync +string projectName = "MyProject"; +string trainedModelLabel = "YourTrainedModelLabel"; + +Response evaluationSummaryResponse = await authoringClient.GetModelEvaluationSummaryAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +// Print entities evaluation summary +var entitiesEval = evaluationSummaryResponse.Value.EntitiesEvaluation; +Console.WriteLine($"Entities - Micro F1: {entitiesEval.MicroF1}, Micro Precision: {entitiesEval.MicroPrecision}, Micro Recall: {entitiesEval.MicroRecall}"); +Console.WriteLine($"Entities - Macro F1: {entitiesEval.MacroF1}, Macro Precision: {entitiesEval.MacroPrecision}, Macro Recall: {entitiesEval.MacroRecall}"); + +// Print detailed metrics per entity +foreach (var entity in entitiesEval.Entities) +{ + Console.WriteLine($"Entity '{entity.Key}': F1 = {entity.Value.F1}, Precision = {entity.Value.Precision}, Recall = {entity.Value.Recall}"); + Console.WriteLine($" True Positives: {entity.Value.TruePositiveCount}, True Negatives: {entity.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {entity.Value.FalsePositiveCount}, False Negatives: {entity.Value.FalseNegativeCount}"); +} + +// Print intents evaluation summary +var intentsEval = evaluationSummaryResponse.Value.IntentsEvaluation; +Console.WriteLine($"Intents - Micro F1: {intentsEval.MicroF1}, Micro Precision: {intentsEval.MicroPrecision}, Micro Recall: {intentsEval.MicroRecall}"); +Console.WriteLine($"Intents - Macro F1: {intentsEval.MacroF1}, Macro Precision: {intentsEval.MacroPrecision}, Macro Recall: {intentsEval.MacroRecall}"); + +// Print detailed metrics per intent +foreach (var intent in intentsEval.Intents) +{ + Console.WriteLine($"Intent '{intent.Key}': F1 = {intent.Value.F1}, Precision = {intent.Value.Precision}, Recall = {intent.Value.Recall}"); + Console.WriteLine($" True Positives: {intent.Value.TruePositiveCount}, True Negatives: {intent.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {intent.Value.FalsePositiveCount}, False Negatives: {intent.Value.FalseNegativeCount}"); +} +``` + +To retrieve a model evaluation summary asynchronously, call GetModelEvaluationSummaryAsync on the AnalyzeConversationAuthoring client, which returns a Response containing evaluation metrics for intents and entities. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.md new file mode 100644 index 000000000000..ca0e6b80353c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.md @@ -0,0 +1,56 @@ +# Retrieving Model Evaluation Results in Azure AI Language + +This sample demonstrates how to retrieve model evaluation results, including intents and entities, for a specific trained model using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Get Model Evaluation Results + +To retrieve model evaluation results, call GetModelEvaluationResults on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample9_ConversationsAuthoring_GetModelEvaluationResults +Pageable results = authoringClient.GetModelEvaluationResults( + projectName: projectName, + trainedModelLabel: trainedModelLabel, + stringIndexType: stringIndexType +); + +foreach (UtteranceEvaluationResult result in results) +{ + Console.WriteLine($"Text: {result.Text}"); + Console.WriteLine($"Language: {result.Language}"); + + // Print intents result + Console.WriteLine($"Expected Intent: {result.IntentsResult.ExpectedIntent}"); + Console.WriteLine($"Predicted Intent: {result.IntentsResult.PredictedIntent}"); + + // Print entities result + Console.WriteLine("Expected Entities:"); + foreach (var entity in result.EntitiesResult.ExpectedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine("Predicted Entities:"); + foreach (var entity in result.EntitiesResult.PredictedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine(); +} +``` + +To retrieve model evaluation results, call GetModelEvaluationResults on the AnalyzeConversationAuthoring client, which provides evaluation metrics for intents and entities for each utterance in the dataset. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.md new file mode 100644 index 000000000000..829fa3df95bb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.md @@ -0,0 +1,54 @@ +# Getting Model Evaluation Results Asynchronously in Azure AI Language + +This sample demonstrates how to retrieve and display model evaluation results asynchronously using the `Azure.AI.Language.Conversations.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); +``` + +## Retrieve Model Evaluation Results Asynchronously + +To retrieve model evaluation results for a project asynchronously, call GetModelEvaluationResultsAsync on the AnalyzeConversationAuthoring client. + +```C# Snippet:Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync +AsyncPageable results = authoringClient.GetModelEvaluationResultsAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel, + stringIndexType: stringIndexType +); + +await foreach (UtteranceEvaluationResult result in results) +{ + Console.WriteLine($"Text: {result.Text}"); + Console.WriteLine($"Language: {result.Language}"); + + // Print intents result + Console.WriteLine($"Expected Intent: {result.IntentsResult.ExpectedIntent}"); + Console.WriteLine($"Predicted Intent: {result.IntentsResult.PredictedIntent}"); + + // Print entities result + Console.WriteLine("Expected Entities:"); + foreach (var entity in result.EntitiesResult.ExpectedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine("Predicted Entities:"); + foreach (var entity in result.EntitiesResult.PredictedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine(); +} +``` + +To retrieve model evaluation results, call GetModelEvaluationResultsAsync on the AnalyzeConversationAuthoring client. This returns an AsyncPageable that allows you to iterate through and analyze the results. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/AuthoringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/AuthoringClientOptions.cs new file mode 100644 index 000000000000..6196cdd75a83 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/AuthoringClientOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring +{ + public partial class AuthoringClientOptions : ClientOptions + { + /// + /// Gets or sets the audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. + /// + /// If null, will be assumed. + internal ConversationsAuthoringAudience? Audience { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Azure.AI.Language.Conversations.Authoring.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Azure.AI.Language.Conversations.Authoring.csproj new file mode 100644 index 000000000000..388316ddf1e3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Azure.AI.Language.Conversations.Authoring.csproj @@ -0,0 +1,22 @@ + + + This is the Authoring client library for developing .NET applications with rich experience. + Azure SDK Code Generation Authoring for Azure Data Plane + 1.0.0-beta.1 + Azure Authoring + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringAudience.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringAudience.cs new file mode 100644 index 000000000000..df240be8f757 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringAudience.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring +{ + /// Cloud audiences available for Conversations Authoring. + internal readonly partial struct ConversationsAuthoringAudience : IEquatable + { + private readonly string _value; + + /// + /// Initializes a new instance of the object. + /// + /// The Azure Active Directory audience to use when forming authorization scopes. For the Conversations Authoring service, this value corresponds to a URL that identifies the Azure cloud where the resource is located. For more information: . + /// is null. + /// Please use one of the constant members over creating a custom value unless you have special needs for doing so. + public ConversationsAuthoringAudience(string value) + { + Argument.AssertNotNullOrEmpty(value, nameof(value)); + _value = value; + } + + private const string AzureChinaValue = "https://cognitiveservices.azure.cn"; + private const string AzureGovernmentValue = "https://cognitiveservices.azure.us"; + private const string AzurePublicCloudValue = "https://cognitiveservices.azure.com"; + + /// Azure China. + public static ConversationsAuthoringAudience AzureChina { get; } = new ConversationsAuthoringAudience(AzureChinaValue); + + /// Azure Government. + public static ConversationsAuthoringAudience AzureGovernment { get; } = new ConversationsAuthoringAudience(AzureGovernmentValue); + + /// Azure Public Cloud. + public static ConversationsAuthoringAudience AzurePublicCloud { get; } = new ConversationsAuthoringAudience(AzurePublicCloudValue); + + /// Determines if two values are the same. + public static bool operator ==(ConversationsAuthoringAudience left, ConversationsAuthoringAudience right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConversationsAuthoringAudience left, ConversationsAuthoringAudience right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConversationsAuthoringAudience(string value) => new ConversationsAuthoringAudience(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConversationsAuthoringAudience other && Equals(other); + /// + public bool Equals(ConversationsAuthoringAudience 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/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringClientBuilderExtensions.cs new file mode 100644 index 000000000000..79e325b731b8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringClientBuilderExtensions.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring +{ + /// Extension methods to add to client builder. + [CodeGenModel("AILanguageConversationsAuthoringClientBuilderExtensions")] + public static partial class ConversationsAuthoringClientBuilderExtensions + { + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringModelFactory.cs new file mode 100644 index 000000000000..a2c380fd4c45 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/ConversationsAuthoringModelFactory.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring +{ + /// Model factory for Conversations Authoring models. + [CodeGenModel("AILanguageConversationsAuthoringModelFactory")] + public static partial class ConversationsAuthoringModelFactory + { + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs new file mode 100644 index 000000000000..2cb83fc5d18d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AnalyzeConversationAuthoring.cs @@ -0,0 +1,6630 @@ +// 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; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Conversations.Authoring +{ + // Data plane generated sub-client. + /// The AnalyzeConversationAuthoring sub-client. + public partial class AnalyzeConversationAuthoring + { + 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 AnalyzeConversationAuthoring for mocking. + protected AnalyzeConversationAuthoring() + { + } + + /// Initializes a new instance of AnalyzeConversationAuthoring. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal AnalyzeConversationAuthoring(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); + return Response.FromValue(ProjectMetadata.FromResponse(response), response); + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProject(projectName, context); + return Response.FromValue(ProjectMetadata.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// 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 new project 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 GetProjectAsync(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// 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 new project 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 GetProject(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new project or updates an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project 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 response returned from the service. + /// + public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new project or updates an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project 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 response returned from the service. + /// + public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CopyProjectAuthorizationAsync(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CopyProjectAuthorizationAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(CopyProjectDetails.FromResponse(response), response); + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CopyProjectAuthorization(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CopyProjectAuthorization(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); + return Response.FromValue(CopyProjectDetails.FromResponse(response), response); + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure 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 new project 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 response returned from the service. + /// + public virtual async Task CopyProjectAuthorizationAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProjectAuthorization"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure 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 new project 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 response returned from the service. + /// + public virtual Response CopyProjectAuthorization(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProjectAuthorization"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(CopyProjectJobState.FromResponse(response), response); + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetCopyProjectStatus(projectName, jobId, context); + return Response.FromValue(CopyProjectJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetCopyProjectStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); + return Response.FromValue(ProjectDeployment.FromResponse(response), response); + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeployment(projectName, deploymentName, context); + return Response.FromValue(ProjectDeployment.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetDeployment(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentJobState.FromResponse(response), response); + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(DeploymentJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSwapDeploymentsStatus(projectName, jobId, context); + return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ExportProjectJobState.FromResponse(response), response); + } + + /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportStatus(projectName, jobId, context); + return Response.FromValue(ExportProjectJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ImportProjectJobState.FromResponse(response), response); + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetImportStatus(projectName, jobId, context); + return Response.FromValue(ImportProjectJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetImportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetImportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainedModel(projectName, trainedModelLabel, context); + return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a trained 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. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a trained 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. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, 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 an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, 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 an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(EvaluationJobState.FromResponse(response), response); + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(EvaluationJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing unassign deployment resources job. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); + } + + /// Gets the status of an existing unassign deployment resources job. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(DeploymentResourcesJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// 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 name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// 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 name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TrainingJobState.FromResponse(response), response); + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingStatus(projectName, jobId, context); + return Response.FromValue(TrainingJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainingStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); + return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProjectDeletionStatus(jobId, context); + return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// 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 job ID. + /// 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 GetProjectDeletionStatusAsync(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// 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 job ID. + /// 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 GetProjectDeletionStatus(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetAssignedResourceDeploymentsAsync(int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignedResourceDeploymentsAsync(top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(AssignedResourceDeploymentsMetadata.FromResponse(response), response); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetAssignedResourceDeployments(int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignedResourceDeployments(top, skip, maxpagesize, context); + return Response.FromValue(AssignedResourceDeploymentsMetadata.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// 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 maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetAssignedResourceDeploymentsAsync(int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignedResourceDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignedResourceDeploymentsRequest(top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// 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 maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetAssignedResourceDeployments(int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetAssignedResourceDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignedResourceDeploymentsRequest(top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the supported languages for the given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetSupportedLanguagesAsync(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSupportedLanguagesAsync(projectKind.ToString(), top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(SupportedLanguages.FromResponse(response), response); + } + + /// Lists the supported languages for the given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetSupportedLanguages(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSupportedLanguages(projectKind.ToString(), top, skip, maxpagesize, context); + return Response.FromValue(SupportedLanguages.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists the supported languages for the given project type. + /// + /// + /// + /// 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 project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetSupportedLanguagesAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedLanguages"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the supported languages for the given project type. + /// + /// + /// + /// 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 project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetSupportedLanguages(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedLanguages"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetSupportedPrebuiltEntitiesAsync(string language = null, string multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSupportedPrebuiltEntitiesAsync(language, multilingual, top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(PrebuiltEntities.FromResponse(response), response); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetSupportedPrebuiltEntities(string language = null, string multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSupportedPrebuiltEntities(language, multilingual, top, skip, maxpagesize, context); + return Response.FromValue(PrebuiltEntities.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// 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 language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetSupportedPrebuiltEntitiesAsync(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedPrebuiltEntities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// 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 language to get supported prebuilt entities for. Required if multilingual is false. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Whether to get the support prebuilt entities for multilingual or monolingual projects. If true, the language parameter is ignored. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetSupportedPrebuiltEntities(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetSupportedPrebuiltEntities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the support training config version for a given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetTrainingConfigVersionsAsync(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingConfigVersionsAsync(projectKind.ToString(), top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(TrainingConfigVersions.FromResponse(response), response); + } + + /// Lists the support training config version for a given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetTrainingConfigVersions(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingConfigVersions(projectKind.ToString(), top, skip, maxpagesize, context); + return Response.FromValue(TrainingConfigVersions.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// 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 project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetTrainingConfigVersionsAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingConfigVersions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// 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 project kind. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 GetTrainingConfigVersions(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetTrainingConfigVersions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModel(projectName, exportedModelName, context); + return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportedModel(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ExportedModelJobState.FromResponse(response), response); + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); + return Response.FromValue(ExportedModelJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", context); + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// 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 number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// 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 number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetProjects", "value", "nextLink", context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// 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 GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// 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 GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "AnalyzeConversationAuthoring.GetExportedModels", "value", "nextLink", context); + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).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 a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Copies an existing project to another Azure resource. + /// 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 name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Copies an existing project to another Azure resource. + /// 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 name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CopyProject(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Copies an existing project to another Azure 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. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Copies an existing project to another Azure 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. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to export a project's data. + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The format of the exported project file to use. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, ExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); + } + + /// Triggers a job to export a project's data. + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The format of the exported project file to use. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, ExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return Export(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.ToString(), assetKind, trainedModelLabel, context); + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// 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 ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// 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 Export(WaitUntil waitUntil, string projectName, string stringIndexType, string exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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 name of the project to use. + /// The project data to import. + /// The format of the exported project file to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, ExportedProject body, ExportedProjectFormat? exportedProjectFormat = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportAsync(waitUntil, projectName, content, exportedProjectFormat?.ToString(), context).ConfigureAwait(false); + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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 name of the project to use. + /// The project data to import. + /// The format of the exported project file to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Import(WaitUntil waitUntil, string projectName, ExportedProject body, ExportedProjectFormat? exportedProjectFormat = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return Import(waitUntil, projectName, content, exportedProjectFormat?.ToString(), context); + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// 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 name of the project to use. + /// The content to send as the body of the request. + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// 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 ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string exportedProjectFormat = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// 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 name of the project to use. + /// The content to send as the body of the request. + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// 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 Import(WaitUntil waitUntil, string projectName, RequestContent content, string exportedProjectFormat = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a training job for a project. + /// 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 name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.Train"); + } + + /// Triggers a training job for a project. + /// 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 name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Train(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = Train(waitUntil, projectName, content, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.Train"); + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// 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 name of the project to use. + /// 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> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// 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 name of the project to use. + /// 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 Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Swaps two existing deployments with each other. + /// 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 name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Swaps two existing deployments with each other. + /// 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 name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return SwapDeployments(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// 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 name of the project to use. + /// 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 SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// 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 name of the project to use. + /// 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 SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new deployment or replaces an existing one. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Creates a new deployment or replaces an existing one. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeployProject(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + 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 a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).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 a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers evaluation operation on a trained 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel"); + } + + /// Triggers evaluation operation on a trained 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel"); + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained 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 name of the project to use. + /// The trained model label. + /// 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. + /// or 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> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained 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 name of the project to use. + /// The trained model label. + /// 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. + /// or 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 EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + 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] Restores the snapshot of this trained model to be the current working directory of the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).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] Restores the snapshot of this trained model to be the current working directory of the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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 name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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 name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return AssignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// 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 name of the project to use. + /// 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 AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// 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 name of the project to use. + /// 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 AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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 name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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 name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return UnassignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// 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 name of the project to use. + /// 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 UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// 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 name of the project to use. + /// 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 UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a cancellation for a running training job. + /// 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 name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob"); + } + + /// Triggers a cancellation for a running training job. + /// 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 name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob"); + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// 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 name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// 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 name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + 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 an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).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 an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new exported model or replaces an existing one. + /// 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 name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); + } + + /// Creates a new exported model or replaces an existing one. + /// 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 name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The exported 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. + /// or 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 CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The exported 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. + /// or 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 CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "AnalyzeConversationAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCopyProjectAuthorizationRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:authorize-copy", 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 CreateCopyProjectRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:copy", 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 CreateExportRequest(string projectName, string stringIndexType, string exportedProjectFormat, string assetKind, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (exportedProjectFormat != null) + { + uri.AppendQuery("format", exportedProjectFormat, true); + } + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + if (trainedModelLabel != null) + { + uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string exportedProjectFormat, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (exportedProjectFormat != null) + { + uri.AppendQuery("format", exportedProjectFormat, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateTrainRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:train", 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 CreateGetCopyProjectStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/copy/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSwapDeploymentsRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/:swap", 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 CreateGetDeploymentRequest(string projectName, string deploymentName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + 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 CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/:delete-from-resources", 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 CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/delete-from-resources/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/swap/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/export/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/import/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:evaluate", 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 CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:load-snapshot", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluate/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/result", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/summary-result", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/load-snapshot/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:assign", 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 CreateUnassignDeploymentResourcesRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:unassign", 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 CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/assign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/unassign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/:cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/deletion-jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? top, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/deployments/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? top, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/languages", false); + uri.AppendQuery("projectKind", projectKind, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(string language, string multilingual, int? top, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/prebuilt-entities", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (language != null) + { + uri.AppendQuery("language", language, true); + } + if (multilingual != null) + { + uri.AppendQuery("multilingual", multilingual, true); + } + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? top, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/global/training-config-versions", false); + uri.AppendQuery("projectKind", projectKind, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + 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 CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", 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 _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + + private TrainingJobResult FetchTrainingJobResultFromTrainingJobState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TrainingJobResult.DeserializeTrainingJobResult(resultJsonElement); + } + + private EvaluationJobResult FetchEvaluationJobResultFromEvaluationJobState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return EvaluationJobResult.DeserializeEvaluationJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs new file mode 100644 index 000000000000..9b8fcdf03b96 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClient.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Conversations.Authoring +{ + // Data plane generated client. + /// The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. + public partial class AuthoringClient + { + 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; + + /// 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 AuthoringClient for mocking. + protected AuthoringClient() + { + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AuthoringClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AuthoringClientOptions()) + { + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AuthoringClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AuthoringClientOptions()) + { + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AuthoringClient(Uri endpoint, AzureKeyCredential credential, AuthoringClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AuthoringClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AuthoringClient(Uri endpoint, TokenCredential credential, AuthoringClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AuthoringClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of AnalyzeConversationAuthoring. + /// The API version to use for this operation. + /// is null. + public virtual AnalyzeConversationAuthoring GetAnalyzeConversationAuthoringClient(string apiVersion = "2024-11-15-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new AnalyzeConversationAuthoring(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClientOptions.cs new file mode 100644 index 000000000000..1faa972821a7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/AuthoringClientOptions.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring +{ + /// Client options for AuthoringClient. + public partial class AuthoringClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-04-01". + V2023_04_01 = 1, + /// Service version "2023-04-15-preview". + V2023_04_15_Preview = 2, + /// Service version "2024-11-15-preview". + V2024_11_15_Preview = 3, + } + + internal string Version { get; } + + /// Initializes new instance of AuthoringClientOptions. + public AuthoringClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_04_01 => "2023-04-01", + ServiceVersion.V2023_04_15_Preview => "2023-04-15-preview", + ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringClientBuilderExtensions.cs new file mode 100644 index 000000000000..2af0e709afeb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringClientBuilderExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; + +namespace Azure.AI.Language.Conversations.Authoring +{ + /// Extension methods to add to client builder. + public static partial class ConversationsAuthoringClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new AuthoringClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new AuthoringClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs new file mode 100644 index 000000000000..0f7695000f64 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/ConversationsAuthoringModelFactory.cs @@ -0,0 +1,962 @@ +// 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.AI.Language.Conversations.Authoring.Models; + +namespace Azure.AI.Language.Conversations.Authoring +{ + /// Model factory for models. + public static partial class ConversationsAuthoringModelFactory + { + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project last trained datetime. + /// Represents the project last deployed datetime. + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static ProjectMetadata ProjectMetadata(DateTimeOffset createdDateTime = default, DateTimeOffset lastModifiedDateTime = default, DateTimeOffset? lastTrainedDateTime = null, DateTimeOffset? lastDeployedDateTime = null, ProjectKind projectKind = default, ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + settings, + storageInputContainerName, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 AuthoringConversationsError AuthoringConversationsError(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) + { + details ??= new List(); + + return new AuthoringConversationsError( + code, + message, + target, + details?.ToList(), + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// Error details. + /// Error target. + /// An object containing more specific information than the current object about the error. + /// A new instance for mocking. + public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, string message = null, IReadOnlyDictionary details = null, string target = null, InnerErrorModel innererror = null) + { + details ??= new Dictionary(); + + return new InnerErrorModel( + code, + message, + details, + target, + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static CreateProjectDetails CreateProjectDetails(ProjectKind projectKind = default, ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new CreateProjectDetails( + projectKind, + settings, + storageInputContainerName, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ProjectDeletionJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// A new instance for mocking. + public static AuthoringConversationsWarning AuthoringConversationsWarning(string code = null, string message = null) + { + return new AuthoringConversationsWarning(code, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static CopyProjectJobState CopyProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new CopyProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// A new instance for mocking. + public static ExportProjectJobState ExportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUrl = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ExportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + resultUrl, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// + /// Represents the project assets. + /// 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 . + /// + /// A new instance for mocking. + public static ExportedProject ExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, CreateProjectDetails metadata = null, ExportedProjectAssets assets = null) + { + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The category of the entity. + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The regex component of the entity. + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + /// A new instance for mocking. + public static ConversationExportedEntity ConversationExportedEntity(string category = null, CompositionSetting? compositionSetting = null, ExportedEntityList list = null, IEnumerable prebuilts = null, ExportedEntityRegex regex = null, IEnumerable requiredComponents = null) + { + prebuilts ??= new List(); + requiredComponents ??= new List(); + + return new ConversationExportedEntity( + category, + compositionSetting, + list, + prebuilts?.ToList(), + regex, + requiredComponents?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the entity labels of the utterance. + /// The utterance text. + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static ConversationExportedUtterance ConversationExportedUtterance(IEnumerable entities = null, string text = null, string language = null, string intent = null, string dataset = null) + { + entities ??= new List(); + + return new ConversationExportedUtterance( + entities?.ToList(), + text, + language, + intent, + dataset, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// 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 . + /// + /// The intent category. + /// A new instance for mocking. + public static OrchestrationExportedIntent OrchestrationExportedIntent(ExportedOrchestrationDetails orchestration = null, string category = null) + { + return new OrchestrationExportedIntent(orchestration, category, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Conversational project target details. + /// A new instance for mocking. + public static ExportedConversationOrchestrationDetails ExportedConversationOrchestrationDetails(ExportedConversationOrchestration conversationOrchestration = null) + { + return new ExportedConversationOrchestrationDetails(OrchestrationTargetProjectKind.Conversation, serializedAdditionalRawData: null, conversationOrchestration); + } + + /// Initializes a new instance of . + /// The LUIS application target details. + /// A new instance for mocking. + public static ExportedLuisOrchestrationDetails ExportedLuisOrchestrationDetails(ExportedLuisOrchestration luisOrchestration = null) + { + return new ExportedLuisOrchestrationDetails(OrchestrationTargetProjectKind.Luis, serializedAdditionalRawData: null, luisOrchestration); + } + + /// Initializes a new instance of . + /// The LUIS application ID. + /// The targeted version Id. + /// The targeted slot name. + /// A new instance for mocking. + public static ExportedLuisOrchestration ExportedLuisOrchestration(Guid appId = default, string appVersion = null, string slotName = null) + { + return new ExportedLuisOrchestration(appId, appVersion, slotName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Question Answering project details. + /// A new instance for mocking. + public static ExportedQuestionAnsweringOrchestrationDetails ExportedQuestionAnsweringOrchestrationDetails(ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null) + { + return new ExportedQuestionAnsweringOrchestrationDetails(OrchestrationTargetProjectKind.QuestionAnswering, serializedAdditionalRawData: null, questionAnsweringOrchestration); + } + + /// Initializes a new instance of . + /// The utterance text. + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static OrchestrationExportedUtterance OrchestrationExportedUtterance(string text = null, string language = null, string intent = null, string dataset = null) + { + return new OrchestrationExportedUtterance(text, language, intent, dataset, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ImportProjectJobState ImportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ImportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. By default, "latest" value is used which uses the latest released training config version. + /// Represents the mode of the training operation. + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + /// A new instance for mocking. + public static TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, TrainingMode trainingMode = default, EvaluationDetails evaluationOptions = null) + { + return new TrainingJobDetails(modelLabel, trainingConfigVersion, trainingMode, evaluationOptions, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents the mode of the training operation. + /// Represents the model training status. + /// Represents model evaluation status. + /// Represents the estimated end date time for training and evaluation. + /// A new instance for mocking. + public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, TrainingMode? trainingMode = null, SubTrainingJobState trainingStatus = null, SubTrainingJobState evaluationStatus = null, DateTimeOffset? estimatedEndDateTime = null) + { + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingMode, + trainingStatus, + evaluationStatus, + estimatedEndDateTime, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the start date time. + /// Represents the end date time. + /// Represents the status of the sub-operation. + /// A new instance for mocking. + public static SubTrainingJobState SubTrainingJobState(int percentComplete = default, DateTimeOffset? startDateTime = null, DateTimeOffset? endDateTime = null, JobStatus status = default) + { + return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// A new instance for mocking. + public static TrainingJobState TrainingJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new TrainingJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// A new instance for mocking. + public static ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) + { + assignedResources ??= new List(); + + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// A new instance for mocking. + public static DeploymentResource DeploymentResource(string resourceId = null, string region = null) + { + return new DeploymentResource(resourceId, region, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new SwapDeploymentsJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the trained model label. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// A new instance for mocking. + public static CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + { + assignedResourceIds ??= new List(); + + return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentJobState DeploymentJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentDeleteFromResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// A new instance for mocking. + public static ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) + { + return new ProjectTrainedModel( + label, + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// A new instance for mocking. + public static EvaluationJobResult EvaluationJobResult(EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) + { + return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents evaluation task detailed result. + /// A new instance for mocking. + public static EvaluationJobState EvaluationJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, EvaluationJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new EvaluationJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new LoadSnapshotJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the utterance text. + /// Represents the utterance language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the entities results for the utterance. + /// Represents the intents results for the utterance. + /// A new instance for mocking. + public static UtteranceEvaluationResult UtteranceEvaluationResult(string text = null, string language = null, UtteranceEntitiesEvaluationResult entitiesResult = null, UtteranceIntentsEvaluationResult intentsResult = null) + { + return new UtteranceEvaluationResult(text, language, entitiesResult, intentsResult, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the expected entity labels. + /// Represents the predicted entity labels. + /// A new instance for mocking. + public static UtteranceEntitiesEvaluationResult UtteranceEntitiesEvaluationResult(IEnumerable expectedEntities = null, IEnumerable predictedEntities = null) + { + expectedEntities ??= new List(); + predictedEntities ??= new List(); + + return new UtteranceEntitiesEvaluationResult(expectedEntities?.ToList(), predictedEntities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// A new instance for mocking. + public static UtteranceEntityEvaluationResult UtteranceEntityEvaluationResult(string category = null, int offset = default, int length = default) + { + return new UtteranceEntityEvaluationResult(category, offset, length, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the utterance's expected intent. + /// Represents the utterance's predicted intent. + /// A new instance for mocking. + public static UtteranceIntentsEvaluationResult UtteranceIntentsEvaluationResult(string expectedIntent = null, string predictedIntent = null) + { + return new UtteranceIntentsEvaluationResult(expectedIntent, predictedIntent, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Contains the data related to entities evaluation. + /// Contains the data related to intents evaluation. + /// The options that were used while running the evaluation. + /// A new instance for mocking. + public static EvaluationSummary EvaluationSummary(EntitiesEvaluationSummary entitiesEvaluation = null, IntentsEvaluationSummary intentsEvaluation = null, EvaluationDetails evaluationOptions = null) + { + return new EvaluationSummary(entitiesEvaluation, intentsEvaluation, evaluationOptions, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + /// Represents the entities evaluation summary. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static EntitiesEvaluationSummary EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + entities ??= new Dictionary(); + + return new EntitiesEvaluationSummary( + confusionMatrix, + entities, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static ConfusionMatrix ConfusionMatrix(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new ConfusionMatrix(additionalProperties); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static ConfusionMatrixRow ConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new ConfusionMatrixRow(additionalProperties); + } + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + /// A new instance for mocking. + public static ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = default, float rawValue = default) + { + return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static EntityEvaluationSummary EntityEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new EntityEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the intent that was labelled and the intent that was predicted. + /// Represents the intents evaluation summary. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static IntentsEvaluationSummary IntentsEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary intents = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + intents ??= new Dictionary(); + + return new IntentsEvaluationSummary( + confusionMatrix, + intents, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static IntentEvaluationSummary IntentEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new IntentEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// A new instance for mocking. + public static AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) + { + return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentResourcesJobState DeploymentResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of retrieved assigned project deployments. + /// The next page link. + /// A new instance for mocking. + public static AssignedResourceDeploymentsMetadata AssignedResourceDeploymentsMetadata(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new AssignedResourceDeploymentsMetadata(value?.ToList(), nextLink, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// A new instance for mocking. + public static AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) + { + deploymentsMetadata ??= new List(); + + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// A new instance for mocking. + public static AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default) + { + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of the languages. + /// The next page link. + /// A new instance for mocking. + public static SupportedLanguages SupportedLanguages(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new SupportedLanguages(value?.ToList(), nextLink, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) + { + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The supported prebuilt entities. + /// The next page link. + /// A new instance for mocking. + public static PrebuiltEntities PrebuiltEntities(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new PrebuiltEntities(value?.ToList(), nextLink, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// A new instance for mocking. + public static PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) + { + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The list of the training config versions. + /// The next page link. + /// A new instance for mocking. + public static TrainingConfigVersions TrainingConfigVersions(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new TrainingConfigVersions(value?.ToList(), nextLink, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// A new instance for mocking. + public static TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, DateTimeOffset modelExpirationDate = default) + { + return new TrainingConfigVersion(trainingConfigVersionProperty, modelExpirationDate, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// A new instance for mocking. + public static ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastExportedModelDateTime = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null) + { + return new ExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ExportedModelJobState ExportedModelJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ExportedModelJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Docs/AnalyzeConversationAuthoring.xml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Docs/AnalyzeConversationAuthoring.xml new file mode 100644 index 000000000000..ad7f0d4545c2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Docs/AnalyzeConversationAuthoring.xml @@ -0,0 +1,5911 @@ + + + + + +This sample shows how to call GetProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> +This sample shows how to call GetProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> + + + +This sample shows how to call GetProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> +This sample shows how to call GetProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> + + + +This sample shows how to call GetProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call GetProjectAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call GetProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call GetProject with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CreateProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + projectName = "", + language = "", +}); +Response response = await client.CreateProjectAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call CreateProjectAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", +}); +Response response = await client.CreateProjectAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CreateProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + projectName = "", + language = "", +}); +Response response = client.CreateProject("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call CreateProject with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", +}); +Response response = client.CreateProject("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorization. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", +}); +Response response = await client.CopyProjectAuthorizationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + storageInputContainerName = "", + allowOverwrite = true, +}); +Response response = await client.CopyProjectAuthorizationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> + + + +This sample shows how to call CopyProjectAuthorization and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", +}); +Response response = client.CopyProjectAuthorization("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + storageInputContainerName = "", + allowOverwrite = true, +}); +Response response = client.CopyProjectAuthorization("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetCopyProjectStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> +This sample shows how to call GetDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> + + + +This sample shows how to call GetDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> +This sample shows how to call GetDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> + + + +This sample shows how to call GetDeploymentAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> +This sample shows how to call GetDeploymentAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> + + + +This sample shows how to call GetDeployment and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> +This sample shows how to call GetDeployment with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> +This sample shows how to call GetExportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetExportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> +This sample shows how to call GetExportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> + + + +This sample shows how to call GetExportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("resultUrl").ToString()); +]]> + + + +This sample shows how to call GetExportStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("resultUrl").ToString()); +]]> + + + +This sample shows how to call GetImportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> +This sample shows how to call GetImportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetImportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> +This sample shows how to call GetImportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> + + + +This sample shows how to call GetImportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetImportStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetImportStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetImportStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetTrainedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> + + + +This sample shows how to call GetTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> +This sample shows how to call GetTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> + + + +This sample shows how to call GetTrainedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> + + + +This sample shows how to call GetTrainedModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> +This sample shows how to call GetTrainedModel with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> + + + +This sample shows how to call DeleteTrainedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.DeleteTrainedModelAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.DeleteTrainedModelAsync("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> +This sample shows how to call GetEvaluationStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call GetEvaluationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call GetEvaluationStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummary. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +]]> + + + +This sample shows how to call GetModelEvaluationSummary and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetTrainingStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> + + + +This sample shows how to call GetTrainingStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> +This sample shows how to call GetTrainingStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> + + + +This sample shows how to call GetTrainingStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call GetTrainingStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call GetTrainingStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetProjectDeletionStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(); +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetAssignedResourceDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(); +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetAssignedResourceDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation); +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedLanguages. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages(ProjectKind.Conversation); +]]> +This sample shows how to call GetSupportedLanguages with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedLanguages and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +]]> +This sample shows how to call GetSupportedLanguages with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync(); +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities(); +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync(null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync("", "", 1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities(null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities("", "", 1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation); +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetTrainingConfigVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation); +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetTrainingConfigVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> +This sample shows how to call GetExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> + + + +This sample shows how to call GetExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> +This sample shows how to call GetExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> + + + +This sample shows how to call GetExportedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> +This sample shows how to call GetExportedModelAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> + + + +This sample shows how to call GetExportedModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> +This sample shows how to call GetExportedModel with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportedModelJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetProjectsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectMetadata item in client.GetProjectsAsync()) +{ +} +]]> +This sample shows how to call GetProjectsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetProjects. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectMetadata item in client.GetProjects()) +{ +} +]]> +This sample shows how to call GetProjects with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetProjectsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetProjectsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetProjects and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetProjects(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetProjects with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) +{ +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectDeployment item in client.GetDeployments("")) +{ +} +]]> +This sample shows how to call GetDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetTrainedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) +{ +} +]]> +This sample shows how to call GetTrainedModelsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainedModels. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectTrainedModel item in client.GetTrainedModels("")) +{ +} +]]> +This sample shows how to call GetTrainedModels with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainedModelsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> +This sample shows how to call GetTrainedModelsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> + + + +This sample shows how to call GetTrainedModels and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> +This sample shows how to call GetTrainedModels with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResultsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResults. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResultsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResults and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) +{ +} +]]> +This sample shows how to call GetDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) +{ +} +]]> +This sample shows how to call GetDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentResourcesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResources and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentResources with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingJobsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) +{ +} +]]> +This sample shows how to call GetTrainingJobsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingJobs. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingJobState item in client.GetTrainingJobs("")) +{ +} +]]> +This sample shows how to call GetTrainingJobs with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingJobsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +} +]]> +This sample shows how to call GetTrainingJobsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingJobs and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +} +]]> +This sample shows how to call GetTrainingJobs with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +} +]]> + + + +This sample shows how to call GetExportedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) +{ +} +]]> +This sample shows how to call GetExportedModelsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetExportedModels. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ExportedTrainedModel item in client.GetExportedModels("")) +{ +} +]]> +This sample shows how to call GetExportedModels with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetExportedModelsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> +This sample shows how to call GetExportedModelsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> + + + +This sample shows how to call GetExportedModels and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> +This sample shows how to call GetExportedModels with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> + + + +This sample shows how to call DeleteProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> +This sample shows how to call DeleteProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call DeleteProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> +This sample shows how to call DeleteProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.Conversation, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call CopyProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.Conversation, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call CopyProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.Conversation, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = client.CopyProject(WaitUntil.Completed, "", body); +]]> +This sample shows how to call CopyProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.Conversation, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = client.CopyProject(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call CopyProjectAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CopyProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = client.CopyProject(WaitUntil.Completed, "", content); +]]> +This sample shows how to call CopyProject with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = client.CopyProject(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); +]]> +This sample shows how to call ExportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); +]]> +This sample shows how to call Export with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); +]]> +This sample shows how to call ExportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); +]]> +This sample shows how to call Export with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call ImportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") +{ + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", +}) +{ + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") + { + CompositionSetting = CompositionSetting.ReturnLongestOverlap, + List = new ExportedEntityList + { + Sublists = {new ExportedEntitySublist + { + ListKey = "", + Synonyms = {new ExportedEntityListSynonym + { + Language = "", + Values = {""}, + }}, + }}, + }, + Prebuilts = {new ExportedPrebuiltEntity("")}, + Regex = new ExportedEntityRegex + { + Expressions = {new ExportedEntityRegexExpression + { + RegexKey = "", + Language = "", + RegexPattern = "", + }}, + }, + RequiredComponents = {""}, + }}, + Utterances = {new ConversationExportedUtterance("", "") + { + Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); +Operation operation = client.Import(WaitUntil.Completed, "", body); +]]> +This sample shows how to call Import with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") +{ + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", +}) +{ + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") + { + CompositionSetting = CompositionSetting.ReturnLongestOverlap, + List = new ExportedEntityList + { + Sublists = {new ExportedEntitySublist + { + ListKey = "", + Synonyms = {new ExportedEntityListSynonym + { + Language = "", + Values = {""}, + }}, + }}, + }, + Prebuilts = {new ExportedPrebuiltEntity("")}, + Regex = new ExportedEntityRegex + { + Expressions = {new ExportedEntityRegexExpression + { + RegexKey = "", + Language = "", + RegexPattern = "", + }}, + }, + RequiredComponents = {""}, + }}, + Utterances = {new ConversationExportedUtterance("", "") + { + Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = client.Import(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + projectName = "", + language = "", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call ImportAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { + new + { + category = "", + } + }, + entities = new object[] + { + new + { + category = "", + compositionSetting = "returnLongestOverlap", + list = new + { + sublists = new object[] + { + new + { + listKey = "", + synonyms = new object[] + { + new + { + language = "", + values = new object[] + { + "" + }, + } + }, + } + }, + }, + prebuilts = new object[] + { + new + { + category = "", + } + }, + regex = new + { + expressions = new object[] + { + new + { + regexKey = "", + language = "", + regexPattern = "", + } + }, + }, + requiredComponents = new object[] + { + "" + }, + } + }, + utterances = new object[] + { + new + { + entities = new object[] + { + new + { + category = "", + offset = 1234, + length = 1234, + } + }, + text = "", + language = "", + intent = "", + dataset = "", + } + }, + projectKind = "Conversation", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + projectName = "", + language = "", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content); +]]> +This sample shows how to call Import with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { + new + { + category = "", + } + }, + entities = new object[] + { + new + { + category = "", + compositionSetting = "returnLongestOverlap", + list = new + { + sublists = new object[] + { + new + { + listKey = "", + synonyms = new object[] + { + new + { + language = "", + values = new object[] + { + "" + }, + } + }, + } + }, + }, + prebuilts = new object[] + { + new + { + category = "", + } + }, + regex = new + { + expressions = new object[] + { + new + { + regexKey = "", + language = "", + regexPattern = "", + } + }, + }, + requiredComponents = new object[] + { + "" + }, + } + }, + utterances = new object[] + { + new + { + entities = new object[] + { + new + { + category = "", + offset = 1234, + length = 1234, + } + }, + text = "", + language = "", + intent = "", + dataset = "", + } + }, + projectKind = "Conversation", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); +]]> + + + +This sample shows how to call TrainAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call TrainAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) +{ + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, +}; +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call Train. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); +Operation operation = client.Train(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call Train with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) +{ + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, +}; +Operation operation = client.Train(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call TrainAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingMode = "advanced", +}); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call TrainAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, +}); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingMode").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call Train and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingMode = "advanced", +}); +Operation operation = client.Train(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call Train with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, +}); +Operation operation = client.Train(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingMode").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); +]]> +This sample shows how to call SwapDeployments with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails(""); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails(""); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeployProjectAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeployProject with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails(); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails(); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call EvaluateModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails(); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> +This sample shows how to call EvaluateModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails +{ + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, +}; +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call EvaluateModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails(); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> +This sample shows how to call EvaluateModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails +{ + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, +}; +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call EvaluateModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call EvaluateModelAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, +}); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call EvaluateModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call EvaluateModel with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, +}); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call LoadSnapshotAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call LoadSnapshotAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call LoadSnapshot. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call LoadSnapshot with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call AssignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call AssignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call AssignDeploymentResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); +]]> +This sample shows how to call AssignDeploymentResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CancelTrainingJobAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call CancelTrainingJobAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call CancelTrainingJob. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call CancelTrainingJob with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call CancelTrainingJobAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call CancelTrainingJobAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingMode").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call CancelTrainingJob and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call CancelTrainingJob with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingMode").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call DeleteExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> + + + \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Argument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..be9eb20389c2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..ebd5ffcd7101 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ChangeTrackingList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..4eacbc67f6b6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Conversations.Authoring +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..5d5876cd582a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Optional.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..34b62b5f93f3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.AI.Language.Conversations.Authoring +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..ff047ca8dbe7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs new file mode 100644 index 000000000000..60bee30edf13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourcesMetadata"u8); + writer.WriteStartArray(); + foreach (var item in ResourcesMetadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignDeploymentResourcesDetails(document.RootElement, options); + } + + internal static AssignDeploymentResourcesDetails DeserializeAssignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList resourcesMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourcesMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceMetadata.DeserializeResourceMetadata(item, options)); + } + resourcesMetadata = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignDeploymentResourcesDetails(resourcesMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); + } + } + + AssignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignDeploymentResourcesDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignDeploymentResourcesDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignDeploymentResourcesDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs new file mode 100644 index 000000000000..afaf75245625 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs @@ -0,0 +1,76 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents the options for assigning Azure resources to a project. + public partial class AssignDeploymentResourcesDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the metadata for the resources to be assigned. + /// is null. + public AssignDeploymentResourcesDetails(IEnumerable resourcesMetadata) + { + Argument.AssertNotNull(resourcesMetadata, nameof(resourcesMetadata)); + + ResourcesMetadata = resourcesMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Represents the metadata for the resources to be assigned. + /// Keeps track of any properties unknown to the library. + internal AssignDeploymentResourcesDetails(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + { + ResourcesMetadata = resourcesMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignDeploymentResourcesDetails() + { + } + + /// Represents the metadata for the resources to be assigned. + public IList ResourcesMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs new file mode 100644 index 000000000000..9f5ca609d99b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignedDeploymentResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + } + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedDeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedDeploymentResource(document.RootElement, options); + } + + internal static AssignedDeploymentResource DeserializeAssignedDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{options.Format}' format."); + } + } + + AssignedDeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedDeploymentResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedDeploymentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedDeploymentResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs new file mode 100644 index 000000000000..618f6d01d66e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedDeploymentResource.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the assigned deployment resource. + public partial class AssignedDeploymentResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource region. + /// is null. + internal AssignedDeploymentResource(string region) + { + Argument.AssertNotNull(region, nameof(region)); + + Region = region; + } + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// Keeps track of any properties unknown to the library. + internal AssignedDeploymentResource(string azureResourceId, string region, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedDeploymentResource() + { + } + + /// The resource ID. + public string AzureResourceId { get; } + /// The resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs new file mode 100644 index 000000000000..04c1e3d2fe12 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignedProjectDeploymentMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedProjectDeploymentMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + } + + internal static AssignedProjectDeploymentMetadata DeserializeAssignedProjectDeploymentMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedProjectDeploymentMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedProjectDeploymentMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs new file mode 100644 index 000000000000..fae2ecce4b15 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the metadata for an assigned deployment. + public partial class AssignedProjectDeploymentMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// is null. + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate) + { + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + DeploymentName = deploymentName; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + } + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Keeps track of any properties unknown to the library. + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedProjectDeploymentMetadata() + { + } + + /// Represents the deployment name. + public string DeploymentName { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs new file mode 100644 index 000000000000..5b597fcb1be1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignedProjectDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + writer.WritePropertyName("deploymentsMetadata"u8); + writer.WriteStartArray(); + foreach (var item in DeploymentsMetadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedProjectDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + } + + internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = default; + IReadOnlyList deploymentsMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentsMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssignedProjectDeploymentMetadata.DeserializeAssignedProjectDeploymentMetadata(item, options)); + } + deploymentsMetadata = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedProjectDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedProjectDeploymentsMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs new file mode 100644 index 000000000000..9f66a10adc3a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs @@ -0,0 +1,83 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents the metadata for assigned deployments for a project. + public partial class AssignedProjectDeploymentsMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// or is null. + internal AssignedProjectDeploymentsMetadata(string projectName, IEnumerable deploymentsMetadata) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(deploymentsMetadata, nameof(deploymentsMetadata)); + + ProjectName = projectName; + DeploymentsMetadata = deploymentsMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// Keeps track of any properties unknown to the library. + internal AssignedProjectDeploymentsMetadata(string projectName, IReadOnlyList deploymentsMetadata, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + DeploymentsMetadata = deploymentsMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedProjectDeploymentsMetadata() + { + } + + /// Represents the project name. + public string ProjectName { get; } + /// Represents the resource region. + public IReadOnlyList DeploymentsMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs new file mode 100644 index 000000000000..abfd17b13326 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AssignedResourceDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedResourceDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement, options); + } + + internal static AssignedResourceDeploymentsMetadata DeserializeAssignedResourceDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedResourceDeploymentsMetadata(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedResourceDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedResourceDeploymentsMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs new file mode 100644 index 000000000000..30cb10584f98 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs @@ -0,0 +1,80 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents the metadata for deployments assigned to a resource. + public partial class AssignedResourceDeploymentsMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of retrieved assigned project deployments. + /// is null. + internal AssignedResourceDeploymentsMetadata(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of retrieved assigned project deployments. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal AssignedResourceDeploymentsMetadata(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedResourceDeploymentsMetadata() + { + } + + /// The list of retrieved assigned project deployments. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.Serialization.cs new file mode 100644 index 000000000000..e10a01cd735b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AuthoringConversationsError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AuthoringConversationsError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthoringConversationsError(document.RootElement, options); + } + + internal static AuthoringConversationsError DeserializeAuthoringConversationsError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorCode code = default; + string message = default; + string target = default; + IReadOnlyList details = default; + InnerErrorModel innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = new ErrorCode(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(DeserializeAuthoringConversationsError(item, options)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = InnerErrorModel.DeserializeInnerErrorModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AuthoringConversationsError( + code, + message, + target, + details ?? new ChangeTrackingList(), + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support writing '{options.Format}' format."); + } + } + + AuthoringConversationsError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAuthoringConversationsError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthoringConversationsError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AuthoringConversationsError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAuthoringConversationsError(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.cs new file mode 100644 index 000000000000..ce1afc865676 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsError.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The error object. + public partial class AuthoringConversationsError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// is null. + internal AuthoringConversationsError(ErrorCode code, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// 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. + /// + /// Keeps track of any properties unknown to the library. + internal AuthoringConversationsError(ErrorCode code, string message, string target, IReadOnlyList details, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Target = target; + Details = details; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AuthoringConversationsError() + { + } + + /// One of a server-defined set of error codes. + public ErrorCode 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 InnerErrorModel Innererror { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs new file mode 100644 index 000000000000..48ce205e2308 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class AuthoringConversationsWarning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AuthoringConversationsWarning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthoringConversationsWarning(document.RootElement, options); + } + + internal static AuthoringConversationsWarning DeserializeAuthoringConversationsWarning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AuthoringConversationsWarning(code, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support writing '{options.Format}' format."); + } + } + + AuthoringConversationsWarning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAuthoringConversationsWarning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AuthoringConversationsWarning FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAuthoringConversationsWarning(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.cs new file mode 100644 index 000000000000..d95d8f4f8f5c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/AuthoringConversationsWarning.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a warning that was encountered while executing the request. + public partial class AuthoringConversationsWarning + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// or is null. + internal AuthoringConversationsWarning(string code, string message) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + } + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// Keeps track of any properties unknown to the library. + internal AuthoringConversationsWarning(string code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AuthoringConversationsWarning() + { + } + + /// The warning code. + public string Code { get; } + /// The warning message. + public string Message { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CompositionSetting.cs new file mode 100644 index 000000000000..b4be981ec617 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CompositionSetting.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The CompositionSetting. + public readonly partial struct CompositionSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CompositionSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReturnLongestOverlapValue = "returnLongestOverlap"; + private const string RequireExactOverlapValue = "requireExactOverlap"; + private const string SeparateComponentsValue = "separateComponents"; + private const string CombineComponentsValue = "combineComponents"; + + /// When two or more components are found in the text and overlap, the component with the longest set of characters is returned. + public static CompositionSetting ReturnLongestOverlap { get; } = new CompositionSetting(ReturnLongestOverlapValue); + /// All components must overlap at the exact same characters in the text for the entity to return. If one of the defined components is not matched or predicted, the entity will not return. + public static CompositionSetting RequireExactOverlap { get; } = new CompositionSetting(RequireExactOverlapValue); + /// Every component's match or prediction is returned as a separate instance of the entity. + public static CompositionSetting SeparateComponents { get; } = new CompositionSetting(SeparateComponentsValue); + /// When two or more components are found in the text and overlap, the components' spans are merged together into one span combining all of them. + public static CompositionSetting CombineComponents { get; } = new CompositionSetting(CombineComponentsValue); + /// Determines if two values are the same. + public static bool operator ==(CompositionSetting left, CompositionSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CompositionSetting left, CompositionSetting right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CompositionSetting(string value) => new CompositionSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CompositionSetting other && Equals(other); + /// + public bool Equals(CompositionSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs new file mode 100644 index 000000000000..289628a1b94e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConfusionMatrix : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{format}' format."); + } + + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + ConfusionMatrix IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrix(document.RootElement, options); + } + + internal static ConfusionMatrix DeserializeConfusionMatrix(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ConfusionMatrix(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrix IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrix(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrix FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrix(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.cs new file mode 100644 index 000000000000..0334a2da03b5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrix.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The ConfusionMatrix. + public partial class ConfusionMatrix + { + /// Initializes a new instance of . + internal ConfusionMatrix() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal ConfusionMatrix(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs new file mode 100644 index 000000000000..cc2df8970195 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("normalizedValue"u8); + writer.WriteNumberValue(NormalizedValue); + writer.WritePropertyName("rawValue"u8); + writer.WriteNumberValue(RawValue); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrixCell(document.RootElement, options); + } + + internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float normalizedValue = default; + float rawValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("normalizedValue"u8)) + { + normalizedValue = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("rawValue"u8)) + { + rawValue = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrixCell(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrixCell FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrixCell(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.cs new file mode 100644 index 000000000000..f1d43695af13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixCell.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a cell in a confusion matrix. + public partial class ConfusionMatrixCell + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + internal ConfusionMatrixCell(float normalizedValue, float rawValue) + { + NormalizedValue = normalizedValue; + RawValue = rawValue; + } + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + /// Keeps track of any properties unknown to the library. + internal ConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) + { + NormalizedValue = normalizedValue; + RawValue = rawValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConfusionMatrixCell() + { + } + + /// Represents normalized value in percentages. + public float NormalizedValue { get; } + /// Represents raw value. + public float RawValue { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs new file mode 100644 index 000000000000..05e9346b88b7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{format}' format."); + } + + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + ConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrixRow(document.RootElement, options); + } + + internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ConfusionMatrixRow(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrixRow(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrixRow FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrixRow(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.cs new file mode 100644 index 000000000000..f83b84299f2e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConfusionMatrixRow.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The ConfusionMatrixRow. + public partial class ConfusionMatrixRow + { + /// Initializes a new instance of . + internal ConfusionMatrixRow() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal ConfusionMatrixRow(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs new file mode 100644 index 000000000000..ffc9ece17b27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConversationExportedEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedEntity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (Optional.IsDefined(CompositionSetting)) + { + writer.WritePropertyName("compositionSetting"u8); + writer.WriteStringValue(CompositionSetting.Value.ToString()); + } + if (Optional.IsDefined(List)) + { + writer.WritePropertyName("list"u8); + writer.WriteObjectValue(List, options); + } + if (Optional.IsCollectionDefined(Prebuilts)) + { + writer.WritePropertyName("prebuilts"u8); + writer.WriteStartArray(); + foreach (var item in Prebuilts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Regex)) + { + writer.WritePropertyName("regex"u8); + writer.WriteObjectValue(Regex, options); + } + if (Optional.IsCollectionDefined(RequiredComponents)) + { + writer.WritePropertyName("requiredComponents"u8); + writer.WriteStartArray(); + foreach (var item in RequiredComponents) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConversationExportedEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedEntity(document.RootElement, options); + } + + internal static ConversationExportedEntity DeserializeConversationExportedEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + CompositionSetting? compositionSetting = default; + ExportedEntityList list = default; + IList prebuilts = default; + ExportedEntityRegex regex = default; + IList requiredComponents = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("compositionSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compositionSetting = new CompositionSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("list"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + list = ExportedEntityList.DeserializeExportedEntityList(property.Value, options); + continue; + } + if (property.NameEquals("prebuilts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedPrebuiltEntity.DeserializeExportedPrebuiltEntity(item, options)); + } + prebuilts = array; + continue; + } + if (property.NameEquals("regex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regex = ExportedEntityRegex.DeserializeExportedEntityRegex(property.Value, options); + continue; + } + if (property.NameEquals("requiredComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredComponents = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationExportedEntity( + category, + compositionSetting, + list, + prebuilts ?? new ChangeTrackingList(), + regex, + requiredComponents ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConversationExportedEntity)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConversationExportedEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConversationExportedEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs new file mode 100644 index 000000000000..1c617fcdfbb1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedEntity.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an entity with its components. + public partial class ConversationExportedEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The category of the entity. + /// is null. + public ConversationExportedEntity(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Prebuilts = new ChangeTrackingList(); + RequiredComponents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The category of the entity. + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The regex component of the entity. + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + /// Keeps track of any properties unknown to the library. + internal ConversationExportedEntity(string category, CompositionSetting? compositionSetting, ExportedEntityList list, IList prebuilts, ExportedEntityRegex regex, IList requiredComponents, IDictionary serializedAdditionalRawData) + { + Category = category; + CompositionSetting = compositionSetting; + List = list; + Prebuilts = prebuilts; + Regex = regex; + RequiredComponents = requiredComponents; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationExportedEntity() + { + } + + /// The category of the entity. + public string Category { get; } + /// The behavior to follow when the entity's components overlap with each other. + public CompositionSetting? CompositionSetting { get; set; } + /// The list component of the entity. + public ExportedEntityList List { get; set; } + /// The prebuilt entities components. + public IList Prebuilts { get; } + /// The regex component of the entity. + public ExportedEntityRegex Regex { get; set; } + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + public IList RequiredComponents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedIntent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedIntent.Serialization.cs new file mode 100644 index 000000000000..2a9de3a64a43 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedIntent.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConversationExportedIntent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedIntent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConversationExportedIntent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedIntent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedIntent(document.RootElement, options); + } + + internal static ConversationExportedIntent DeserializeConversationExportedIntent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationExportedIntent(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConversationExportedIntent)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedIntent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConversationExportedIntent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedIntent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConversationExportedIntent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedIntent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedIntent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedIntent.cs new file mode 100644 index 000000000000..4409a0b0c7ec --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedIntent.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an exported intent of a conversational project. + public partial class ConversationExportedIntent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The intent category. + /// is null. + public ConversationExportedIntent(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// The intent category. + /// Keeps track of any properties unknown to the library. + internal ConversationExportedIntent(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationExportedIntent() + { + } + + /// The intent category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..ac8e5daf98a1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConversationExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Intents)) + { + writer.WritePropertyName("intents"u8); + writer.WriteStartArray(); + foreach (var item in Intents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Utterances)) + { + writer.WritePropertyName("utterances"u8); + writer.WriteStartArray(); + foreach (var item in Utterances) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ConversationExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedProjectAssets(document.RootElement, options); + } + + internal static ConversationExportedProjectAssets DeserializeConversationExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList intents = default; + IList entities = default; + IList utterances = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("intents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConversationExportedIntent.DeserializeConversationExportedIntent(item, options)); + } + intents = array; + continue; + } + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConversationExportedEntity.DeserializeConversationExportedEntity(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("utterances"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConversationExportedUtterance.DeserializeConversationExportedUtterance(item, options)); + } + utterances = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationExportedProjectAssets(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), entities ?? new ChangeTrackingList(), utterances ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConversationExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ConversationExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.cs new file mode 100644 index 000000000000..2691cb10e99d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedProjectAssets.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the exported assets of a conversational project. + public partial class ConversationExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ConversationExportedProjectAssets() + { + ProjectKind = ProjectKind.Conversation; + Intents = new ChangeTrackingList(); + Entities = new ChangeTrackingList(); + Utterances = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + /// The intents defined in the project. + /// The entities defined in the project. + /// The utterances defined in the project. + internal ConversationExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList entities, IList utterances) : base(projectKind, serializedAdditionalRawData) + { + Intents = intents; + Entities = entities; + Utterances = utterances; + } + + /// The intents defined in the project. + public IList Intents { get; } + /// The entities defined in the project. + public IList Entities { get; } + /// The utterances defined in the project. + public IList Utterances { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs new file mode 100644 index 000000000000..68b49a371f93 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.Serialization.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ConversationExportedUtterance : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedUtterance)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent); + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConversationExportedUtterance IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConversationExportedUtterance)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedUtterance(document.RootElement, options); + } + + internal static ConversationExportedUtterance DeserializeConversationExportedUtterance(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + string text = default; + string language = default; + string intent = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedUtteranceEntityLabel.DeserializeExportedUtteranceEntityLabel(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("intent"u8)) + { + intent = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationExportedUtterance( + entities ?? new ChangeTrackingList(), + text, + language, + intent, + dataset, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConversationExportedUtterance)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedUtterance IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConversationExportedUtterance(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedUtterance)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConversationExportedUtterance FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedUtterance(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs new file mode 100644 index 000000000000..7816b840ba05 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ConversationExportedUtterance.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an exported utterance for a conversational project. + public partial class ConversationExportedUtterance + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The utterance text. + /// The intent of the utterance. + /// or is null. + public ConversationExportedUtterance(string text, string intent) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(intent, nameof(intent)); + + Entities = new ChangeTrackingList(); + Text = text; + Intent = intent; + } + + /// Initializes a new instance of . + /// Represents the entity labels of the utterance. + /// The utterance text. + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ConversationExportedUtterance(IList entities, string text, string language, string intent, string dataset, IDictionary serializedAdditionalRawData) + { + Entities = entities; + Text = text; + Language = language; + Intent = intent; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationExportedUtterance() + { + } + + /// Represents the entity labels of the utterance. + public IList Entities { get; } + /// The utterance text. + public string Text { get; } + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The intent of the utterance. + public string Intent { get; } + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs new file mode 100644 index 000000000000..3267d337db0d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + internal partial class CopyProjectAuthorizationRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + if (Optional.IsDefined(AllowOverwrite)) + { + writer.WritePropertyName("allowOverwrite"u8); + writer.WriteBooleanValue(AllowOverwrite.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyProjectAuthorizationRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement, options); + } + + internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizationRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string storageInputContainerName = default; + bool? allowOverwrite = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowOverwrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowOverwrite = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectAuthorizationRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectAuthorizationRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs new file mode 100644 index 000000000000..e09ac95e521e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The CopyProjectAuthorizationRequest. + internal partial class CopyProjectAuthorizationRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + internal CopyProjectAuthorizationRequest(ProjectKind projectKind) + { + ProjectKind = projectKind; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// Keeps track of any properties unknown to the library. + internal CopyProjectAuthorizationRequest(ProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + AllowOverwrite = allowOverwrite; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectAuthorizationRequest() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The name of the storage container. + public string StorageInputContainerName { get; } + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + public bool? AllowOverwrite { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs new file mode 100644 index 000000000000..079609f4bae5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class CopyProjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("targetProjectName"u8); + writer.WriteStringValue(TargetProjectName); + writer.WritePropertyName("accessToken"u8); + writer.WriteStringValue(AccessToken); + writer.WritePropertyName("expiresAt"u8); + writer.WriteStringValue(ExpiresAt, "O"); + writer.WritePropertyName("targetResourceId"u8); + writer.WriteStringValue(TargetResourceId); + writer.WritePropertyName("targetResourceRegion"u8); + writer.WriteStringValue(TargetResourceRegion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectDetails(document.RootElement, options); + } + + internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string targetProjectName = default; + string accessToken = default; + DateTimeOffset expiresAt = default; + string targetResourceId = default; + string targetResourceRegion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetProjectName"u8)) + { + targetProjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessToken"u8)) + { + accessToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiresAt"u8)) + { + expiresAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("targetResourceId"u8)) + { + targetResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceRegion"u8)) + { + targetResourceRegion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectDetails( + projectKind, + targetProjectName, + accessToken, + expiresAt, + targetResourceId, + targetResourceRegion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs new file mode 100644 index 000000000000..8d0bc4bd02b4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectDetails.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options for copying an existing project to another Azure resource. + public partial class CopyProjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project name to be copied-into. + /// The access token. + /// The expiration of the access token. + /// Represents the target Azure resource ID. + /// Represents the target Azure resource region. + /// , , or is null. + public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) + { + Argument.AssertNotNull(targetProjectName, nameof(targetProjectName)); + Argument.AssertNotNull(accessToken, nameof(accessToken)); + Argument.AssertNotNull(targetResourceId, nameof(targetResourceId)); + Argument.AssertNotNull(targetResourceRegion, nameof(targetResourceRegion)); + + ProjectKind = projectKind; + TargetProjectName = targetProjectName; + AccessToken = accessToken; + ExpiresAt = expiresAt; + TargetResourceId = targetResourceId; + TargetResourceRegion = targetResourceRegion; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project name to be copied-into. + /// The access token. + /// The expiration of the access token. + /// Represents the target Azure resource ID. + /// Represents the target Azure resource region. + /// Keeps track of any properties unknown to the library. + internal CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + TargetProjectName = targetProjectName; + AccessToken = accessToken; + ExpiresAt = expiresAt; + TargetResourceId = targetResourceId; + TargetResourceRegion = targetResourceRegion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectDetails() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; set; } + /// The project name to be copied-into. + public string TargetProjectName { get; set; } + /// The access token. + public string AccessToken { get; set; } + /// The expiration of the access token. + public DateTimeOffset ExpiresAt { get; set; } + /// Represents the target Azure resource ID. + public string TargetResourceId { get; set; } + /// Represents the target Azure resource region. + public string TargetResourceRegion { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs new file mode 100644 index 000000000000..351975e9b155 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class CopyProjectJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectJobState(document.RootElement, options); + } + + internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.cs new file mode 100644 index 000000000000..affeb356c89a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CopyProjectJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a copy job. + public partial class CopyProjectJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal CopyProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal CopyProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs new file mode 100644 index 000000000000..a3ff347a4c4e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class CreateDeploymentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("trainedModelLabel"u8); + writer.WriteStringValue(TrainedModelLabel); + if (Optional.IsCollectionDefined(AssignedResourceIds)) + { + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateDeploymentDetails(document.RootElement, options); + } + + internal static CreateDeploymentDetails DeserializeCreateDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainedModelLabel = default; + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainedModelLabel"u8)) + { + trainedModelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support writing '{options.Format}' format."); + } + } + + CreateDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateDeploymentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateDeploymentDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateDeploymentDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateDeploymentDetails.cs new file mode 100644 index 000000000000..d2968ccadf5a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateDeploymentDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options for creating or updating a project deployment. + public partial class CreateDeploymentDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the trained model label. + /// is null. + public CreateDeploymentDetails(string trainedModelLabel) + { + Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); + + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the trained model label. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// Keeps track of any properties unknown to the library. + internal CreateDeploymentDetails(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateDeploymentDetails() + { + } + + /// Represents the trained model label. + public string TrainedModelLabel { get; } + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs new file mode 100644 index 000000000000..5d8062fd3505 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class CreateProjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateProjectDetails(document.RootElement, options); + } + + internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + ProjectSettings settings = default; + string storageInputContainerName = default; + string projectName = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateProjectDetails( + projectKind, + settings, + storageInputContainerName, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support writing '{options.Format}' format."); + } + } + + CreateProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateProjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateProjectDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateProjectDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs new file mode 100644 index 000000000000..3d21a556966e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/CreateProjectDetails.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options used to create or update a project. + public partial class CreateProjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + /// The new project name. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// or is null. + public CreateProjectDetails(ProjectKind projectKind, string projectName, string language) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + ProjectKind = projectKind; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal CreateProjectDetails(ProjectKind projectKind, ProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + Settings = settings; + StorageInputContainerName = storageInputContainerName; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateProjectDetails() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The project settings. + public ProjectSettings Settings { get; set; } + /// The storage container name in case of conversation summarization. + public string StorageInputContainerName { get; set; } + /// The new project name. + public string ProjectName { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; set; } + /// The project description. + public string Description { get; set; } + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs new file mode 100644 index 000000000000..33d8c05f5bcc --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class DeleteDeploymentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AssignedResourceIds)) + { + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeleteDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeleteDeploymentDetails(document.RootElement, options); + } + + internal static DeleteDeploymentDetails DeserializeDeleteDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeleteDeploymentDetails(assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support writing '{options.Format}' format."); + } + } + + DeleteDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeleteDeploymentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeleteDeploymentDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeleteDeploymentDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs new file mode 100644 index 000000000000..316e05a21637 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options for deleting a project deployment. + public partial class DeleteDeploymentDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeleteDeploymentDetails() + { + AssignedResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the resource IDs to delete the deployment from. If not provided, the deployment will be rolled out from all the resources it is deployed to. If provided, it will delete the deployment only from the specified assigned resources, and leave it for the rest. + /// Keeps track of any properties unknown to the library. + internal DeleteDeploymentDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the resource IDs to delete the deployment from. If not provided, the deployment will be rolled out from all the resources it is deployed to. If provided, it will delete the deployment only from the specified assigned resources, and leave it for the rest. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs new file mode 100644 index 000000000000..f2db094604c4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class DeploymentDeleteFromResourcesJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentDeleteFromResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + } + + internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDeleteFromResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentDeleteFromResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{options.Format}' format."); + } + } + + DeploymentDeleteFromResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentDeleteFromResourcesJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs new file mode 100644 index 000000000000..4e1ee9ed2c1c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of an existing delete deployment from specific resources job. + public partial class DeploymentDeleteFromResourcesJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal DeploymentDeleteFromResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal DeploymentDeleteFromResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentDeleteFromResourcesJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs new file mode 100644 index 000000000000..bc975cd541a8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class DeploymentJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentJobState(document.RootElement, options); + } + + internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{options.Format}' format."); + } + } + + DeploymentJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.cs new file mode 100644 index 000000000000..3b027b6d8460 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a deployment job. + public partial class DeploymentJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal DeploymentJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal DeploymentJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs new file mode 100644 index 000000000000..9b3584664355 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class DeploymentResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentResource(document.RootElement, options); + } + + internal static DeploymentResource DeserializeDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceId = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentResource(resourceId, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{options.Format}' format."); + } + } + + DeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResource.cs new file mode 100644 index 000000000000..3f4266909d51 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResource.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an Azure resource assigned to a deployment. + public partial class DeploymentResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// or is null. + internal DeploymentResource(string resourceId, string region) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + Argument.AssertNotNull(region, nameof(region)); + + ResourceId = resourceId; + Region = region; + } + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// Keeps track of any properties unknown to the library. + internal DeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentResource() + { + } + + /// Represents the Azure resource Id. + public string ResourceId { get; } + /// Represents the resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.Serialization.cs new file mode 100644 index 000000000000..c868942c403f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class DeploymentResourcesJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentResourcesJobState(document.RootElement, options); + } + + internal static DeploymentResourcesJobState DeserializeDeploymentResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support writing '{options.Format}' format."); + } + } + + DeploymentResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentResourcesJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentResourcesJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentResourcesJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentResourcesJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.cs new file mode 100644 index 000000000000..1448217b4dbd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/DeploymentResourcesJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a deployment resources job. + public partial class DeploymentResourcesJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal DeploymentResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal DeploymentResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentResourcesJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..c47755962689 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class EntitiesEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntitiesEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("entities"u8); + writer.WriteStartObject(); + foreach (var item in Entities) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EntitiesEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntitiesEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntitiesEvaluationSummary(document.RootElement, options); + } + + internal static EntitiesEvaluationSummary DeserializeEntitiesEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary entities = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("entities"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, EntityEvaluationSummary.DeserializeEntityEvaluationSummary(property0.Value, options)); + } + entities = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntitiesEvaluationSummary( + confusionMatrix, + entities, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntitiesEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntitiesEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntitiesEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntitiesEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EntitiesEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntitiesEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs new file mode 100644 index 000000000000..1ba5c2a42ed7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntitiesEvaluationSummary.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the evaluation result summary for the project's entities. + public partial class EntitiesEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + /// Represents the entities evaluation summary. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// or is null. + internal EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(entities, nameof(entities)); + + ConfusionMatrix = confusionMatrix; + Entities = entities; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + /// Represents the entities evaluation summary. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal EntitiesEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Entities = entities; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntitiesEvaluationSummary() + { + } + + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the entities evaluation summary. + public IReadOnlyDictionary Entities { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..878ad1dcd845 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class EntityEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EntityEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityEvaluationSummary(document.RootElement, options); + } + + internal static EntityEvaluationSummary DeserializeEntityEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntityEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EntityEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntityEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs new file mode 100644 index 000000000000..131743f41f7b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EntityEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the evaluation result for an entity. + public partial class EntityEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntityEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ErrorCode.cs new file mode 100644 index 000000000000..977595b99c5f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ErrorCode.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Human-readable error code. + public readonly partial struct ErrorCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ErrorCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidRequestValue = "InvalidRequest"; + private const string InvalidArgumentValue = "InvalidArgument"; + private const string UnauthorizedValue = "Unauthorized"; + private const string ForbiddenValue = "Forbidden"; + private const string NotFoundValue = "NotFound"; + private const string ProjectNotFoundValue = "ProjectNotFound"; + private const string OperationNotFoundValue = "OperationNotFound"; + private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; + private const string AzureCognitiveSearchIndexNotFoundValue = "AzureCognitiveSearchIndexNotFound"; + private const string TooManyRequestsValue = "TooManyRequests"; + private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; + private const string AzureCognitiveSearchIndexLimitReachedValue = "AzureCognitiveSearchIndexLimitReached"; + private const string InternalServerErrorValue = "InternalServerError"; + private const string ServiceUnavailableValue = "ServiceUnavailable"; + private const string TimeoutValue = "Timeout"; + private const string QuotaExceededValue = "QuotaExceeded"; + private const string ConflictValue = "Conflict"; + private const string WarningValue = "Warning"; + + /// InvalidRequest. + public static ErrorCode InvalidRequest { get; } = new ErrorCode(InvalidRequestValue); + /// InvalidArgument. + public static ErrorCode InvalidArgument { get; } = new ErrorCode(InvalidArgumentValue); + /// Unauthorized. + public static ErrorCode Unauthorized { get; } = new ErrorCode(UnauthorizedValue); + /// Forbidden. + public static ErrorCode Forbidden { get; } = new ErrorCode(ForbiddenValue); + /// NotFound. + public static ErrorCode NotFound { get; } = new ErrorCode(NotFoundValue); + /// ProjectNotFound. + public static ErrorCode ProjectNotFound { get; } = new ErrorCode(ProjectNotFoundValue); + /// OperationNotFound. + public static ErrorCode OperationNotFound { get; } = new ErrorCode(OperationNotFoundValue); + /// AzureCognitiveSearchNotFound. + public static ErrorCode AzureCognitiveSearchNotFound { get; } = new ErrorCode(AzureCognitiveSearchNotFoundValue); + /// AzureCognitiveSearchIndexNotFound. + public static ErrorCode AzureCognitiveSearchIndexNotFound { get; } = new ErrorCode(AzureCognitiveSearchIndexNotFoundValue); + /// TooManyRequests. + public static ErrorCode TooManyRequests { get; } = new ErrorCode(TooManyRequestsValue); + /// AzureCognitiveSearchThrottling. + public static ErrorCode AzureCognitiveSearchThrottling { get; } = new ErrorCode(AzureCognitiveSearchThrottlingValue); + /// AzureCognitiveSearchIndexLimitReached. + public static ErrorCode AzureCognitiveSearchIndexLimitReached { get; } = new ErrorCode(AzureCognitiveSearchIndexLimitReachedValue); + /// InternalServerError. + public static ErrorCode InternalServerError { get; } = new ErrorCode(InternalServerErrorValue); + /// ServiceUnavailable. + public static ErrorCode ServiceUnavailable { get; } = new ErrorCode(ServiceUnavailableValue); + /// Timeout. + public static ErrorCode Timeout { get; } = new ErrorCode(TimeoutValue); + /// QuotaExceeded. + public static ErrorCode QuotaExceeded { get; } = new ErrorCode(QuotaExceededValue); + /// Conflict. + public static ErrorCode Conflict { get; } = new ErrorCode(ConflictValue); + /// Warning. + public static ErrorCode Warning { get; } = new ErrorCode(WarningValue); + /// Determines if two values are the same. + public static bool operator ==(ErrorCode left, ErrorCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ErrorCode left, ErrorCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ErrorCode(string value) => new ErrorCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ErrorCode other && Equals(other); + /// + public bool Equals(ErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs new file mode 100644 index 000000000000..2a72e648962b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class EvaluationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + if (Optional.IsDefined(TrainingSplitPercentage)) + { + writer.WritePropertyName("trainingSplitPercentage"u8); + writer.WriteNumberValue(TrainingSplitPercentage.Value); + } + if (Optional.IsDefined(TestingSplitPercentage)) + { + writer.WritePropertyName("testingSplitPercentage"u8); + writer.WriteNumberValue(TestingSplitPercentage.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationDetails(document.RootElement, options); + } + + internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EvaluationKind? kind = default; + int? trainingSplitPercentage = default; + int? testingSplitPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new EvaluationKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingSplitPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trainingSplitPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("testingSplitPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testingSplitPercentage = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationDetails(kind, trainingSplitPercentage, testingSplitPercentage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support writing '{options.Format}' format."); + } + } + + EvaluationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs new file mode 100644 index 000000000000..c843e5d23f9b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationDetails.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options used running the evaluation. + public partial class EvaluationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EvaluationDetails() + { + } + + /// Initializes a new instance of . + /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. + /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. + /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. + /// Keeps track of any properties unknown to the library. + internal EvaluationDetails(EvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) + { + Kind = kind; + TrainingSplitPercentage = trainingSplitPercentage; + TestingSplitPercentage = testingSplitPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. + public EvaluationKind? Kind { get; set; } + /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. + public int? TrainingSplitPercentage { get; set; } + /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. + public int? TestingSplitPercentage { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs new file mode 100644 index 000000000000..a42d020c0f60 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class EvaluationJobResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationJobResult(document.RootElement, options); + } + + internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EvaluationDetails evaluationOptions = default; + string modelLabel = default; + string trainingConfigVersion = default; + int percentComplete = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + percentComplete = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{options.Format}' format."); + } + } + + EvaluationJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationJobResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationJobResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationJobResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs new file mode 100644 index 000000000000..66c98233abbd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobResult.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The EvaluationJobResult. + public partial class EvaluationJobResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// , or is null. + internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + + EvaluationOptions = evaluationOptions; + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + PercentComplete = percentComplete; + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// Keeps track of any properties unknown to the library. + internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) + { + EvaluationOptions = evaluationOptions; + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + PercentComplete = percentComplete; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationJobResult() + { + } + + /// Represents the options used running the evaluation. + public EvaluationDetails EvaluationOptions { get; } + /// Represents trained model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents progress percentage. + public int PercentComplete { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs new file mode 100644 index 000000000000..724796e50c91 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class EvaluationJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationJobState(document.RootElement, options); + } + + internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + EvaluationJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = EvaluationJobResult.DeserializeEvaluationJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{options.Format}' format."); + } + } + + EvaluationJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.cs new file mode 100644 index 000000000000..fba4e55b822e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationJobState.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a evaluation job. + public partial class EvaluationJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents evaluation task detailed result. + /// is null. + internal EvaluationJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, EvaluationJobResult result) + { + Argument.AssertNotNull(result, nameof(result)); + + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents evaluation task detailed result. + /// Keeps track of any properties unknown to the library. + internal EvaluationJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, EvaluationJobResult result, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents evaluation task detailed result. + public EvaluationJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationKind.cs new file mode 100644 index 000000000000..9b1349bc8470 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The EvaluationKind. + public readonly partial struct EvaluationKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EvaluationKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PercentageValue = "percentage"; + private const string ManualValue = "manual"; + + /// Split the data into training and test sets according to user-defined percentages. + public static EvaluationKind Percentage { get; } = new EvaluationKind(PercentageValue); + /// Split the data according to the chosen dataset for every example in the data. + public static EvaluationKind Manual { get; } = new EvaluationKind(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(EvaluationKind left, EvaluationKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EvaluationKind left, EvaluationKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EvaluationKind(string value) => new EvaluationKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EvaluationKind other && Equals(other); + /// + public bool Equals(EvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..a0f36f651de7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class EvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("entitiesEvaluation"u8); + writer.WriteObjectValue(EntitiesEvaluation, options); + writer.WritePropertyName("intentsEvaluation"u8); + writer.WriteObjectValue(IntentsEvaluation, options); + if (Optional.IsDefined(EvaluationOptions)) + { + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationSummary(document.RootElement, options); + } + + internal static EvaluationSummary DeserializeEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntitiesEvaluationSummary entitiesEvaluation = default; + IntentsEvaluationSummary intentsEvaluation = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entitiesEvaluation"u8)) + { + entitiesEvaluation = EntitiesEvaluationSummary.DeserializeEntitiesEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("intentsEvaluation"u8)) + { + intentsEvaluation = IntentsEvaluationSummary.DeserializeIntentsEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationSummary(entitiesEvaluation, intentsEvaluation, evaluationOptions, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationSummary.cs new file mode 100644 index 000000000000..94a75419a4d3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/EvaluationSummary.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the evaluation result summary. + public partial class EvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Contains the data related to entities evaluation. + /// Contains the data related to intents evaluation. + /// or is null. + internal EvaluationSummary(EntitiesEvaluationSummary entitiesEvaluation, IntentsEvaluationSummary intentsEvaluation) + { + Argument.AssertNotNull(entitiesEvaluation, nameof(entitiesEvaluation)); + Argument.AssertNotNull(intentsEvaluation, nameof(intentsEvaluation)); + + EntitiesEvaluation = entitiesEvaluation; + IntentsEvaluation = intentsEvaluation; + } + + /// Initializes a new instance of . + /// Contains the data related to entities evaluation. + /// Contains the data related to intents evaluation. + /// The options that were used while running the evaluation. + /// Keeps track of any properties unknown to the library. + internal EvaluationSummary(EntitiesEvaluationSummary entitiesEvaluation, IntentsEvaluationSummary intentsEvaluation, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) + { + EntitiesEvaluation = entitiesEvaluation; + IntentsEvaluation = intentsEvaluation; + EvaluationOptions = evaluationOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationSummary() + { + } + + /// Contains the data related to entities evaluation. + public EntitiesEvaluationSummary EntitiesEvaluation { get; } + /// Contains the data related to intents evaluation. + public IntentsEvaluationSummary IntentsEvaluation { get; } + /// The options that were used while running the evaluation. + public EvaluationDetails EvaluationOptions { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs new file mode 100644 index 000000000000..954191e78e64 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportProjectJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ResultUrl)) + { + writer.WritePropertyName("resultUrl"u8); + writer.WriteStringValue(ResultUrl); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportProjectJobState(document.RootElement, options); + } + + internal static ExportProjectJobState DeserializeExportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + string resultUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("resultUrl"u8)) + { + resultUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + resultUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{options.Format}' format."); + } + } + + ExportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportProjectJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportProjectJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportProjectJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.cs new file mode 100644 index 000000000000..3ba56b46d8d9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportProjectJobState.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of an export job. + public partial class ExportProjectJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ExportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// Keeps track of any properties unknown to the library. + internal ExportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUrl, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + ResultUrl = resultUrl; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportProjectJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// The URL to use in order to download the exported project. + public string ResultUrl { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestration.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestration.Serialization.cs new file mode 100644 index 000000000000..41c601cc632d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestration.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedConversationOrchestration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedConversationOrchestration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedConversationOrchestration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedConversationOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedConversationOrchestration(document.RootElement, options); + } + + internal static ExportedConversationOrchestration DeserializeExportedConversationOrchestration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = default; + string deploymentName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedConversationOrchestration(projectName, deploymentName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedConversationOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedConversationOrchestration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedConversationOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedConversationOrchestration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedConversationOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedConversationOrchestration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestration.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestration.cs new file mode 100644 index 000000000000..f57a2d7bf8e4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestration.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Defines the orchestration details for a Conversational project target. + public partial class ExportedConversationOrchestration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the targeted project. + /// The name of the targeted deployment. + /// or is null. + public ExportedConversationOrchestration(string projectName, string deploymentName) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + ProjectName = projectName; + DeploymentName = deploymentName; + } + + /// Initializes a new instance of . + /// The name of the targeted project. + /// The name of the targeted deployment. + /// Keeps track of any properties unknown to the library. + internal ExportedConversationOrchestration(string projectName, string deploymentName, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedConversationOrchestration() + { + } + + /// The name of the targeted project. + public string ProjectName { get; } + /// The name of the targeted deployment. + public string DeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestrationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestrationDetails.Serialization.cs new file mode 100644 index 000000000000..a9ce67575e81 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestrationDetails.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedConversationOrchestrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedConversationOrchestrationDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("conversationOrchestration"u8); + writer.WriteObjectValue(ConversationOrchestration, options); + } + + ExportedConversationOrchestrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedConversationOrchestrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedConversationOrchestrationDetails(document.RootElement, options); + } + + internal static ExportedConversationOrchestrationDetails DeserializeExportedConversationOrchestrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedConversationOrchestration conversationOrchestration = default; + OrchestrationTargetProjectKind targetProjectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("conversationOrchestration"u8)) + { + conversationOrchestration = ExportedConversationOrchestration.DeserializeExportedConversationOrchestration(property.Value, options); + continue; + } + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedConversationOrchestrationDetails(targetProjectKind, serializedAdditionalRawData, conversationOrchestration); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedConversationOrchestrationDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedConversationOrchestrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedConversationOrchestrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedConversationOrchestrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedConversationOrchestrationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedConversationOrchestrationDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestrationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestrationDetails.cs new file mode 100644 index 000000000000..5608bc103013 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedConversationOrchestrationDetails.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the orchestration options for a Conversational project target. + public partial class ExportedConversationOrchestrationDetails : ExportedOrchestrationDetails + { + /// Initializes a new instance of . + /// The Conversational project target details. + /// is null. + public ExportedConversationOrchestrationDetails(ExportedConversationOrchestration conversationOrchestration) + { + Argument.AssertNotNull(conversationOrchestration, nameof(conversationOrchestration)); + + TargetProjectKind = OrchestrationTargetProjectKind.Conversation; + ConversationOrchestration = conversationOrchestration; + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The Conversational project target details. + internal ExportedConversationOrchestrationDetails(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData, ExportedConversationOrchestration conversationOrchestration) : base(targetProjectKind, serializedAdditionalRawData) + { + ConversationOrchestration = conversationOrchestration; + } + + /// Initializes a new instance of for deserialization. + internal ExportedConversationOrchestrationDetails() + { + } + + /// The Conversational project target details. + public ExportedConversationOrchestration ConversationOrchestration { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs new file mode 100644 index 000000000000..31982aed6e1b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedEntityList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Sublists)) + { + writer.WritePropertyName("sublists"u8); + writer.WriteStartArray(); + foreach (var item in Sublists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntityList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityList(document.RootElement, options); + } + + internal static ExportedEntityList DeserializeExportedEntityList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList sublists = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sublists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntitySublist.DeserializeExportedEntitySublist(item, options)); + } + sublists = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityList(sublists ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityList FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityList(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityList.cs new file mode 100644 index 000000000000..cfe3c92bcbc9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityList.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a list component of an entity. + public partial class ExportedEntityList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityList() + { + Sublists = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The sub-lists of the list component. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityList(IList sublists, IDictionary serializedAdditionalRawData) + { + Sublists = sublists; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sub-lists of the list component. + public IList Sublists { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs new file mode 100644 index 000000000000..d004442e624e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedEntityListSynonym : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"u8); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntityListSynonym IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityListSynonym(document.RootElement, options); + } + + internal static ExportedEntityListSynonym DeserializeExportedEntityListSynonym(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string language = default; + IList values = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + values = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityListSynonym(language, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityListSynonym IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityListSynonym(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityListSynonym FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityListSynonym(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs new file mode 100644 index 000000000000..2ba86e1499c0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a list of synonyms inside a list component. + public partial class ExportedEntityListSynonym + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityListSynonym() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the language of the synonyms. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The list of synonyms. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityListSynonym(string language, IList values, IDictionary serializedAdditionalRawData) + { + Language = language; + Values = values; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the language of the synonyms. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The list of synonyms. + public IList Values { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegex.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegex.Serialization.cs new file mode 100644 index 000000000000..fa55b4f257a9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegex.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedEntityRegex : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityRegex)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Expressions)) + { + writer.WritePropertyName("expressions"u8); + writer.WriteStartArray(); + foreach (var item in Expressions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntityRegex IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityRegex)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityRegex(document.RootElement, options); + } + + internal static ExportedEntityRegex DeserializeExportedEntityRegex(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList expressions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expressions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntityRegexExpression.DeserializeExportedEntityRegexExpression(item, options)); + } + expressions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityRegex(expressions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityRegex)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityRegex IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityRegex(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityRegex)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityRegex FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityRegex(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegex.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegex.cs new file mode 100644 index 000000000000..078e0e0daf90 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegex.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a regex component of an entity. + public partial class ExportedEntityRegex + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityRegex() + { + Expressions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The regex expressions of the regex component. These expressions follow the .NET regex syntax. For reference, check here: https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityRegex(IList expressions, IDictionary serializedAdditionalRawData) + { + Expressions = expressions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The regex expressions of the regex component. These expressions follow the .NET regex syntax. For reference, check here: https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions. + public IList Expressions { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegexExpression.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegexExpression.Serialization.cs new file mode 100644 index 000000000000..2d8b82b34d22 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegexExpression.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedEntityRegexExpression : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityRegexExpression)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RegexKey)) + { + writer.WritePropertyName("regexKey"u8); + writer.WriteStringValue(RegexKey); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(RegexPattern)) + { + writer.WritePropertyName("regexPattern"u8); + writer.WriteStringValue(RegexPattern); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntityRegexExpression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityRegexExpression)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityRegexExpression(document.RootElement, options); + } + + internal static ExportedEntityRegexExpression DeserializeExportedEntityRegexExpression(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string regexKey = default; + string language = default; + string regexPattern = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("regexKey"u8)) + { + regexKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("regexPattern"u8)) + { + regexPattern = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityRegexExpression(regexKey, language, regexPattern, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityRegexExpression)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityRegexExpression IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityRegexExpression(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityRegexExpression)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityRegexExpression FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityRegexExpression(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegexExpression.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegexExpression.cs new file mode 100644 index 000000000000..7237a35366ba --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntityRegexExpression.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a regex expression inside a regex component. This expression follows the .NET regex syntax. For reference, check here: https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions. + public partial class ExportedEntityRegexExpression + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityRegexExpression() + { + } + + /// Initializes a new instance of . + /// The key of the regex expression. + /// Represents the language of the regex expression. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The regex pattern. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityRegexExpression(string regexKey, string language, string regexPattern, IDictionary serializedAdditionalRawData) + { + RegexKey = regexKey; + Language = language; + RegexPattern = regexPattern; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The key of the regex expression. + public string RegexKey { get; set; } + /// Represents the language of the regex expression. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The regex pattern. + public string RegexPattern { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs new file mode 100644 index 000000000000..f92a3ac58325 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedEntitySublist : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ListKey)) + { + writer.WritePropertyName("listKey"u8); + writer.WriteStringValue(ListKey); + } + if (Optional.IsCollectionDefined(Synonyms)) + { + writer.WritePropertyName("synonyms"u8); + writer.WriteStartArray(); + foreach (var item in Synonyms) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntitySublist IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntitySublist(document.RootElement, options); + } + + internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string listKey = default; + IList synonyms = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("listKey"u8)) + { + listKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("synonyms"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntityListSynonym.DeserializeExportedEntityListSynonym(item, options)); + } + synonyms = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntitySublist(listKey, synonyms ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntitySublist IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntitySublist(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntitySublist FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntitySublist(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntitySublist.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntitySublist.cs new file mode 100644 index 000000000000..1b8e6399c72f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedEntitySublist.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a sub-list inside a list component. + public partial class ExportedEntitySublist + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntitySublist() + { + Synonyms = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The key of the sub-list. + /// The phrases of that correspond to the sub-list. + /// Keeps track of any properties unknown to the library. + internal ExportedEntitySublist(string listKey, IList synonyms, IDictionary serializedAdditionalRawData) + { + ListKey = listKey; + Synonyms = synonyms; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The key of the sub-list. + public string ListKey { get; set; } + /// The phrases of that correspond to the sub-list. + public IList Synonyms { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs new file mode 100644 index 000000000000..423733bd7bc6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedLuisOrchestration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedLuisOrchestration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appId"u8); + writer.WriteStringValue(AppId); + if (Optional.IsDefined(AppVersion)) + { + writer.WritePropertyName("appVersion"u8); + writer.WriteStringValue(AppVersion); + } + if (Optional.IsDefined(SlotName)) + { + writer.WritePropertyName("slotName"u8); + writer.WriteStringValue(SlotName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedLuisOrchestration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedLuisOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedLuisOrchestration(document.RootElement, options); + } + + internal static ExportedLuisOrchestration DeserializeExportedLuisOrchestration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid appId = default; + string appVersion = default; + string slotName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appId"u8)) + { + appId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("appVersion"u8)) + { + appVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("slotName"u8)) + { + slotName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedLuisOrchestration(appId, appVersion, slotName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedLuisOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedLuisOrchestration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedLuisOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedLuisOrchestration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedLuisOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedLuisOrchestration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestration.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestration.cs new file mode 100644 index 000000000000..54f3c5b3567d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestration.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Defines the orchestration details for a LUIS application target. + public partial class ExportedLuisOrchestration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The LUIS application ID. + public ExportedLuisOrchestration(Guid appId) + { + AppId = appId; + } + + /// Initializes a new instance of . + /// The LUIS application ID. + /// The targeted version Id. + /// The targeted slot name. + /// Keeps track of any properties unknown to the library. + internal ExportedLuisOrchestration(Guid appId, string appVersion, string slotName, IDictionary serializedAdditionalRawData) + { + AppId = appId; + AppVersion = appVersion; + SlotName = slotName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedLuisOrchestration() + { + } + + /// The LUIS application ID. + public Guid AppId { get; } + /// The targeted version Id. + public string AppVersion { get; set; } + /// The targeted slot name. + public string SlotName { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestrationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestrationDetails.Serialization.cs new file mode 100644 index 000000000000..7b9f2c6942fc --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestrationDetails.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedLuisOrchestrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedLuisOrchestrationDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("luisOrchestration"u8); + writer.WriteObjectValue(LuisOrchestration, options); + } + + ExportedLuisOrchestrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedLuisOrchestrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedLuisOrchestrationDetails(document.RootElement, options); + } + + internal static ExportedLuisOrchestrationDetails DeserializeExportedLuisOrchestrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedLuisOrchestration luisOrchestration = default; + OrchestrationTargetProjectKind targetProjectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("luisOrchestration"u8)) + { + luisOrchestration = ExportedLuisOrchestration.DeserializeExportedLuisOrchestration(property.Value, options); + continue; + } + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedLuisOrchestrationDetails(targetProjectKind, serializedAdditionalRawData, luisOrchestration); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedLuisOrchestrationDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedLuisOrchestrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedLuisOrchestrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedLuisOrchestrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedLuisOrchestrationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedLuisOrchestrationDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestrationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestrationDetails.cs new file mode 100644 index 000000000000..a8f05290d6be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedLuisOrchestrationDetails.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the orchestration options for a LUIS application target. + public partial class ExportedLuisOrchestrationDetails : ExportedOrchestrationDetails + { + /// Initializes a new instance of . + /// The LUIS application target details. + /// is null. + public ExportedLuisOrchestrationDetails(ExportedLuisOrchestration luisOrchestration) + { + Argument.AssertNotNull(luisOrchestration, nameof(luisOrchestration)); + + TargetProjectKind = OrchestrationTargetProjectKind.Luis; + LuisOrchestration = luisOrchestration; + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The LUIS application target details. + internal ExportedLuisOrchestrationDetails(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData, ExportedLuisOrchestration luisOrchestration) : base(targetProjectKind, serializedAdditionalRawData) + { + LuisOrchestration = luisOrchestration; + } + + /// Initializes a new instance of for deserialization. + internal ExportedLuisOrchestrationDetails() + { + } + + /// The LUIS application target details. + public ExportedLuisOrchestration LuisOrchestration { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs new file mode 100644 index 000000000000..d013d638887f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedModelDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("trainedModelLabel"u8); + writer.WriteStringValue(TrainedModelLabel); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedModelDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelDetails(document.RootElement, options); + } + + internal static ExportedModelDetails DeserializeExportedModelDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainedModelLabel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainedModelLabel"u8)) + { + trainedModelLabel = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelDetails(trainedModelLabel, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelDetails.cs new file mode 100644 index 000000000000..8a3b7c00553f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelDetails.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options for creating or replacing an exported model. + public partial class ExportedModelDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The trained model label. + /// is null. + public ExportedModelDetails(string trainedModelLabel) + { + Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); + + TrainedModelLabel = trainedModelLabel; + } + + /// Initializes a new instance of . + /// The trained model label. + /// Keeps track of any properties unknown to the library. + internal ExportedModelDetails(string trainedModelLabel, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelDetails() + { + } + + /// The trained model label. + public string TrainedModelLabel { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs new file mode 100644 index 000000000000..2d5ee327c04c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedModelJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedModelJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelJobState(document.RootElement, options); + } + + internal static ExportedModelJobState DeserializeExportedModelJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.cs new file mode 100644 index 000000000000..639c21edbf42 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedModelJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a job to create or updated an exported model. + public partial class ExportedModelJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ExportedModelJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal ExportedModelJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedOrchestrationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedOrchestrationDetails.Serialization.cs new file mode 100644 index 000000000000..e02847527d4a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedOrchestrationDetails.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + [PersistableModelProxy(typeof(UnknownExportedOrchestrationDetails))] + public partial class ExportedOrchestrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("targetProjectKind"u8); + writer.WriteStringValue(TargetProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedOrchestrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedOrchestrationDetails(document.RootElement, options); + } + + internal static ExportedOrchestrationDetails DeserializeExportedOrchestrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("targetProjectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Conversation": return ExportedConversationOrchestrationDetails.DeserializeExportedConversationOrchestrationDetails(element, options); + case "Luis": return ExportedLuisOrchestrationDetails.DeserializeExportedLuisOrchestrationDetails(element, options); + case "QuestionAnswering": return ExportedQuestionAnsweringOrchestrationDetails.DeserializeExportedQuestionAnsweringOrchestrationDetails(element, options); + } + } + return UnknownExportedOrchestrationDetails.DeserializeUnknownExportedOrchestrationDetails(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedOrchestrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedOrchestrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedOrchestrationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedOrchestrationDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedOrchestrationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedOrchestrationDetails.cs new file mode 100644 index 000000000000..3316c6506c99 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedOrchestrationDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// + /// Represents the options used to define the orchestration behavior of an intent. + /// 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 ExportedOrchestrationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ExportedOrchestrationDetails() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedOrchestrationDetails(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData) + { + TargetProjectKind = targetProjectKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the target project kind. + internal OrchestrationTargetProjectKind TargetProjectKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..a217e3a5eaf3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedPrebuiltEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedPrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedPrebuiltEntity(document.RootElement, options); + } + + internal static ExportedPrebuiltEntity DeserializeExportedPrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedPrebuiltEntity(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedPrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedPrebuiltEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedPrebuiltEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedPrebuiltEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs new file mode 100644 index 000000000000..a5055390057e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an exported prebuilt entity component. + public partial class ExportedPrebuiltEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// is null. + public ExportedPrebuiltEntity(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// Keeps track of any properties unknown to the library. + internal ExportedPrebuiltEntity(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedPrebuiltEntity() + { + } + + /// The prebuilt entity category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs new file mode 100644 index 000000000000..c27bdef7d60f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedProject : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectFileVersion"u8); + writer.WriteStringValue(ProjectFileVersion); + writer.WritePropertyName("stringIndexType"u8); + writer.WriteStringValue(StringIndexType.ToString()); + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata, options); + if (Optional.IsDefined(Assets)) + { + writer.WritePropertyName("assets"u8); + writer.WriteObjectValue(Assets, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedProject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProject(document.RootElement, options); + } + + internal static ExportedProject DeserializeExportedProject(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectFileVersion = default; + StringIndexType stringIndexType = default; + CreateProjectDetails metadata = default; + ExportedProjectAssets assets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectFileVersion"u8)) + { + projectFileVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("stringIndexType"u8)) + { + stringIndexType = new StringIndexType(property.Value.GetString()); + continue; + } + if (property.NameEquals("metadata"u8)) + { + metadata = CreateProjectDetails.DeserializeCreateProjectDetails(property.Value, options); + continue; + } + if (property.NameEquals("assets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assets = ExportedProjectAssets.DeserializeExportedProjectAssets(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{options.Format}' format."); + } + } + + ExportedProject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProject(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedProject FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedProject(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs new file mode 100644 index 000000000000..75bdf301aa5e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProject.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an exported project. + public partial class ExportedProject + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// or is null. + public ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata) + { + Argument.AssertNotNull(projectFileVersion, nameof(projectFileVersion)); + Argument.AssertNotNull(metadata, nameof(metadata)); + + ProjectFileVersion = projectFileVersion; + StringIndexType = stringIndexType; + Metadata = metadata; + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// + /// Represents the project assets. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata, ExportedProjectAssets assets, IDictionary serializedAdditionalRawData) + { + ProjectFileVersion = projectFileVersion; + StringIndexType = stringIndexType; + Metadata = metadata; + Assets = assets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedProject() + { + } + + /// The version of the exported file. + public string ProjectFileVersion { get; } + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + public StringIndexType StringIndexType { get; } + /// Represents the project metadata. + public CreateProjectDetails Metadata { get; } + /// + /// Represents the project assets. + /// 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 ExportedProjectAssets Assets { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..6fe2e7b2ffc0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + [PersistableModelProxy(typeof(UnknownExportedProjectAssets))] + public partial class ExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + + internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Conversation": return ConversationExportedProjectAssets.DeserializeConversationExportedProjectAssets(element, options); + case "Orchestration": return OrchestrationExportedProjectAssets.DeserializeOrchestrationExportedProjectAssets(element, options); + } + } + return UnknownExportedProjectAssets.DeserializeUnknownExportedProjectAssets(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.cs new file mode 100644 index 000000000000..c039092126af --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectAssets.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// + /// Represents the assets of an exported project. + /// 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 ExportedProjectAssets + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ExportedProjectAssets() + { + } + + /// Initializes a new instance of . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + internal ExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of project containing the assets. + internal ProjectKind ProjectKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectFormat.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectFormat.cs new file mode 100644 index 000000000000..2792adaccde8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedProjectFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The ExportedProjectFormat. + public readonly partial struct ExportedProjectFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExportedProjectFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConversationValue = "Conversation"; + private const string LuisValue = "Luis"; + + /// Specifies the format for a conversational project. + public static ExportedProjectFormat Conversation { get; } = new ExportedProjectFormat(ConversationValue); + /// Specifies the format for an application that was exported from LUIS. + public static ExportedProjectFormat Luis { get; } = new ExportedProjectFormat(LuisValue); + /// Determines if two values are the same. + public static bool operator ==(ExportedProjectFormat left, ExportedProjectFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExportedProjectFormat left, ExportedProjectFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExportedProjectFormat(string value) => new ExportedProjectFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExportedProjectFormat other && Equals(other); + /// + public bool Equals(ExportedProjectFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs new file mode 100644 index 000000000000..ab72de03ab0b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedQuestionAnsweringOrchestration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedQuestionAnsweringOrchestration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement, options); + } + + internal static ExportedQuestionAnsweringOrchestration DeserializeExportedQuestionAnsweringOrchestration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedQuestionAnsweringOrchestration(projectName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedQuestionAnsweringOrchestration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedQuestionAnsweringOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.cs new file mode 100644 index 000000000000..af2fa03bda70 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestration.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Defines the orchestration details for a Question Answering project target. + public partial class ExportedQuestionAnsweringOrchestration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the target project. + /// is null. + public ExportedQuestionAnsweringOrchestration(string projectName) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + + ProjectName = projectName; + } + + /// Initializes a new instance of . + /// The name of the target project. + /// Keeps track of any properties unknown to the library. + internal ExportedQuestionAnsweringOrchestration(string projectName, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedQuestionAnsweringOrchestration() + { + } + + /// The name of the target project. + public string ProjectName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestrationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestrationDetails.Serialization.cs new file mode 100644 index 000000000000..3374fcc738a8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestrationDetails.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedQuestionAnsweringOrchestrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestrationDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("questionAnsweringOrchestration"u8); + writer.WriteObjectValue(QuestionAnsweringOrchestration, options); + } + + ExportedQuestionAnsweringOrchestrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedQuestionAnsweringOrchestrationDetails(document.RootElement, options); + } + + internal static ExportedQuestionAnsweringOrchestrationDetails DeserializeExportedQuestionAnsweringOrchestrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = default; + OrchestrationTargetProjectKind targetProjectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("questionAnsweringOrchestration"u8)) + { + questionAnsweringOrchestration = ExportedQuestionAnsweringOrchestration.DeserializeExportedQuestionAnsweringOrchestration(property.Value, options); + continue; + } + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedQuestionAnsweringOrchestrationDetails(targetProjectKind, serializedAdditionalRawData, questionAnsweringOrchestration); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestrationDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedQuestionAnsweringOrchestrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedQuestionAnsweringOrchestrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedQuestionAnsweringOrchestrationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedQuestionAnsweringOrchestrationDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestrationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestrationDetails.cs new file mode 100644 index 000000000000..477f9b366763 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedQuestionAnsweringOrchestrationDetails.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the orchestration options for a Question Answering project target. + public partial class ExportedQuestionAnsweringOrchestrationDetails : ExportedOrchestrationDetails + { + /// Initializes a new instance of . + /// The Question Answering project details. + /// is null. + public ExportedQuestionAnsweringOrchestrationDetails(ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) + { + Argument.AssertNotNull(questionAnsweringOrchestration, nameof(questionAnsweringOrchestration)); + + TargetProjectKind = OrchestrationTargetProjectKind.QuestionAnswering; + QuestionAnsweringOrchestration = questionAnsweringOrchestration; + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The Question Answering project details. + internal ExportedQuestionAnsweringOrchestrationDetails(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData, ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) : base(targetProjectKind, serializedAdditionalRawData) + { + QuestionAnsweringOrchestration = questionAnsweringOrchestration; + } + + /// Initializes a new instance of for deserialization. + internal ExportedQuestionAnsweringOrchestrationDetails() + { + } + + /// The Question Answering project details. + public ExportedQuestionAnsweringOrchestration QuestionAnsweringOrchestration { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs new file mode 100644 index 000000000000..bde241606e97 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedTrainedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("exportedModelName"u8); + writer.WriteStringValue(ExportedModelName); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastExportedModelDateTime"u8); + writer.WriteStringValue(LastExportedModelDateTime, "O"); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedTrainedModel(document.RootElement, options); + } + + internal static ExportedTrainedModel DeserializeExportedTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string exportedModelName = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastExportedModelDateTime = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportedModelName"u8)) + { + exportedModelName = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastExportedModelDateTime"u8)) + { + lastExportedModelDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{options.Format}' format."); + } + } + + ExportedTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedTrainedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedTrainedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedTrainedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs new file mode 100644 index 000000000000..6f4b7d525f73 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedTrainedModel.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an exported trained model. + public partial class ExportedTrainedModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// or is null. + internal ExportedTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + } + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// Keeps track of any properties unknown to the library. + internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) + { + ExportedModelName = exportedModelName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedTrainedModel() + { + } + + /// The exported model name. + public string ExportedModelName { get; } + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The last exported date time of the model. + public DateTimeOffset LastExportedModelDateTime { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedUtteranceEntityLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedUtteranceEntityLabel.Serialization.cs new file mode 100644 index 000000000000..57b999f1282f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedUtteranceEntityLabel.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ExportedUtteranceEntityLabel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedUtteranceEntityLabel)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedUtteranceEntityLabel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedUtteranceEntityLabel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedUtteranceEntityLabel(document.RootElement, options); + } + + internal static ExportedUtteranceEntityLabel DeserializeExportedUtteranceEntityLabel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + int offset = default; + int length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedUtteranceEntityLabel(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedUtteranceEntityLabel)} does not support writing '{options.Format}' format."); + } + } + + ExportedUtteranceEntityLabel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedUtteranceEntityLabel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedUtteranceEntityLabel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedUtteranceEntityLabel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedUtteranceEntityLabel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedUtteranceEntityLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedUtteranceEntityLabel.cs new file mode 100644 index 000000000000..e2c969ccbb38 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ExportedUtteranceEntityLabel.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an entity label for an utterance. + public partial class ExportedUtteranceEntityLabel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The category of the entity label. + /// Start position for the entity text. + /// Length for the entity text. + /// is null. + public ExportedUtteranceEntityLabel(string category, int offset, int length) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// The category of the entity label. + /// Start position for the entity text. + /// Length for the entity text. + /// Keeps track of any properties unknown to the library. + internal ExportedUtteranceEntityLabel(string category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedUtteranceEntityLabel() + { + } + + /// The category of the entity label. + public string Category { get; } + /// Start position for the entity text. + public int Offset { get; } + /// Length for the entity text. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs new file mode 100644 index 000000000000..3374f0e5bb6c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ImportProjectJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportProjectJobState(document.RootElement, options); + } + + internal static ImportProjectJobState DeserializeImportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{options.Format}' format."); + } + } + + ImportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImportProjectJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImportProjectJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImportProjectJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.cs new file mode 100644 index 000000000000..99a71bdd2853 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ImportProjectJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of an import job. + public partial class ImportProjectJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ImportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal ImportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImportProjectJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorCode.cs new file mode 100644 index 000000000000..8fec0f3a7d94 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorCode.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Human-readable error code. + public readonly partial struct InnerErrorCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InnerErrorCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidRequestValue = "InvalidRequest"; + private const string InvalidParameterValueValue = "InvalidParameterValue"; + private const string KnowledgeBaseNotFoundValue = "KnowledgeBaseNotFound"; + private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; + private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; + private const string ExtractionFailureValue = "ExtractionFailure"; + private const string InvalidRequestBodyFormatValue = "InvalidRequestBodyFormat"; + private const string EmptyRequestValue = "EmptyRequest"; + private const string MissingInputDocumentsValue = "MissingInputDocuments"; + private const string InvalidDocumentValue = "InvalidDocument"; + private const string ModelVersionIncorrectValue = "ModelVersionIncorrect"; + private const string InvalidDocumentBatchValue = "InvalidDocumentBatch"; + private const string UnsupportedLanguageCodeValue = "UnsupportedLanguageCode"; + private const string InvalidCountryHintValue = "InvalidCountryHint"; + + /// InvalidRequest. + public static InnerErrorCode InvalidRequest { get; } = new InnerErrorCode(InvalidRequestValue); + /// InvalidParameterValue. + public static InnerErrorCode InvalidParameterValue { get; } = new InnerErrorCode(InvalidParameterValueValue); + /// KnowledgeBaseNotFound. + public static InnerErrorCode KnowledgeBaseNotFound { get; } = new InnerErrorCode(KnowledgeBaseNotFoundValue); + /// AzureCognitiveSearchNotFound. + public static InnerErrorCode AzureCognitiveSearchNotFound { get; } = new InnerErrorCode(AzureCognitiveSearchNotFoundValue); + /// AzureCognitiveSearchThrottling. + public static InnerErrorCode AzureCognitiveSearchThrottling { get; } = new InnerErrorCode(AzureCognitiveSearchThrottlingValue); + /// ExtractionFailure. + public static InnerErrorCode ExtractionFailure { get; } = new InnerErrorCode(ExtractionFailureValue); + /// InvalidRequestBodyFormat. + public static InnerErrorCode InvalidRequestBodyFormat { get; } = new InnerErrorCode(InvalidRequestBodyFormatValue); + /// EmptyRequest. + public static InnerErrorCode EmptyRequest { get; } = new InnerErrorCode(EmptyRequestValue); + /// MissingInputDocuments. + public static InnerErrorCode MissingInputDocuments { get; } = new InnerErrorCode(MissingInputDocumentsValue); + /// InvalidDocument. + public static InnerErrorCode InvalidDocument { get; } = new InnerErrorCode(InvalidDocumentValue); + /// ModelVersionIncorrect. + public static InnerErrorCode ModelVersionIncorrect { get; } = new InnerErrorCode(ModelVersionIncorrectValue); + /// InvalidDocumentBatch. + public static InnerErrorCode InvalidDocumentBatch { get; } = new InnerErrorCode(InvalidDocumentBatchValue); + /// UnsupportedLanguageCode. + public static InnerErrorCode UnsupportedLanguageCode { get; } = new InnerErrorCode(UnsupportedLanguageCodeValue); + /// InvalidCountryHint. + public static InnerErrorCode InvalidCountryHint { get; } = new InnerErrorCode(InvalidCountryHintValue); + /// Determines if two values are the same. + public static bool operator ==(InnerErrorCode left, InnerErrorCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InnerErrorCode left, InnerErrorCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InnerErrorCode(string value) => new InnerErrorCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InnerErrorCode other && Equals(other); + /// + public bool Equals(InnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs new file mode 100644 index 000000000000..3b9e7a409497 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class InnerErrorModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartObject(); + foreach (var item in Details) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InnerErrorModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInnerErrorModel(document.RootElement, options); + } + + internal static InnerErrorModel DeserializeInnerErrorModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InnerErrorCode code = default; + string message = default; + IReadOnlyDictionary details = default; + string target = default; + InnerErrorModel innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = new InnerErrorCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"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()); + } + details = dictionary; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = DeserializeInnerErrorModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InnerErrorModel( + code, + message, + details ?? new ChangeTrackingDictionary(), + target, + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{options.Format}' format."); + } + } + + InnerErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInnerErrorModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InnerErrorModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInnerErrorModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.cs new file mode 100644 index 000000000000..0be6c1135e2f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/InnerErrorModel.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + public partial class InnerErrorModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// is null. + internal InnerErrorModel(InnerErrorCode code, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// Error details. + /// Error target. + /// An object containing more specific information than the current object about the error. + /// Keeps track of any properties unknown to the library. + internal InnerErrorModel(InnerErrorCode code, string message, IReadOnlyDictionary details, string target, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Details = details; + Target = target; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InnerErrorModel() + { + } + + /// One of a server-defined set of error codes. + public InnerErrorCode Code { get; } + /// Error message. + public string Message { get; } + /// Error details. + public IReadOnlyDictionary Details { get; } + /// Error target. + public string Target { get; } + /// An object containing more specific information than the current object about the error. + public InnerErrorModel Innererror { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..73a89b3fd2d6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class IntentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IntentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IntentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IntentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIntentEvaluationSummary(document.RootElement, options); + } + + internal static IntentEvaluationSummary DeserializeIntentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IntentEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IntentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + IntentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIntentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IntentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IntentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIntentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentEvaluationSummary.cs new file mode 100644 index 000000000000..ccf4111135df --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The evaluation summary for an intent. + public partial class IntentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal IntentEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal IntentEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IntentEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..3baff424fa3e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class IntentsEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IntentsEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("intents"u8); + writer.WriteStartObject(); + foreach (var item in Intents) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IntentsEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IntentsEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIntentsEvaluationSummary(document.RootElement, options); + } + + internal static IntentsEvaluationSummary DeserializeIntentsEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary intents = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("intents"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, IntentEvaluationSummary.DeserializeIntentEvaluationSummary(property0.Value, options)); + } + intents = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IntentsEvaluationSummary( + confusionMatrix, + intents, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IntentsEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + IntentsEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIntentsEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IntentsEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IntentsEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIntentsEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs new file mode 100644 index 000000000000..ac6b62876b0c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/IntentsEvaluationSummary.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the evaluation summary for the project's intents. + public partial class IntentsEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the intent that was labelled and the intent that was predicted. + /// Represents the intents evaluation summary. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// or is null. + internal IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(intents, nameof(intents)); + + ConfusionMatrix = confusionMatrix; + Intents = intents; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the intent that was labelled and the intent that was predicted. + /// Represents the intents evaluation summary. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Intents = intents; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IntentsEvaluationSummary() + { + } + + /// Represents the confusion matrix between two intents (the two intents can be the same). The matrix is between the intent that was labelled and the intent that was predicted. + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the intents evaluation summary. + public IReadOnlyDictionary Intents { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/JobStatus.cs new file mode 100644 index 000000000000..e87ebd045098 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/JobStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The JobStatus. + public readonly partial struct JobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string CancelledValue = "cancelled"; + private const string CancellingValue = "cancelling"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); + /// running. + public static JobStatus Running { get; } = new JobStatus(RunningValue); + /// succeeded. + public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); + /// failed. + public static JobStatus Failed { get; } = new JobStatus(FailedValue); + /// cancelled. + public static JobStatus Cancelled { get; } = new JobStatus(CancelledValue); + /// cancelling. + public static JobStatus Cancelling { get; } = new JobStatus(CancellingValue); + /// partiallyCompleted. + public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobStatus(string value) => new JobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobStatus other && Equals(other); + /// + public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs new file mode 100644 index 000000000000..dc0a7a52e26b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class LoadSnapshotJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LoadSnapshotJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadSnapshotJobState(document.RootElement, options); + } + + internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoadSnapshotJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{options.Format}' format."); + } + } + + LoadSnapshotJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLoadSnapshotJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LoadSnapshotJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLoadSnapshotJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.cs new file mode 100644 index 000000000000..d36674e9524d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/LoadSnapshotJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of loading a snapshot job. + public partial class LoadSnapshotJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal LoadSnapshotJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal LoadSnapshotJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LoadSnapshotJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs new file mode 100644 index 000000000000..3a59bbd134f3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class OrchestrationExportedIntent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OrchestrationExportedIntent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Orchestration)) + { + writer.WritePropertyName("orchestration"u8); + writer.WriteObjectValue(Orchestration, options); + } + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OrchestrationExportedIntent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OrchestrationExportedIntent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOrchestrationExportedIntent(document.RootElement, options); + } + + internal static OrchestrationExportedIntent DeserializeOrchestrationExportedIntent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedOrchestrationDetails orchestration = default; + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("orchestration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + orchestration = ExportedOrchestrationDetails.DeserializeExportedOrchestrationDetails(property.Value, options); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OrchestrationExportedIntent(orchestration, category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OrchestrationExportedIntent)} does not support writing '{options.Format}' format."); + } + } + + OrchestrationExportedIntent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOrchestrationExportedIntent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OrchestrationExportedIntent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OrchestrationExportedIntent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOrchestrationExportedIntent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedIntent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedIntent.cs new file mode 100644 index 000000000000..a76c27e0e8db --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedIntent.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an exported intent for an orchestration project. + public partial class OrchestrationExportedIntent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The intent category. + /// is null. + public OrchestrationExportedIntent(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// 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 . + /// + /// The intent category. + /// Keeps track of any properties unknown to the library. + internal OrchestrationExportedIntent(ExportedOrchestrationDetails orchestration, string category, IDictionary serializedAdditionalRawData) + { + Orchestration = orchestration; + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OrchestrationExportedIntent() + { + } + + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// 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 ExportedOrchestrationDetails Orchestration { get; set; } + /// The intent category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..7f1f869f122c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class OrchestrationExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Intents)) + { + writer.WritePropertyName("intents"u8); + writer.WriteStartArray(); + foreach (var item in Intents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Utterances)) + { + writer.WritePropertyName("utterances"u8); + writer.WriteStartArray(); + foreach (var item in Utterances) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + OrchestrationExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOrchestrationExportedProjectAssets(document.RootElement, options); + } + + internal static OrchestrationExportedProjectAssets DeserializeOrchestrationExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList intents = default; + IList utterances = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("intents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OrchestrationExportedIntent.DeserializeOrchestrationExportedIntent(item, options)); + } + intents = array; + continue; + } + if (property.NameEquals("utterances"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OrchestrationExportedUtterance.DeserializeOrchestrationExportedUtterance(item, options)); + } + utterances = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OrchestrationExportedProjectAssets(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), utterances ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + OrchestrationExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOrchestrationExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new OrchestrationExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOrchestrationExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.cs new file mode 100644 index 000000000000..1b4e9d3b238c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the assets of an orchestration project. + public partial class OrchestrationExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public OrchestrationExportedProjectAssets() + { + ProjectKind = ProjectKind.Orchestration; + Intents = new ChangeTrackingList(); + Utterances = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + /// Represents the intents of the project. + /// Represents the utterances of the project. + internal OrchestrationExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList utterances) : base(projectKind, serializedAdditionalRawData) + { + Intents = intents; + Utterances = utterances; + } + + /// Represents the intents of the project. + public IList Intents { get; } + /// Represents the utterances of the project. + public IList Utterances { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs new file mode 100644 index 000000000000..297969e350eb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class OrchestrationExportedUtterance : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OrchestrationExportedUtterance)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent); + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OrchestrationExportedUtterance IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OrchestrationExportedUtterance)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOrchestrationExportedUtterance(document.RootElement, options); + } + + internal static OrchestrationExportedUtterance DeserializeOrchestrationExportedUtterance(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + string language = default; + string intent = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("intent"u8)) + { + intent = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OrchestrationExportedUtterance(text, language, intent, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OrchestrationExportedUtterance)} does not support writing '{options.Format}' format."); + } + } + + OrchestrationExportedUtterance IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOrchestrationExportedUtterance(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OrchestrationExportedUtterance)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static OrchestrationExportedUtterance FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOrchestrationExportedUtterance(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedUtterance.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedUtterance.cs new file mode 100644 index 000000000000..a43d5796891a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationExportedUtterance.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents an utterance of an orchestration project. + public partial class OrchestrationExportedUtterance + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The utterance text. + /// The intent of the utterance. + /// or is null. + public OrchestrationExportedUtterance(string text, string intent) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(intent, nameof(intent)); + + Text = text; + Intent = intent; + } + + /// Initializes a new instance of . + /// The utterance text. + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal OrchestrationExportedUtterance(string text, string language, string intent, string dataset, IDictionary serializedAdditionalRawData) + { + Text = text; + Language = language; + Intent = intent; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OrchestrationExportedUtterance() + { + } + + /// The utterance text. + public string Text { get; } + /// Represents the utterance's language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The intent of the utterance. + public string Intent { get; } + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationTargetProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationTargetProjectKind.cs new file mode 100644 index 000000000000..a0962ca47412 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/OrchestrationTargetProjectKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The OrchestrationTargetProjectKind. + internal readonly partial struct OrchestrationTargetProjectKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OrchestrationTargetProjectKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LuisValue = "Luis"; + private const string ConversationValue = "Conversation"; + private const string QuestionAnsweringValue = "QuestionAnswering"; + + /// Luis. + public static OrchestrationTargetProjectKind Luis { get; } = new OrchestrationTargetProjectKind(LuisValue); + /// Conversation. + public static OrchestrationTargetProjectKind Conversation { get; } = new OrchestrationTargetProjectKind(ConversationValue); + /// QuestionAnswering. + public static OrchestrationTargetProjectKind QuestionAnswering { get; } = new OrchestrationTargetProjectKind(QuestionAnsweringValue); + /// Determines if two values are the same. + public static bool operator ==(OrchestrationTargetProjectKind left, OrchestrationTargetProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OrchestrationTargetProjectKind left, OrchestrationTargetProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OrchestrationTargetProjectKind(string value) => new OrchestrationTargetProjectKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OrchestrationTargetProjectKind other && Equals(other); + /// + public bool Equals(OrchestrationTargetProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.Serialization.cs new file mode 100644 index 000000000000..3ed3090a697d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class PrebuiltEntities : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrebuiltEntities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrebuiltEntities(document.RootElement, options); + } + + internal static PrebuiltEntities DeserializePrebuiltEntities(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrebuiltEntity.DeserializePrebuiltEntity(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrebuiltEntities(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support writing '{options.Format}' format."); + } + } + + PrebuiltEntities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrebuiltEntities(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrebuiltEntities)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PrebuiltEntities FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePrebuiltEntities(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.cs new file mode 100644 index 000000000000..b391e65ae007 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntities.cs @@ -0,0 +1,80 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents a list of the retrieved supported prebuilt entities. + public partial class PrebuiltEntities + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The supported prebuilt entities. + /// is null. + internal PrebuiltEntities(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The supported prebuilt entities. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal PrebuiltEntities(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrebuiltEntities() + { + } + + /// The supported prebuilt entities. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..053665c47c53 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class PrebuiltEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WritePropertyName("examples"u8); + writer.WriteStringValue(Examples); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrebuiltEntity(document.RootElement, options); + } + + internal static PrebuiltEntity DeserializePrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + string description = default; + string examples = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("examples"u8)) + { + examples = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{options.Format}' format."); + } + } + + PrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrebuiltEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PrebuiltEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePrebuiltEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs new file mode 100644 index 000000000000..d0bfaf84131e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/PrebuiltEntity.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a supported prebuilt entity. + public partial class PrebuiltEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// , or is null. + internal PrebuiltEntity(string category, string description, string examples) + { + Argument.AssertNotNull(category, nameof(category)); + Argument.AssertNotNull(description, nameof(description)); + Argument.AssertNotNull(examples, nameof(examples)); + + Category = category; + Description = description; + Examples = examples; + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// Keeps track of any properties unknown to the library. + internal PrebuiltEntity(string category, string description, string examples, IDictionary serializedAdditionalRawData) + { + Category = category; + Description = description; + Examples = examples; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrebuiltEntity() + { + } + + /// The prebuilt entity category. + public string Category { get; } + /// The description. + public string Description { get; } + /// English examples for the entity. + public string Examples { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs new file mode 100644 index 000000000000..0126c905da8f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ProjectDeletionJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectDeletionJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectDeletionJobState(document.RootElement, options); + } + + internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectDeletionJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{options.Format}' format."); + } + } + + ProjectDeletionJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectDeletionJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectDeletionJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectDeletionJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.cs new file mode 100644 index 000000000000..6a51e6c587e7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeletionJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a project deletion job. + public partial class ProjectDeletionJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ProjectDeletionJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal ProjectDeletionJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectDeletionJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs new file mode 100644 index 000000000000..2cd30a980287 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ProjectDeployment : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("assignedResources"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectDeployment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectDeployment(document.RootElement, options); + } + + internal static ProjectDeployment DeserializeProjectDeployment(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + string modelTrainingConfigVersion = default; + IReadOnlyList assignedResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentResource.DeserializeDeploymentResource(item, options)); + } + assignedResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{options.Format}' format."); + } + } + + ProjectDeployment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectDeployment(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectDeployment FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectDeployment(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs new file mode 100644 index 000000000000..ef0a3c0feb3e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectDeployment.cs @@ -0,0 +1,112 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents a project deployment. + public partial class ProjectDeployment + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// , or is null. + internal ProjectDeployment(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IEnumerable assignedResources) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + Argument.AssertNotNull(assignedResources, nameof(assignedResources)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources.ToList(); + } + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// Keeps track of any properties unknown to the library. + internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectDeployment() + { + } + + /// Represents deployment name. + public string DeploymentName { get; } + /// Represents deployment modelId. + public string ModelId { get; } + /// Represents deployment last trained time. + public DateTimeOffset LastTrainedDateTime { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + /// Represents model training config version. + public string ModelTrainingConfigVersion { get; } + /// Represents the metadata of the assigned Azure resources. + public IReadOnlyList AssignedResources { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectKind.cs new file mode 100644 index 000000000000..d673512f2717 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The ProjectKind. + public readonly partial struct ProjectKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProjectKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConversationValue = "Conversation"; + private const string OrchestrationValue = "Orchestration"; + private const string CustomConversationSummarizationValue = "CustomConversationSummarization"; + + /// A project to build natural language into apps, bots, and IoT devices. + public static ProjectKind Conversation { get; } = new ProjectKind(ConversationValue); + /// A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one single project. + public static ProjectKind Orchestration { get; } = new ProjectKind(OrchestrationValue); + /// A project to build conversation summarization models which are able to summarize long conversations. + public static ProjectKind CustomConversationSummarization { get; } = new ProjectKind(CustomConversationSummarizationValue); + /// Determines if two values are the same. + public static bool operator ==(ProjectKind left, ProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProjectKind left, ProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProjectKind(string value) => new ProjectKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProjectKind other && Equals(other); + /// + public bool Equals(ProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs new file mode 100644 index 000000000000..1702bef36f89 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ProjectMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastModifiedDateTime"u8); + writer.WriteStringValue(LastModifiedDateTime, "O"); + if (Optional.IsDefined(LastTrainedDateTime)) + { + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime.Value, "O"); + } + if (Optional.IsDefined(LastDeployedDateTime)) + { + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime.Value, "O"); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectMetadata(document.RootElement, options); + } + + internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastModifiedDateTime = default; + DateTimeOffset? lastTrainedDateTime = default; + DateTimeOffset? lastDeployedDateTime = default; + ProjectKind projectKind = default; + ProjectSettings settings = default; + string storageInputContainerName = default; + string projectName = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedDateTime"u8)) + { + lastModifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + settings, + storageInputContainerName, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{options.Format}' format."); + } + } + + ProjectMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs new file mode 100644 index 000000000000..c8e18988fe7e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectMetadata.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the metadata of a project. + public partial class ProjectMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project kind. + /// The new project name. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// or is null. + internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, ProjectKind projectKind, string projectName, string language) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + ProjectKind = projectKind; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project last trained datetime. + /// Represents the project last deployed datetime. + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, DateTimeOffset? lastTrainedDateTime, DateTimeOffset? lastDeployedDateTime, ProjectKind projectKind, ProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + ProjectKind = projectKind; + Settings = settings; + StorageInputContainerName = storageInputContainerName; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectMetadata() + { + } + + /// Represents the project creation datetime. + public DateTimeOffset CreatedDateTime { get; } + /// Represents the project creation datetime. + public DateTimeOffset LastModifiedDateTime { get; } + /// Represents the project last trained datetime. + public DateTimeOffset? LastTrainedDateTime { get; } + /// Represents the project last deployed datetime. + public DateTimeOffset? LastDeployedDateTime { get; } + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The project settings. + public ProjectSettings Settings { get; } + /// The storage container name in case of conversation summarization. + public string StorageInputContainerName { get; } + /// The new project name. + public string ProjectName { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; } + /// The project description. + public string Description { get; } + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs similarity index 67% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.Serialization.cs rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs index c8ca025767cb..7104e28cc936 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.Serialization.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs @@ -11,13 +11,13 @@ using System.Text.Json; using Azure.Core; -namespace Azure.AI.DocumentIntelligence +namespace Azure.AI.Language.Conversations.Authoring.Models { - public partial class ResourceDetails : IUtf8JsonSerializable, IJsonModel + public partial class ProjectSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ResourceDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{format}' format."); } - writer.WritePropertyName("customDocumentModels"u8); - writer.WriteObjectValue(CustomDocumentModels, options); + writer.WritePropertyName("confidenceThreshold"u8); + writer.WriteNumberValue(ConfidenceThreshold); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResourceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ResourceDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceDetails(document.RootElement, options); + return DeserializeProjectSettings(document.RootElement, options); } - internal static ResourceDetails DeserializeResourceDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static ProjectSettings DeserializeProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,14 +73,14 @@ internal static ResourceDetails DeserializeResourceDetails(JsonElement element, { return null; } - CustomDocumentModelsDetails customDocumentModels = default; + float confidenceThreshold = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("customDocumentModels"u8)) + if (property.NameEquals("confidenceThreshold"u8)) { - customDocumentModels = CustomDocumentModelsDetails.DeserializeCustomDocumentModelsDetails(property.Value, options); + confidenceThreshold = property.Value.GetSingle(); continue; } if (options.Format != "W") @@ -89,46 +89,46 @@ internal static ResourceDetails DeserializeResourceDetails(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new ResourceDetails(customDocumentModels, serializedAdditionalRawData); + return new ProjectSettings(confidenceThreshold, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ResourceDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{options.Format}' format."); } } - ResourceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeResourceDetails(document.RootElement, options); + return DeserializeProjectSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ResourceDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ResourceDetails FromResponse(Response response) + internal static ProjectSettings FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeResourceDetails(document.RootElement); + return DeserializeProjectSettings(document.RootElement); } /// Convert into a . diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.cs new file mode 100644 index 000000000000..46ad35fa50c9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectSettings.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the settings used to define the project behavior. + public partial class ProjectSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. + public ProjectSettings(float confidenceThreshold) + { + ConfidenceThreshold = confidenceThreshold; + } + + /// Initializes a new instance of . + /// The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal ProjectSettings(float confidenceThreshold, IDictionary serializedAdditionalRawData) + { + ConfidenceThreshold = confidenceThreshold; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectSettings() + { + } + + /// The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. + public float ConfidenceThreshold { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs new file mode 100644 index 000000000000..6e7eaa0108c9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ProjectTrainedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastTrainingDurationInSeconds"u8); + writer.WriteNumberValue(LastTrainingDurationInSeconds); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("hasSnapshot"u8); + writer.WriteBooleanValue(HasSnapshot); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectTrainedModel(document.RootElement, options); + } + + internal static ProjectTrainedModel DeserializeProjectTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string label = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + int lastTrainingDurationInSeconds = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + bool hasSnapshot = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainingDurationInSeconds"u8)) + { + lastTrainingDurationInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hasSnapshot"u8)) + { + hasSnapshot = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectTrainedModel( + label, + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{options.Format}' format."); + } + } + + ProjectTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectTrainedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectTrainedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectTrainedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs new file mode 100644 index 000000000000..1fbc9b616db0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ProjectTrainedModel.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a trained model. + public partial class ProjectTrainedModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// or is null. + internal ProjectTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + } + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// Keeps track of any properties unknown to the library. + internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) + { + Label = label; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectTrainedModel() + { + } + + /// The trained model label. + public string Label { get; } + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The duration of the model's last training request in seconds. + public int LastTrainingDurationInSeconds { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + /// The flag to indicate if the trained model has a snapshot ready. + public bool HasSnapshot { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs new file mode 100644 index 000000000000..f08f82f6afcf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class ResourceMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + writer.WritePropertyName("customDomain"u8); + writer.WriteStringValue(CustomDomain); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceMetadata(document.RootElement, options); + } + + internal static ResourceMetadata DeserializeResourceMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + string customDomain = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customDomain"u8)) + { + customDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceMetadata(azureResourceId, customDomain, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{options.Format}' format."); + } + } + + ResourceMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResourceMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResourceMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ResourceMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ResourceMetadata.cs new file mode 100644 index 000000000000..906b9992bdf4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/ResourceMetadata.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents metadata for the Azure resource.. + public partial class ResourceMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the Azure resource ID. + /// Represents the Azure resource custom domain. + /// Represents the Azure resource region. + /// , or is null. + public ResourceMetadata(string azureResourceId, string customDomain, string region) + { + Argument.AssertNotNull(azureResourceId, nameof(azureResourceId)); + Argument.AssertNotNull(customDomain, nameof(customDomain)); + Argument.AssertNotNull(region, nameof(region)); + + AzureResourceId = azureResourceId; + CustomDomain = customDomain; + Region = region; + } + + /// Initializes a new instance of . + /// Represents the Azure resource ID. + /// Represents the Azure resource custom domain. + /// Represents the Azure resource region. + /// Keeps track of any properties unknown to the library. + internal ResourceMetadata(string azureResourceId, string customDomain, string region, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + CustomDomain = customDomain; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResourceMetadata() + { + } + + /// Represents the Azure resource ID. + public string AzureResourceId { get; } + /// Represents the Azure resource custom domain. + public string CustomDomain { get; } + /// Represents the Azure resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs new file mode 100644 index 000000000000..ad609f62ed3a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/StringIndexType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The StringIndexType. + 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 Utf16CodeUnitValue = "Utf16CodeUnit"; + + /// The offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. + 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs new file mode 100644 index 000000000000..34b55b9c7674 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class SubTrainingJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete); + if (Optional.IsDefined(StartDateTime)) + { + writer.WritePropertyName("startDateTime"u8); + writer.WriteStringValue(StartDateTime.Value, "O"); + } + if (Optional.IsDefined(EndDateTime)) + { + writer.WritePropertyName("endDateTime"u8); + writer.WriteStringValue(EndDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SubTrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubTrainingJobState(document.RootElement, options); + } + + internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int percentComplete = default; + DateTimeOffset? startDateTime = default; + DateTimeOffset? endDateTime = default; + JobStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("percentComplete"u8)) + { + percentComplete = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{options.Format}' format."); + } + } + + SubTrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSubTrainingJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SubTrainingJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSubTrainingJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.cs new file mode 100644 index 000000000000..bf95c7414ab8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SubTrainingJobState.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the detailed state of a training sub-operation. + public partial class SubTrainingJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the status of the sub-operation. + internal SubTrainingJobState(int percentComplete, JobStatus status) + { + PercentComplete = percentComplete; + Status = status; + } + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the start date time. + /// Represents the end date time. + /// Represents the status of the sub-operation. + /// Keeps track of any properties unknown to the library. + internal SubTrainingJobState(int percentComplete, DateTimeOffset? startDateTime, DateTimeOffset? endDateTime, JobStatus status, IDictionary serializedAdditionalRawData) + { + PercentComplete = percentComplete; + StartDateTime = startDateTime; + EndDateTime = endDateTime; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SubTrainingJobState() + { + } + + /// Represents progress percentage. + public int PercentComplete { get; } + /// Represents the start date time. + public DateTimeOffset? StartDateTime { get; } + /// Represents the end date time. + public DateTimeOffset? EndDateTime { get; } + /// Represents the status of the sub-operation. + public JobStatus Status { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs new file mode 100644 index 000000000000..b57d25aa07b2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class SupportedLanguage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("languageName"u8); + writer.WriteStringValue(LanguageName); + writer.WritePropertyName("languageCode"u8); + writer.WriteStringValue(LanguageCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SupportedLanguage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSupportedLanguage(document.RootElement, options); + } + + internal static SupportedLanguage DeserializeSupportedLanguage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string languageName = default; + string languageCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("languageName"u8)) + { + languageName = property.Value.GetString(); + continue; + } + if (property.NameEquals("languageCode"u8)) + { + languageCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{options.Format}' format."); + } + } + + SupportedLanguage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSupportedLanguage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SupportedLanguage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSupportedLanguage(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs new file mode 100644 index 000000000000..cc3293a6b09c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguage.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a supported language. + public partial class SupportedLanguage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// or is null. + internal SupportedLanguage(string languageName, string languageCode) + { + Argument.AssertNotNull(languageName, nameof(languageName)); + Argument.AssertNotNull(languageCode, nameof(languageCode)); + + LanguageName = languageName; + LanguageCode = languageCode; + } + + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal SupportedLanguage(string languageName, string languageCode, IDictionary serializedAdditionalRawData) + { + LanguageName = languageName; + LanguageCode = languageCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SupportedLanguage() + { + } + + /// The language name. + public string LanguageName { get; } + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string LanguageCode { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.Serialization.cs new file mode 100644 index 000000000000..10dfb02e3505 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class SupportedLanguages : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguages)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SupportedLanguages IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguages)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSupportedLanguages(document.RootElement, options); + } + + internal static SupportedLanguages DeserializeSupportedLanguages(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SupportedLanguage.DeserializeSupportedLanguage(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SupportedLanguages(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SupportedLanguages)} does not support writing '{options.Format}' format."); + } + } + + SupportedLanguages IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSupportedLanguages(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SupportedLanguages)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SupportedLanguages FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSupportedLanguages(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.cs new file mode 100644 index 000000000000..573a75efe97f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SupportedLanguages.cs @@ -0,0 +1,80 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents a list of retrieved languages. + public partial class SupportedLanguages + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of the languages. + /// is null. + internal SupportedLanguages(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of the languages. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal SupportedLanguages(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SupportedLanguages() + { + } + + /// The list of the languages. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs new file mode 100644 index 000000000000..aaade3a43ce4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class SwapDeploymentsDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("firstDeploymentName"u8); + writer.WriteStringValue(FirstDeploymentName); + writer.WritePropertyName("secondDeploymentName"u8); + writer.WriteStringValue(SecondDeploymentName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwapDeploymentsDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsDetails(document.RootElement, options); + } + + internal static SwapDeploymentsDetails DeserializeSwapDeploymentsDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string firstDeploymentName = default; + string secondDeploymentName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("firstDeploymentName"u8)) + { + firstDeploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondDeploymentName"u8)) + { + secondDeploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwapDeploymentsDetails(firstDeploymentName, secondDeploymentName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSwapDeploymentsDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SwapDeploymentsDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs new file mode 100644 index 000000000000..bdada59462ce --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options for swapping two deployments together. + public partial class SwapDeploymentsDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the first deployment name. + /// Represents the second deployment name. + /// or is null. + public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) + { + Argument.AssertNotNull(firstDeploymentName, nameof(firstDeploymentName)); + Argument.AssertNotNull(secondDeploymentName, nameof(secondDeploymentName)); + + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + } + + /// Initializes a new instance of . + /// Represents the first deployment name. + /// Represents the second deployment name. + /// Keeps track of any properties unknown to the library. + internal SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) + { + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsDetails() + { + } + + /// Represents the first deployment name. + public string FirstDeploymentName { get; } + /// Represents the second deployment name. + public string SecondDeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs new file mode 100644 index 000000000000..11247b186dd9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class SwapDeploymentsJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwapDeploymentsJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsJobState(document.RootElement, options); + } + + internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwapDeploymentsJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSwapDeploymentsJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SwapDeploymentsJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs new file mode 100644 index 000000000000..23f81396d899 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a deployment job. + public partial class SwapDeploymentsJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal SwapDeploymentsJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal SwapDeploymentsJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs new file mode 100644 index 000000000000..7811d7667b24 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class TrainingConfigVersion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersionProperty); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingConfigVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingConfigVersion(document.RootElement, options); + } + + internal static TrainingConfigVersion DeserializeTrainingConfigVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainingConfigVersion = default; + DateTimeOffset modelExpirationDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingConfigVersion(trainingConfigVersion, modelExpirationDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{options.Format}' format."); + } + } + + TrainingConfigVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingConfigVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingConfigVersion FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingConfigVersion(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs new file mode 100644 index 000000000000..17e1509a0e00 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersion.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents a training config version. + public partial class TrainingConfigVersion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// is null. + internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate) + { + Argument.AssertNotNull(trainingConfigVersionProperty, nameof(trainingConfigVersionProperty)); + + TrainingConfigVersionProperty = trainingConfigVersionProperty; + ModelExpirationDate = modelExpirationDate; + } + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// Keeps track of any properties unknown to the library. + internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate, IDictionary serializedAdditionalRawData) + { + TrainingConfigVersionProperty = trainingConfigVersionProperty; + ModelExpirationDate = modelExpirationDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingConfigVersion() + { + } + + /// Represents the version of the config. + public string TrainingConfigVersionProperty { get; } + /// Represents the training config version expiration date. + public DateTimeOffset ModelExpirationDate { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.Serialization.cs new file mode 100644 index 000000000000..b2ca76809d13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class TrainingConfigVersions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingConfigVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingConfigVersions(document.RootElement, options); + } + + internal static TrainingConfigVersions DeserializeTrainingConfigVersions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TrainingConfigVersion.DeserializeTrainingConfigVersion(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingConfigVersions(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support writing '{options.Format}' format."); + } + } + + TrainingConfigVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingConfigVersions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingConfigVersions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingConfigVersions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingConfigVersions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.cs new file mode 100644 index 000000000000..e9843b7eec26 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingConfigVersions.cs @@ -0,0 +1,80 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents a list of training config versions. + public partial class TrainingConfigVersions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of the training config versions. + /// is null. + internal TrainingConfigVersions(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of the training config versions. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal TrainingConfigVersions(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingConfigVersions() + { + } + + /// The list of the training config versions. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs new file mode 100644 index 000000000000..523f1676b7c8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class TrainingJobDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + if (Optional.IsDefined(TrainingConfigVersion)) + { + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + } + writer.WritePropertyName("trainingMode"u8); + writer.WriteStringValue(TrainingMode.ToString()); + if (Optional.IsDefined(EvaluationOptions)) + { + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingJobDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobDetails(document.RootElement, options); + } + + internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + TrainingMode trainingMode = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingMode"u8)) + { + trainingMode = new TrainingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobDetails(modelLabel, trainingConfigVersion, trainingMode, evaluationOptions, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs new file mode 100644 index 000000000000..3feb12923271 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobDetails.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the options for starting a new training job. + public partial class TrainingJobDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents the mode of the training operation. + /// is null. + public TrainingJobDetails(string modelLabel, TrainingMode trainingMode) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + + ModelLabel = modelLabel; + TrainingMode = trainingMode; + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. By default, "latest" value is used which uses the latest released training config version. + /// Represents the mode of the training operation. + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + /// Keeps track of any properties unknown to the library. + internal TrainingJobDetails(string modelLabel, string trainingConfigVersion, TrainingMode trainingMode, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingMode = trainingMode; + EvaluationOptions = evaluationOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobDetails() + { + } + + /// Represents the output model label. + public string ModelLabel { get; } + /// Represents training config version. By default, "latest" value is used which uses the latest released training config version. + public string TrainingConfigVersion { get; set; } + /// Represents the mode of the training operation. + public TrainingMode TrainingMode { get; } + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + public EvaluationDetails EvaluationOptions { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs new file mode 100644 index 000000000000..583091695fdd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class TrainingJobResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + if (Optional.IsDefined(TrainingMode)) + { + writer.WritePropertyName("trainingMode"u8); + writer.WriteStringValue(TrainingMode.Value.ToString()); + } + writer.WritePropertyName("trainingStatus"u8); + writer.WriteObjectValue(TrainingStatus, options); + if (Optional.IsDefined(EvaluationStatus)) + { + writer.WritePropertyName("evaluationStatus"u8); + writer.WriteObjectValue(EvaluationStatus, options); + } + if (Optional.IsDefined(EstimatedEndDateTime)) + { + writer.WritePropertyName("estimatedEndDateTime"u8); + writer.WriteStringValue(EstimatedEndDateTime.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobResult(document.RootElement, options); + } + + internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + TrainingMode? trainingMode = default; + SubTrainingJobState trainingStatus = default; + SubTrainingJobState evaluationStatus = default; + DateTimeOffset? estimatedEndDateTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trainingMode = new TrainingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingStatus"u8)) + { + trainingStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + continue; + } + if (property.NameEquals("evaluationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + continue; + } + if (property.NameEquals("estimatedEndDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedEndDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingMode, + trainingStatus, + evaluationStatus, + estimatedEndDateTime, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs new file mode 100644 index 000000000000..720a34cb1f3a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobResult.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the output of a training job. + public partial class TrainingJobResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents the model training status. + /// , or is null. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + Argument.AssertNotNull(trainingStatus, nameof(trainingStatus)); + + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingStatus = trainingStatus; + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents the mode of the training operation. + /// Represents the model training status. + /// Represents model evaluation status. + /// Represents the estimated end date time for training and evaluation. + /// Keeps track of any properties unknown to the library. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, TrainingMode? trainingMode, SubTrainingJobState trainingStatus, SubTrainingJobState evaluationStatus, DateTimeOffset? estimatedEndDateTime, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingMode = trainingMode; + TrainingStatus = trainingStatus; + EvaluationStatus = evaluationStatus; + EstimatedEndDateTime = estimatedEndDateTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobResult() + { + } + + /// Represents trained model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents the mode of the training operation. + public TrainingMode? TrainingMode { get; } + /// Represents the model training status. + public SubTrainingJobState TrainingStatus { get; } + /// Represents model evaluation status. + public SubTrainingJobState EvaluationStatus { get; } + /// Represents the estimated end date time for training and evaluation. + public DateTimeOffset? EstimatedEndDateTime { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs new file mode 100644 index 000000000000..00058b957bf1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class TrainingJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobState(document.RootElement, options); + } + + internal static TrainingJobState DeserializeTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + TrainingJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuthoringConversationsError.DeserializeAuthoringConversationsError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = TrainingJobResult.DeserializeTrainingJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.cs new file mode 100644 index 000000000000..882cd133cc27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingJobState.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the state of a training job. + public partial class TrainingJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents training tasks detailed result. + /// is null. + internal TrainingJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, TrainingJobResult result) + { + Argument.AssertNotNull(result, nameof(result)); + + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// Keeps track of any properties unknown to the library. + internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents training tasks detailed result. + public TrainingJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingMode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingMode.cs new file mode 100644 index 000000000000..8b3ba74604b3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/TrainingMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// The TrainingMode. + public readonly partial struct TrainingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TrainingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdvancedValue = "advanced"; + private const string StandardValue = "standard"; + + /// Trains using fine-tuned neural network transformer models. Can train multilingual projects. + public static TrainingMode Advanced { get; } = new TrainingMode(AdvancedValue); + /// Faster training times for quicker iterations. + public static TrainingMode Standard { get; } = new TrainingMode(StandardValue); + /// Determines if two values are the same. + public static bool operator ==(TrainingMode left, TrainingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TrainingMode left, TrainingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TrainingMode(string value) => new TrainingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TrainingMode other && Equals(other); + /// + public bool Equals(TrainingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs new file mode 100644 index 000000000000..3cfb3cb12330 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class UnassignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UnassignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnassignDeploymentResourcesDetails(document.RootElement, options); + } + + internal static UnassignDeploymentResourcesDetails DeserializeUnassignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedResourceIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnassignDeploymentResourcesDetails(assignedResourceIds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); + } + } + + UnassignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnassignDeploymentResourcesDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UnassignDeploymentResourcesDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnassignDeploymentResourcesDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs new file mode 100644 index 000000000000..9ef1677d4971 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs @@ -0,0 +1,76 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents the options to unassign Azure resources from a project. + public partial class UnassignDeploymentResourcesDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the assigned resource IDs to be unassigned. + /// is null. + public UnassignDeploymentResourcesDetails(IEnumerable assignedResourceIds) + { + Argument.AssertNotNull(assignedResourceIds, nameof(assignedResourceIds)); + + AssignedResourceIds = assignedResourceIds.ToList(); + } + + /// Initializes a new instance of . + /// Represents the assigned resource IDs to be unassigned. + /// Keeps track of any properties unknown to the library. + internal UnassignDeploymentResourcesDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UnassignDeploymentResourcesDetails() + { + } + + /// Represents the assigned resource IDs to be unassigned. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedOrchestrationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedOrchestrationDetails.Serialization.cs new file mode 100644 index 000000000000..1abe78c47979 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedOrchestrationDetails.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + internal partial class UnknownExportedOrchestrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ExportedOrchestrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedOrchestrationDetails(document.RootElement, options); + } + + internal static UnknownExportedOrchestrationDetails DeserializeUnknownExportedOrchestrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OrchestrationTargetProjectKind targetProjectKind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownExportedOrchestrationDetails(targetProjectKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedOrchestrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedOrchestrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedOrchestrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownExportedOrchestrationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownExportedOrchestrationDetails(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedOrchestrationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedOrchestrationDetails.cs new file mode 100644 index 000000000000..58340d0dec0e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedOrchestrationDetails.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Unknown version of ExportedOrchestrationDetails. + internal partial class UnknownExportedOrchestrationDetails : ExportedOrchestrationDetails + { + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal UnknownExportedOrchestrationDetails(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData) : base(targetProjectKind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownExportedOrchestrationDetails() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..90fd010370fe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + internal partial class UnknownExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + + internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownExportedProjectAssets(projectKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs new file mode 100644 index 000000000000..8a716c535450 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Unknown version of ExportedProjectAssets. + internal partial class UnknownExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + internal UnknownExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownExportedProjectAssets() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntitiesEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntitiesEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..f55c429bbe87 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntitiesEvaluationResult.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class UtteranceEntitiesEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceEntitiesEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("expectedEntities"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedEntities"u8); + writer.WriteStartArray(); + foreach (var item in PredictedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UtteranceEntitiesEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceEntitiesEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceEntitiesEvaluationResult(document.RootElement, options); + } + + internal static UtteranceEntitiesEvaluationResult DeserializeUtteranceEntitiesEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedEntities = default; + IReadOnlyList predictedEntities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UtteranceEntityEvaluationResult.DeserializeUtteranceEntityEvaluationResult(item, options)); + } + expectedEntities = array; + continue; + } + if (property.NameEquals("predictedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UtteranceEntityEvaluationResult.DeserializeUtteranceEntityEvaluationResult(item, options)); + } + predictedEntities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceEntitiesEvaluationResult(expectedEntities, predictedEntities, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UtteranceEntitiesEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceEntitiesEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUtteranceEntitiesEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceEntitiesEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UtteranceEntitiesEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceEntitiesEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntitiesEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntitiesEvaluationResult.cs new file mode 100644 index 000000000000..a504ec9990ed --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntitiesEvaluationResult.cs @@ -0,0 +1,83 @@ +// 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.Language.Conversations.Authoring.Models +{ + /// Represents the comparison between the expected and predicted entities for an utterance. + public partial class UtteranceEntitiesEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the expected entity labels. + /// Represents the predicted entity labels. + /// or is null. + internal UtteranceEntitiesEvaluationResult(IEnumerable expectedEntities, IEnumerable predictedEntities) + { + Argument.AssertNotNull(expectedEntities, nameof(expectedEntities)); + Argument.AssertNotNull(predictedEntities, nameof(predictedEntities)); + + ExpectedEntities = expectedEntities.ToList(); + PredictedEntities = predictedEntities.ToList(); + } + + /// Initializes a new instance of . + /// Represents the expected entity labels. + /// Represents the predicted entity labels. + /// Keeps track of any properties unknown to the library. + internal UtteranceEntitiesEvaluationResult(IReadOnlyList expectedEntities, IReadOnlyList predictedEntities, IDictionary serializedAdditionalRawData) + { + ExpectedEntities = expectedEntities; + PredictedEntities = predictedEntities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceEntitiesEvaluationResult() + { + } + + /// Represents the expected entity labels. + public IReadOnlyList ExpectedEntities { get; } + /// Represents the predicted entity labels. + public IReadOnlyList PredictedEntities { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntityEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntityEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..e5e3ea816f22 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntityEvaluationResult.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class UtteranceEntityEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceEntityEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UtteranceEntityEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceEntityEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceEntityEvaluationResult(document.RootElement, options); + } + + internal static UtteranceEntityEvaluationResult DeserializeUtteranceEntityEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + int offset = default; + int length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceEntityEvaluationResult(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UtteranceEntityEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceEntityEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUtteranceEntityEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceEntityEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UtteranceEntityEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceEntityEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntityEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntityEvaluationResult.cs new file mode 100644 index 000000000000..c27307848f49 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEntityEvaluationResult.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the evaluation output of an entity label or prediction. + public partial class UtteranceEntityEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// is null. + internal UtteranceEntityEvaluationResult(string category, int offset, int length) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// Keeps track of any properties unknown to the library. + internal UtteranceEntityEvaluationResult(string category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceEntityEvaluationResult() + { + } + + /// Represents the entity category. + public string Category { get; } + /// Represents the entity offset index relative to the original text. + public int Offset { get; } + /// Represents the entity length. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..d6d92cff97e9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEvaluationResult.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class UtteranceEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceEvaluationResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + writer.WritePropertyName("entitiesResult"u8); + writer.WriteObjectValue(EntitiesResult, options); + writer.WritePropertyName("intentsResult"u8); + writer.WriteObjectValue(IntentsResult, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UtteranceEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceEvaluationResult(document.RootElement, options); + } + + internal static UtteranceEvaluationResult DeserializeUtteranceEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + string language = default; + UtteranceEntitiesEvaluationResult entitiesResult = default; + UtteranceIntentsEvaluationResult intentsResult = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("entitiesResult"u8)) + { + entitiesResult = UtteranceEntitiesEvaluationResult.DeserializeUtteranceEntitiesEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("intentsResult"u8)) + { + intentsResult = UtteranceIntentsEvaluationResult.DeserializeUtteranceIntentsEvaluationResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceEvaluationResult(text, language, entitiesResult, intentsResult, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UtteranceEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUtteranceEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UtteranceEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEvaluationResult.cs new file mode 100644 index 000000000000..5c27863f44f3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceEvaluationResult.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the evaluation result for an utterance. + public partial class UtteranceEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the utterance language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the entities results for the utterance. + /// Represents the intents results for the utterance. + /// , or is null. + internal UtteranceEvaluationResult(string language, UtteranceEntitiesEvaluationResult entitiesResult, UtteranceIntentsEvaluationResult intentsResult) + { + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(entitiesResult, nameof(entitiesResult)); + Argument.AssertNotNull(intentsResult, nameof(intentsResult)); + + Language = language; + EntitiesResult = entitiesResult; + IntentsResult = intentsResult; + } + + /// Initializes a new instance of . + /// Represents the utterance text. + /// Represents the utterance language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the entities results for the utterance. + /// Represents the intents results for the utterance. + /// Keeps track of any properties unknown to the library. + internal UtteranceEvaluationResult(string text, string language, UtteranceEntitiesEvaluationResult entitiesResult, UtteranceIntentsEvaluationResult intentsResult, IDictionary serializedAdditionalRawData) + { + Text = text; + Language = language; + EntitiesResult = entitiesResult; + IntentsResult = intentsResult; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceEvaluationResult() + { + } + + /// Represents the utterance text. + public string Text { get; } + /// Represents the utterance language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; } + /// Represents the entities results for the utterance. + public UtteranceEntitiesEvaluationResult EntitiesResult { get; } + /// Represents the intents results for the utterance. + public UtteranceIntentsEvaluationResult IntentsResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceIntentsEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceIntentsEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..6f3f6c548477 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceIntentsEvaluationResult.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + public partial class UtteranceIntentsEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceIntentsEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("expectedIntent"u8); + writer.WriteStringValue(ExpectedIntent); + writer.WritePropertyName("predictedIntent"u8); + writer.WriteStringValue(PredictedIntent); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UtteranceIntentsEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UtteranceIntentsEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceIntentsEvaluationResult(document.RootElement, options); + } + + internal static UtteranceIntentsEvaluationResult DeserializeUtteranceIntentsEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string expectedIntent = default; + string predictedIntent = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedIntent"u8)) + { + expectedIntent = property.Value.GetString(); + continue; + } + if (property.NameEquals("predictedIntent"u8)) + { + predictedIntent = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceIntentsEvaluationResult(expectedIntent, predictedIntent, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UtteranceIntentsEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceIntentsEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUtteranceIntentsEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceIntentsEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UtteranceIntentsEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceIntentsEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceIntentsEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceIntentsEvaluationResult.cs new file mode 100644 index 000000000000..73d8e7f4ee43 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/Generated/Models/UtteranceIntentsEvaluationResult.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Conversations.Authoring.Models +{ + /// Represents the comparison between the expected and the predicted intent for an utterance. + public partial class UtteranceIntentsEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the utterance's expected intent. + /// Represents the utterance's predicted intent. + /// or is null. + internal UtteranceIntentsEvaluationResult(string expectedIntent, string predictedIntent) + { + Argument.AssertNotNull(expectedIntent, nameof(expectedIntent)); + Argument.AssertNotNull(predictedIntent, nameof(predictedIntent)); + + ExpectedIntent = expectedIntent; + PredictedIntent = predictedIntent; + } + + /// Initializes a new instance of . + /// Represents the utterance's expected intent. + /// Represents the utterance's predicted intent. + /// Keeps track of any properties unknown to the library. + internal UtteranceIntentsEvaluationResult(string expectedIntent, string predictedIntent, IDictionary serializedAdditionalRawData) + { + ExpectedIntent = expectedIntent; + PredictedIntent = predictedIntent; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceIntentsEvaluationResult() + { + } + + /// Represents the utterance's expected intent. + public string ExpectedIntent { get; } + /// Represents the utterance's predicted intent. + public string PredictedIntent { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/properties/AssemblyInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..06c37befa176 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/src/properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +// Replace with test project/test project public key and uncomment to make internal members visible to +// your test project. If not needed, this can be deleted. +// [assembly: InternalsVisibleTo("Azure.AI.Language.Conversations.Authoring.Generated.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Cognitivelanguage")] diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/AuthoringClientTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/AuthoringClientTest.cs new file mode 100644 index 000000000000..0dae8bbe1477 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/AuthoringClientTest.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests +{ + public class AuthoringClientTest: RecordedTestBase + { + public AuthoringClientTest(bool isAsync) : base(isAsync) + { + } + + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/TemplateClientLiveTests.cs to write tests. */ + + [RecordedTest] + public void TestOperation() + { + Assert.IsTrue(true); + } + + #region Helpers + + private static BinaryData GetContentFromResponse(Response r) + { + // Workaround azure/azure-sdk-for-net#21048, which prevents .Content from working when dealing with responses + // from the playback system. + + MemoryStream ms = new MemoryStream(); + r.ContentStream.CopyTo(ms); + return new BinaryData(ms.ToArray()); + } + #endregion + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Azure.AI.Language.Conversations.Authoring.Tests.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Azure.AI.Language.Conversations.Authoring.Tests.csproj new file mode 100644 index 000000000000..1be579ea1ed8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Azure.AI.Language.Conversations.Authoring.Tests.csproj @@ -0,0 +1,26 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/ConversationsAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/ConversationsAuthoringClientLiveTest.cs new file mode 100644 index 000000000000..23ae96ee4337 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/ConversationsAuthoringClientLiveTest.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using NUnit.Framework; +using System.Threading.Tasks; +using System; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core.TestFramework; +using Azure.AI.Language.Conversations.Authoring.Models; +using System.Collections.Generic; +using System.Threading; + +namespace Azure.AI.Language.Conversations.Authoring.Tests +{ + public class ConversationsAuthoringClientLiveTest : ConversationAuthoringTestBase + { + public ConversationsAuthoringClientLiveTest(bool isAsync, AuthoringClientOptions.ServiceVersion serviceVersion) + : base(isAsync, serviceVersion, null /* RecordedTestMode.Record /* to record */) + { + } + + [RecordedTest] + public async Task CreateProjectAsync() + { + // Arrange + string projectName = "MyNewProjectAsync"; + var projectData = new + { + projectName = projectName, + language = "en", + projectKind = "Conversation", + description = "Project description", + multilingual = true + }; + + // Convert to RequestContent + using RequestContent content = RequestContent.Create(projectData); + + // Act + Response response = await client.CreateProjectAsync(projectName, content); + + // Assert + Assert.IsNotNull(response); + //Assert.AreEqual(201, response.Status); + + Console.WriteLine($"Project created with status: {response.Status}"); + } + + [RecordedTest] + public async Task ImportProjectAsync() + { + string projectName = "Test-data-labels"; + + // Create metadata based on JSON data + var projectMetadata = new CreateProjectDetails( + projectKind: "Conversation", + projectName: projectName, + language: "en-us" + ) + { + Settings = new ProjectSettings(0.0F), // ConfidenceThreshold set to 0 + Multilingual = false, + Description = string.Empty + }; + + // Create assets based on JSON data + var projectAssets = new ConversationExportedProjectAssets(); + + projectAssets.Intents.Add(new ConversationExportedIntent(category: "None")); + projectAssets.Intents.Add(new ConversationExportedIntent(category: "Buy")); + + var entity = new ConversationExportedEntity(category: "product") + { + CompositionSetting = CompositionSetting.CombineComponents + }; + projectAssets.Entities.Add(entity); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "I want to buy a house", + intent: "Buy" + ) + { + Language = "en-us", + Dataset = "Train" + }); + projectAssets.Utterances[0].Entities.Add(new ExportedUtteranceEntityLabel( + category: "product", + offset: 16, + length: 5 + )); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "I want to buy surface pro", + intent: "Buy" + ) + { + Language = "en-us", + Dataset = "Train" + }); + projectAssets.Utterances[1].Entities.Add(new ExportedUtteranceEntityLabel( + category: "product", + offset: 14, + length: 11 + )); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "I want to buy xbox", + intent: "Buy" + ) + { + Language = "en-us", + Dataset = "Train" + }); + projectAssets.Utterances[2].Entities.Add(new ExportedUtteranceEntityLabel( + category: "product", + offset: 14, + length: 4 + )); + + // Build the exported project + var exportedProject = new ExportedProject( + projectFileVersion: "2022-10-01-preview", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata + ) + { + Assets = projectAssets + }; + + // Call the ImportAsync function + Operation operation = await client.ImportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject, + exportedProjectFormat: ExportedProjectFormat.Conversation + ); + + // Assert the operation and response + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + + // Extract and check the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project import completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task ExportProjectAsync() + { + // Arrange + string projectName = "MyNewProjectAsync"; + + // Act + Operation operation = await client.ExportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + stringIndexType: StringIndexType.Utf16CodeUnit, + exportedProjectFormat: ExportedProjectFormat.Conversation + ); + + // Assert + Assert.IsNotNull(operation, "The export operation should not be null."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + + // Extract and check the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task GetProjectAsync() + { + // Arrange + string projectName = "MyNewProjectAsync"; + + // Act + Response response = await client.GetProjectAsync(projectName); + ProjectMetadata projectMetadata = response.Value; + + // Assert + Assert.IsNotNull(response, "The response should not be null."); + Assert.IsNotNull(projectMetadata, "The project metadata should not be null."); + Assert.AreEqual(projectName, projectMetadata.ProjectName, "The project name in the response does not match the requested project name."); + Assert.IsNotNull(projectMetadata.CreatedDateTime, "Created DateTime should not be null."); + Assert.IsNotNull(projectMetadata.LastModifiedDateTime, "Last Modified DateTime should not be null."); + } + + [RecordedTest] + public async Task DeleteProjectAsync() + { + // Arrange + string projectName = "MyTestProject"; + + // Act + Operation operation = await client.DeleteProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName + ); + + // Assert + Assert.IsNotNull(operation, "The operation should not be null."); + //Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + Console.WriteLine($"DeleteProjectAsync with status: {operation.GetRawResponse().Status}"); + // Extract and validate the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + } + + [RecordedTest] + public async Task TrainAsync() + { + // Arrange + string projectName = "Test-data-labels"; + + var trainingJobDetails = new TrainingJobDetails( + modelLabel: "MyModel", + trainingMode: TrainingMode.Standard + ) + { + TrainingConfigVersion = "2023-04-15", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + // Act + Operation operation = await client.TrainAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails + ); + + // Assert + Assert.IsNotNull(operation, "The operation should not be null."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + + // Extract and validate the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + } + + [RecordedTest] + public async Task CancelTrainingJobAsync() + { + // Arrange + string projectName = "Test-data-labels"; + string jobId = "cd8db9c3-49eb-4cfa-969d-ddd4f72f8e16_638678304000000000"; + + // Act + Operation cancelOperation = await client.CancelTrainingJobAsync( + waitUntil: WaitUntil.Started, + projectName: projectName, + jobId: jobId + ); + + // Assert + Assert.IsNotNull(cancelOperation, "The cancellation operation should not be null."); + //Assert.AreEqual(200, cancelOperation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + Console.WriteLine($"Project created with status: {cancelOperation.GetRawResponse().Status}"); + // Extract and validate the operation-location header + string operationLocation = cancelOperation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + } + + [RecordedTest] + public async Task GetModelEvaluationSummaryAsync() + { + // Arrange + string projectName = "Aurora-CLU-Prod"; + string trainedModelLabel = "m1"; + + // Act + Response evaluationSummaryResponse = await client.GetModelEvaluationSummaryAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Assert + Assert.IsNotNull(evaluationSummaryResponse, "The evaluation summary response should not be null."); + var evaluationSummary = evaluationSummaryResponse.Value; + Assert.IsNotNull(evaluationSummary, "The evaluation summary value should not be null."); + + // Entities evaluation summary + var entitiesEval = evaluationSummary.EntitiesEvaluation; + Assert.IsNotNull(entitiesEval, "Entities evaluation summary should not be null."); + Assert.IsNotNull(entitiesEval.Entities, "Entities collection should not be null."); + Assert.IsNotNull(entitiesEval.MicroF1, "Entities Micro F1 should not be null."); + Assert.IsNotNull(entitiesEval.MicroPrecision, "Entities Micro Precision should not be null."); + Assert.IsNotNull(entitiesEval.MicroRecall, "Entities Micro Recall should not be null."); + Assert.IsNotNull(entitiesEval.MacroF1, "Entities Macro F1 should not be null."); + Assert.IsNotNull(entitiesEval.MacroPrecision, "Entities Macro Precision should not be null."); + Assert.IsNotNull(entitiesEval.MacroRecall, "Entities Macro Recall should not be null."); + + foreach (var entity in entitiesEval.Entities) + { + Assert.IsNotNull(entity.Key, "Entity key should not be null."); + Assert.IsNotNull(entity.Value.F1, $"F1 score for entity '{entity.Key}' should not be null."); + Assert.IsNotNull(entity.Value.Precision, $"Precision for entity '{entity.Key}' should not be null."); + Assert.IsNotNull(entity.Value.Recall, $"Recall for entity '{entity.Key}' should not be null."); + Assert.IsNotNull(entity.Value.TruePositiveCount, $"True Positives for entity '{entity.Key}' should not be null."); + Assert.IsNotNull(entity.Value.TrueNegativeCount, $"True Negatives for entity '{entity.Key}' should not be null."); + Assert.IsNotNull(entity.Value.FalsePositiveCount, $"False Positives for entity '{entity.Key}' should not be null."); + Assert.IsNotNull(entity.Value.FalseNegativeCount, $"False Negatives for entity '{entity.Key}' should not be null."); + } + + // Intents evaluation summary + var intentsEval = evaluationSummary.IntentsEvaluation; + Assert.IsNotNull(intentsEval, "Intents evaluation summary should not be null."); + Assert.IsNotNull(intentsEval.Intents, "Intents collection should not be null."); + Assert.IsNotNull(intentsEval.MicroF1, "Intents Micro F1 should not be null."); + Assert.IsNotNull(intentsEval.MicroPrecision, "Intents Micro Precision should not be null."); + Assert.IsNotNull(intentsEval.MicroRecall, "Intents Micro Recall should not be null."); + Assert.IsNotNull(intentsEval.MacroF1, "Intents Macro F1 should not be null."); + Assert.IsNotNull(intentsEval.MacroPrecision, "Intents Macro Precision should not be null."); + Assert.IsNotNull(intentsEval.MacroRecall, "Intents Macro Recall should not be null."); + + foreach (var intent in intentsEval.Intents) + { + Assert.IsNotNull(intent.Key, "Intent key should not be null."); + Assert.IsNotNull(intent.Value.F1, $"F1 score for intent '{intent.Key}' should not be null."); + Assert.IsNotNull(intent.Value.Precision, $"Precision for intent '{intent.Key}' should not be null."); + Assert.IsNotNull(intent.Value.Recall, $"Recall for intent '{intent.Key}' should not be null."); + Assert.IsNotNull(intent.Value.TruePositiveCount, $"True Positives for intent '{intent.Key}' should not be null."); + Assert.IsNotNull(intent.Value.TrueNegativeCount, $"True Negatives for intent '{intent.Key}' should not be null."); + Assert.IsNotNull(intent.Value.FalsePositiveCount, $"False Positives for intent '{intent.Key}' should not be null."); + Assert.IsNotNull(intent.Value.FalseNegativeCount, $"False Negatives for intent '{intent.Key}' should not be null."); + } + } + + [RecordedTest] + public async Task GetModelEvaluationResultsAsync() + { + // Arrange + string projectName = "Aurora-CLU-Prod"; + string trainedModelLabel = "m1"; + StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + + // Act + AsyncPageable results = client.GetModelEvaluationResultsAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel, + stringIndexType: stringIndexType + ); + + // Assert + Assert.IsNotNull(results, "The evaluation results should not be null."); + + await foreach (UtteranceEvaluationResult result in results) + { + // Validate text and language + Assert.IsNotNull(result.Text, "The result text should not be null."); + Assert.IsNotNull(result.Language, "The result language should not be null."); + + // Validate intents result + Assert.IsNotNull(result.IntentsResult, "The intents result should not be null."); + Assert.IsNotNull(result.IntentsResult.ExpectedIntent, "The expected intent should not be null."); + Assert.IsNotNull(result.IntentsResult.PredictedIntent, "The predicted intent should not be null."); + + // Validate entities result + Assert.IsNotNull(result.EntitiesResult, "The entities result should not be null."); + Assert.IsNotNull(result.EntitiesResult.ExpectedEntities, "The expected entities list should not be null."); + Assert.IsNotNull(result.EntitiesResult.PredictedEntities, "The predicted entities list should not be null."); + + foreach (var entity in result.EntitiesResult.ExpectedEntities) + { + Assert.IsNotNull(entity.Category, "The expected entity category should not be null."); + Assert.IsTrue(entity.Offset >= 0, "The expected entity offset should be non-negative."); + Assert.IsTrue(entity.Length > 0, "The expected entity length should be positive."); + } + + foreach (var entity in result.EntitiesResult.PredictedEntities) + { + Assert.IsNotNull(entity.Category, "The predicted entity category should not be null."); + Assert.IsTrue(entity.Offset >= 0, "The predicted entity offset should be non-negative."); + Assert.IsTrue(entity.Length > 0, "The predicted entity length should be positive."); + } + } + } + + [RecordedTest] + public async Task LoadSnapshotAsync() + { + // Arrange + string projectName = "Aurora-CLU-Prod"; + string trainedModelLabel = "m1"; + + // Act + Operation operation = await client.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Assert + Assert.IsNotNull(operation, "The operation result should not be null."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected operation status to be 200 (OK)."); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + } + + [RecordedTest] + public async Task DeleteTrainedModelAsync() + { + // Arrange + string projectName = "Test-data-labels"; + string trainedModelLabel = "MyModel"; + + // Act + Response response = await client.DeleteTrainedModelAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Assert + Assert.IsNotNull(response, "The response should not be null."); + Assert.AreEqual(204, response.Status, "Expected status to be 204 (No Content) indicating successful deletion."); + } + + [RecordedTest] + public async Task SwapDeploymentsAsync() + { + // Arrange + string projectName = "Test-data-labels"; + var swapDetails = new SwapDeploymentsDetails("deployment1", "deployment2"); + + // Act + Operation operation = await client.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails + ); + + // Assert + Assert.IsNotNull(operation, "The operation should not be null."); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected status to be 200 (OK)."); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + } + + [RecordedTest] + public async Task DeleteDeploymentAsync() + { + // Arrange + string projectName = "Test-data-labels"; + string deploymentName = "deployment1"; + + // Act + Operation operation = await client.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName + ); + + // Assert + Assert.IsNotNull(operation, "The operation should not be null."); + //Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected status to be 200 (OK)."); + Console.WriteLine($"Project created with status: {operation.GetRawResponse().Status}"); + //string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + //Assert.IsNotNull(operationLocation, "Expected operation-location header to be present."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Generated/Samples/Samples_AnalyzeConversationAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Generated/Samples/Samples_AnalyzeConversationAuthoring.cs new file mode 100644 index 000000000000..bc4759b14658 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Generated/Samples/Samples_AnalyzeConversationAuthoring.cs @@ -0,0 +1,6466 @@ +// 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.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Samples +{ + public partial class Samples_AnalyzeConversationAuthoring + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + projectName = "", + language = "", + }); + Response response = client.CreateProject("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + projectName = "", + language = "", + }); + Response response = await client.CreateProjectAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }); + Response response = client.CreateProject("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_CreateProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }); + Response response = await client.CreateProjectAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + }); + Response response = client.CopyProjectAuthorization("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + }); + Response response = await client.CopyProjectAuthorizationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + storageInputContainerName = "", + allowOverwrite = true, + }); + Response response = client.CopyProjectAuthorization("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + storageInputContainerName = "", + allowOverwrite = true, + }); + Response response = await client.CopyProjectAuthorizationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProjectAuthorization_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("resultUrl").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("resultUrl").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetModelEvaluationSummary_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetProjectDeletionStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetAssignedResourceDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedLanguages_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities(null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync(null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities("", "", 1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync("", "", 1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetSupportedPrebuiltEntities_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_GetTrainingConfigVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetProjects(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectMetadata_GetProjects_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = client.CopyProject(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.Conversation, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = client.CopyProject(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.Conversation, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = client.CopyProject(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CopyProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.Conversation, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = client.CopyProject(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CopyProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.Conversation, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Export_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Export_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Export_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Export_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Export_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Export_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Export_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Export_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Import_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + projectName = "", + language = "", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Import_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + projectName = "", + language = "", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Import_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); + Operation operation = client.Import(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Import_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "")); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Import_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { +new +{ +category = "", +} + }, + entities = new object[] + { +new +{ +category = "", +compositionSetting = "returnLongestOverlap", +list = new +{ +sublists = new object[] +{ +new +{ +listKey = "", +synonyms = new object[] +{ +new +{ +language = "", +values = new object[] +{ +"" +}, +} +}, +} +}, +}, +prebuilts = new object[] +{ +new +{ +category = "", +} +}, +regex = new +{ +expressions = new object[] +{ +new +{ +regexKey = "", +language = "", +regexPattern = "", +} +}, +}, +requiredComponents = new object[] +{ +"" +}, +} + }, + utterances = new object[] + { +new +{ +entities = new object[] +{ +new +{ +category = "", +offset = 1234, +length = 1234, +} +}, +text = "", +language = "", +intent = "", +dataset = "", +} + }, + projectKind = "Conversation", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Import_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { +new +{ +category = "", +} + }, + entities = new object[] + { +new +{ +category = "", +compositionSetting = "returnLongestOverlap", +list = new +{ +sublists = new object[] +{ +new +{ +listKey = "", +synonyms = new object[] +{ +new +{ +language = "", +values = new object[] +{ +"" +}, +} +}, +} +}, +}, +prebuilts = new object[] +{ +new +{ +category = "", +} +}, +regex = new +{ +expressions = new object[] +{ +new +{ +regexKey = "", +language = "", +regexPattern = "", +} +}, +}, +requiredComponents = new object[] +{ +"" +}, +} + }, + utterances = new object[] + { +new +{ +entities = new object[] +{ +new +{ +category = "", +offset = 1234, +length = 1234, +} +}, +text = "", +language = "", +intent = "", +dataset = "", +} + }, + projectKind = "Conversation", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Import_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") + { + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", + }) + { + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") +{ +CompositionSetting = CompositionSetting.ReturnLongestOverlap, +List = new ExportedEntityList +{ +Sublists = {new ExportedEntitySublist +{ +ListKey = "", +Synonyms = {new ExportedEntityListSynonym +{ +Language = "", +Values = {""}, +}}, +}}, +}, +Prebuilts = {new ExportedPrebuiltEntity("")}, +Regex = new ExportedEntityRegex +{ +Expressions = {new ExportedEntityRegexExpression +{ +RegexKey = "", +Language = "", +RegexPattern = "", +}}, +}, +RequiredComponents = {""}, +}}, + Utterances = {new ConversationExportedUtterance("", "") +{ +Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = client.Import(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Import_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.Conversation, "", "") + { + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", + }) + { + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") +{ +CompositionSetting = CompositionSetting.ReturnLongestOverlap, +List = new ExportedEntityList +{ +Sublists = {new ExportedEntitySublist +{ +ListKey = "", +Synonyms = {new ExportedEntityListSynonym +{ +Language = "", +Values = {""}, +}}, +}}, +}, +Prebuilts = {new ExportedPrebuiltEntity("")}, +Regex = new ExportedEntityRegex +{ +Expressions = {new ExportedEntityRegexExpression +{ +RegexKey = "", +Language = "", +RegexPattern = "", +}}, +}, +RequiredComponents = {""}, +}}, + Utterances = {new ConversationExportedUtterance("", "") +{ +Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Train_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingMode = "advanced", + }); + Operation operation = client.Train(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Train_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingMode = "advanced", + }); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Train_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Train_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Train_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + }); + Operation operation = client.Train(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Train_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + }); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_Train_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) + { + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + }; + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_Train_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", TrainingMode.Advanced) + { + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + }; + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_SwapDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails(""); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeployProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails(""); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeployProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeployProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeployProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeployProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails(); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails(); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails(); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails(); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }; + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_EvaluateModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }; + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_LoadSnapshot_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_LoadSnapshot_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_LoadSnapshot_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_LoadSnapshot_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_AssignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_UnassignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingMode").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CancelTrainingJob_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_DeleteExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_DeleteExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AnalyzeConversationAuthoring client = new AuthoringClient(endpoint, credential).GetAnalyzeConversationAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Infrastructure/AuthoringClientTestEnvironment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Infrastructure/AuthoringClientTestEnvironment.cs new file mode 100644 index 000000000000..9da56c31389b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Infrastructure/AuthoringClientTestEnvironment.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.TestFramework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests +{ + public class AuthoringClientTestEnvironment : TestEnvironment + { + public Uri Endpoint => new(GetRecordedVariable("AZURE_AUTHORING_ENDPOINT")); + + public string ApiKey => GetRecordedVariable("AZURE_AUTHORING_KEY", options => options.IsSecret()); + + public string CTProjectName => GetRecordedVariable("AZURE_AUTHORING_CUSTOM_PROJECT"); + + public string CTDeploymentName => GetRecordedVariable("AZURE_AUTHORING_CUSTOM_DEPLOYMENT"); + + public string CSCProjectName => GetRecordedVariable("AZURE_AUTHORING_SINGLE_CLASSIFICATION_PROJECT"); + + public string CSCDeploymentName => GetRecordedVariable("AZURE_AUTHORING_SINGLE_CLASSIFICATION_DEPLOYMENT"); + + public string CMCProjectName => GetRecordedVariable("AZURE_AUTHORING_MULTI_CLASSIFICATION_PROJECT"); + + public string CMCDeploymentName => GetRecordedVariable("AZURE_AUTHORING_MULTI_CLASSIFICATION_DEPLOYMENT"); + + public string ProjectDescription => GetRecordedVariable("AZURE_AUTHORING_PROJECT_DESCRIPTION"); + + public string ProjectLanguage => GetRecordedVariable("AZURE_AUTHORING_PROJECT_LANGUAGE"); + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Infrastructure/ConversationAuthoringTestBase.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Infrastructure/ConversationAuthoringTestBase.cs new file mode 100644 index 000000000000..07096284b3c1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Infrastructure/ConversationAuthoringTestBase.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests +{ + /// + /// Base class for live client tests using different service versions for Conversation Authoring. + /// + /// The type of client being tested. + [ClientTestFixture( + AuthoringClientOptions.ServiceVersion.V2023_04_01, + AuthoringClientOptions.ServiceVersion.V2023_04_15_Preview, + AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview + )] + [IgnoreServiceError(429, "429")] + public abstract class ConversationAuthoringTestBase : RecordedTestBase + { + protected ConversationAuthoringTestBase(bool isAsync, AuthoringClientOptions.ServiceVersion serviceVersion, RecordedTestMode? mode) + : base(isAsync, mode) + { + CompareBodies = false; + + SanitizedHeaders.Add("Ocp-Apim-Subscription-Key"); + ServiceVersion = serviceVersion; + } + + /// + /// Gets an instrumented client of type . + /// + protected AnalyzeConversationAuthoring client { get; private set; } + + /// + /// Gets the service version used for this instance of the test fixture. + /// + protected AuthoringClientOptions.ServiceVersion ServiceVersion { get; } + + /// + /// Creates the once tests begin. + /// + public override async Task StartTestRecordingAsync() + { + await base.StartTestRecordingAsync(); + + AuthoringClientOptions options = new(ServiceVersion); + var authoringClient = CreateClient( + TestEnvironment.Endpoint, + new AzureKeyCredential(TestEnvironment.ApiKey), + InstrumentClientOptions(options)); + client= authoringClient.GetAnalyzeConversationAuthoringClient(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/CreateClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/CreateClient.cs new file mode 100644 index 000000000000..eca2682fc318 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/CreateClient.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core.TestFramework; +using NUnit.Framework; +#region Snippet:Conversations_Identity_Namespace +using Azure.Identity; +using Azure.Core; +#endregion + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class CreateClient : SamplesBase + { + [Test] + public void CreateAuthoringClientForSpecificApiVersion() + { + #region Snippet:CreateAuthoringClientForSpecificApiVersion + Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); + AzureKeyCredential credential = new("your apikey"); +#if !SNIPPET + endpoint = TestEnvironment.Endpoint; + credential = new(TestEnvironment.ApiKey); +#endif + AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); + AuthoringClient client = new AuthoringClient(endpoint, credential, options); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + #endregion + } + + [Test] + public void AuthoringClient_CreateWithDefaultAzureCredential() + { + #region Snippet:AnalyzeConversationAuthoring_CreateWithDefaultAzureCredential + Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +#if !SNIPPET + endpoint = TestEnvironment.Endpoint; +#endif + DefaultAzureCredential credential = new DefaultAzureCredential(); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + #endregion + } + + [Test] + public void BadArgument() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:AuthoringClient_BadRequest + try + { + string invalidProjectName = "InvalidProject"; + + var projectData = new + { + projectName = invalidProjectName, + language = "invalid-lang", // Invalid language code + projectKind = "Conversation", + description = "This is a test for invalid configuration." + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = authoringClient.CreateProject(invalidProjectName, content); + } + catch (RequestFailedException ex) + { + Console.WriteLine(ex.ToString()); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/README.md new file mode 100644 index 000000000000..7324622a839a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/README.md @@ -0,0 +1,3 @@ +Source files in this directory are written as tests from which samples are extracted. +They are not intended to be viewed directly and help ensure our samples compile and work correctly. +See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/samples) for more explanation about how to use this client library. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample10_ConversationsAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample10_ConversationsAuthoring_LoadSnapshot.cs new file mode 100644 index 000000000000..f667d0feba7a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample10_ConversationsAuthoring_LoadSnapshot.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample10_ConversationsAuthoring_LoadSnapshot : SamplesBase + { + [Test] + [SyncOnly] + public void LoadSnapshot() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string trainedModelLabel = "SampleModel"; + + #region Snippet:Sample10_ConversationsAuthoring_LoadSnapshot + Operation operation = authoringClient.LoadSnapshot( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Snapshot loaded with operation status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.cs new file mode 100644 index 000000000000..d32d2bde18cb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample10_ConversationsAuthoring_LoadSnapshotAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample10_ConversationsAuthoring_LoadSnapshotAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task LoadSnapshotAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string trainedModelLabel = "SampleModel"; + + #region Snippet:Sample10_ConversationsAuthoring_LoadSnapshotAsync + Operation operation = await authoringClient.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Snapshot loaded with operation status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.cs new file mode 100644 index 000000000000..1cf205a42e6d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample11_ConversationsAuthoring_DeleteTrainedModel.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample11_ConversationsAuthoring_DeleteTrainedModel : SamplesBase + { + [Test] + [SyncOnly] + public void DeleteTrainedModel() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string trainedModelLabel = "SampleModel"; + + #region Snippet:Sample11_ConversationsAuthoring_DeleteTrainedModel + Response response = authoringClient.DeleteTrainedModel( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + Console.WriteLine($"Delete Trained Model Response Status: {response.Status}"); + #endregion + + Assert.AreEqual(204, response.Status); // Assuming a 204 No Content response indicates successful deletion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.cs new file mode 100644 index 000000000000..7d465340296e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample11_ConversationsAuthoring_DeleteTrainedModelAsync.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample11_ConversationsAuthoring_DeleteTrainedModelAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeleteTrainedModelAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string trainedModelLabel = "SampleModel"; + + #region Snippet:Sample11_ConversationsAuthoring_DeleteTrainedModelAsync + Response response = await authoringClient.DeleteTrainedModelAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + Console.WriteLine($"Delete Trained Model Async Response Status: {response.Status}"); + #endregion + + Assert.AreEqual(204, response.Status); // Assuming a 204 No Content response indicates successful deletion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample12_ConversationsAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample12_ConversationsAuthoring_SwapDeployments.cs new file mode 100644 index 000000000000..002ec8f12aec --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample12_ConversationsAuthoring_SwapDeployments.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample14_ConversationsAuthoring_SwapDeployments : SamplesBase + { + [Test] + [SyncOnly] + public void SwapDeployments() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + var swapDetails = new SwapDeploymentsDetails("production", "staging"); + + #region Snippet:Sample14_ConversationsAuthoring_SwapDeployments + Operation operation = authoringClient.SwapDeployments( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails + ); + + // Extract operation-location from response headers + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; + Console.WriteLine($"Swap operation-location: {operationLocation}"); + Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.cs new file mode 100644 index 000000000000..fc5a19a46243 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample12_ConversationsAuthoring_SwapDeploymentsAsync.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample14_ConversationsAuthoring_SwapDeploymentsAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task SwapDeploymentsAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + + var swapDetails = new SwapDeploymentsDetails("production", "staging"); + + #region Snippet:Sample14_ConversationsAuthoring_SwapDeploymentsAsync + Operation operation = await authoringClient.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails + ); + + // Extract operation-location from response headers + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; + Console.WriteLine($"Swap operation-location: {operationLocation}"); + Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample13_ConversationsAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample13_ConversationsAuthoring_DeleteDeployment.cs new file mode 100644 index 000000000000..4c5608b78d45 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample13_ConversationsAuthoring_DeleteDeployment.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample13_ConversationsAuthoring_DeleteDeployment : SamplesBase + { + [Test] + [SyncOnly] + public void DeleteDeployment() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string deploymentName = "SampleDeployment"; + + #region Snippet:Sample13_ConversationsAuthoring_DeleteDeployment + Operation operation = authoringClient.DeleteDeployment( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName + ); + + // Extract operation-location from response headers + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; + Console.WriteLine($"Delete operation-location: {operationLocation}"); + Console.WriteLine($"Delete operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.cs new file mode 100644 index 000000000000..8f7fb8f844f4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample13_ConversationsAuthoring_DeleteDeploymentAsync.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample13_ConversationsAuthoring_DeleteDeploymentAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeleteDeploymentAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string deploymentName = "SampleDeployment"; + + #region Snippet:Sample13_ConversationsAuthoring_DeleteDeploymentAsync + Operation operation = await authoringClient.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName + ); + + // Extract operation-location from response headers + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : "Not found"; + Console.WriteLine($"Delete operation-location: {operationLocation}"); + Console.WriteLine($"Delete operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample1_ConversationsAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample1_ConversationsAuthoring_CreateProject.cs new file mode 100644 index 000000000000..b6642d6cb78f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample1_ConversationsAuthoring_CreateProject.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample1_ConversationsAuthoring_CreateProject : SamplesBase + { + [Test] + [SyncOnly] + public void CreateProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample1_ConversationsAuthoring_CreateProject + string projectName = "MyNewProject"; + var projectData = new + { + projectName = projectName, + language = "en", + projectKind = "Conversation", + description = "Project description", + multilingual = true + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = authoringClient.CreateProject(projectName, content); + + Console.WriteLine($"Project created with status: {response.Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample1_ConversationsAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample1_ConversationsAuthoring_CreateProjectAsync.cs new file mode 100644 index 000000000000..b884cd8b58f8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample1_ConversationsAuthoring_CreateProjectAsync.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample1_ConversationsAuthoring_CreateProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task CreateProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample1_ConversationsAuthoring_CreateProjectAsync + string projectName = "MyNewProjectAsync"; + var projectData = new + { + projectName = projectName, + language = "en", + projectKind = "Conversation", + description = "Project description", + multilingual = true + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = await authoringClient.CreateProjectAsync(projectName, content); + + Console.WriteLine($"Project created with status: {response.Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample2_ConversationsAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample2_ConversationsAuthoring_Import.cs new file mode 100644 index 000000000000..1a9b8eeba440 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample2_ConversationsAuthoring_Import.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; +using NUnit.Framework.Interfaces; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample2_ConversationsAuthoring_Import : SamplesBase + { + [Test] + [SyncOnly] + public void Import() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample2_ConversationsAuthoring_Import + string projectName = "MyImportedProject"; + + var projectMetadata = new CreateProjectDetails( + projectKind: "Conversation", + projectName: projectName, + language: "en" + ) + { + Settings = new ProjectSettings(0.7F), + Multilingual = true, + Description = "Trying out CLU with assets" + }; + + var projectAssets = new ConversationExportedProjectAssets(); + + projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent1" )); + projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent2" )); + + projectAssets.Entities.Add(new ConversationExportedEntity ( category : "entity1" )); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text1", + intent: "intent1" + ) + { + Language = "en", + Dataset = "dataset1" + }); + + projectAssets.Utterances[projectAssets.Utterances.Count - 1].Entities.Add(new ExportedUtteranceEntityLabel( + category: "entity1", + offset: 5, + length: 5 + )); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text2", + intent: "intent2" + ) + { + Language = "en", + Dataset = "dataset1" + }); + + var exportedProject = new ExportedProject( + projectFileVersion: "2023-10-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata + ) + { + Assets = projectAssets + }; + + Operation operation = authoringClient.Import( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject, + exportedProjectFormat: ExportedProjectFormat.Conversation + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample2_ConversationsAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample2_ConversationsAuthoring_ImportAsync.cs new file mode 100644 index 000000000000..92851a713fd6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample2_ConversationsAuthoring_ImportAsync.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; +using NUnit.Framework.Interfaces; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample2_ConversationsAuthoring_ImportAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task ImportAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample2_ConversationsAuthoring_ImportAsync + string projectName = "MyImportedProjectAsync"; + + var projectMetadata = new CreateProjectDetails( + projectKind: "Conversation", + projectName: projectName, + language: "en" + ) + { + Settings = new ProjectSettings(0.7F), + Multilingual = true, + Description = "Trying out CLU with assets" + }; + + var projectAssets = new ConversationExportedProjectAssets(); + + projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent1" )); + projectAssets.Intents.Add(new ConversationExportedIntent ( category : "intent2" )); + + projectAssets.Entities.Add(new ConversationExportedEntity ( category : "entity1" )); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text1", + intent: "intent1" + ) + { + Language = "en", + Dataset = "dataset1" + }); + + projectAssets.Utterances[projectAssets.Utterances.Count - 1].Entities.Add(new ExportedUtteranceEntityLabel( + category: "entity1", + offset: 5, + length: 5 + )); + + projectAssets.Utterances.Add(new ConversationExportedUtterance( + text: "text2", + intent: "intent2" + ) + { + Language = "en", + Dataset = "dataset1" + }); + + var exportedProject = new ExportedProject( + projectFileVersion: "2023-10-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata + ) + { + Assets = projectAssets + }; + + Operation operation = await authoringClient.ImportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject, + exportedProjectFormat: ExportedProjectFormat.Conversation + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample3_ConversationsAuthoring_Export.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample3_ConversationsAuthoring_Export.cs new file mode 100644 index 000000000000..96f0b6c41136 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample3_ConversationsAuthoring_Export.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample3_ConversationsAuthoring_Export : SamplesBase + { + [Test] + [SyncOnly] + public void Export() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample3_ConversationsAuthoring_Export + string projectName = "MyExportedProject"; + + Operation operation = authoringClient.Export( + waitUntil: WaitUntil.Completed, + projectName: projectName, + stringIndexType: StringIndexType.Utf16CodeUnit, + exportedProjectFormat: ExportedProjectFormat.Conversation + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample3_ConversationsAuthoring_ExportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample3_ConversationsAuthoring_ExportAsync.cs new file mode 100644 index 000000000000..83d856f4a69c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample3_ConversationsAuthoring_ExportAsync.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample3_ConversationsAuthoring_ExportAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task ExportAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample3_ConversationsAuthoring_ExportAsync + string projectName = "MyExportedProjectAsync"; + + Operation operation = await authoringClient.ExportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + stringIndexType: StringIndexType.Utf16CodeUnit, + exportedProjectFormat: ExportedProjectFormat.Conversation + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project export completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample4_ConversationsAuthoring_GetProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample4_ConversationsAuthoring_GetProject.cs new file mode 100644 index 000000000000..a7a696f6f23e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample4_ConversationsAuthoring_GetProject.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample4_ConversationsAuthoring_GetProject : SamplesBase + { + [Test] + [SyncOnly] + public void GetProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample4_ConversationsAuthoring_GetProject + string projectName = "MySampleProject"; + + Response response = authoringClient.GetProject(projectName); + ProjectMetadata projectMetadata = response.Value; + + Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); + Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); + Console.WriteLine($"Last Trained DateTime: {projectMetadata.LastTrainedDateTime}"); + Console.WriteLine($"Last Deployed DateTime: {projectMetadata.LastDeployedDateTime}"); + Console.WriteLine($"Project Kind: {projectMetadata.ProjectKind}"); + Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); + Console.WriteLine($"Multilingual: {projectMetadata.Multilingual}"); + Console.WriteLine($"Description: {projectMetadata.Description}"); + Console.WriteLine($"Language: {projectMetadata.Language}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample4_ConversationsAuthoring_GetProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample4_ConversationsAuthoring_GetProjectAsync.cs new file mode 100644 index 000000000000..80ce69768c9d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample4_ConversationsAuthoring_GetProjectAsync.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample4_ConversationsAuthoring_GetProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task GetProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample4_ConversationsAuthoring_GetProjectAsync + string projectName = "MySampleProjectAsync"; + + Response response = await authoringClient.GetProjectAsync(projectName); + ProjectMetadata projectMetadata = response.Value; + + Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); + Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); + Console.WriteLine($"Last Trained DateTime: {projectMetadata.LastTrainedDateTime}"); + Console.WriteLine($"Last Deployed DateTime: {projectMetadata.LastDeployedDateTime}"); + Console.WriteLine($"Project Kind: {projectMetadata.ProjectKind}"); + Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); + Console.WriteLine($"Multilingual: {projectMetadata.Multilingual}"); + Console.WriteLine($"Description: {projectMetadata.Description}"); + Console.WriteLine($"Language: {projectMetadata.Language}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample5_ConversationsAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample5_ConversationsAuthoring_DeleteProject.cs new file mode 100644 index 000000000000..8ae446da37fe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample5_ConversationsAuthoring_DeleteProject.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample5_ConversationsAuthoring_DeleteProject : SamplesBase + { + [Test] + [SyncOnly] + public void DeleteProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample5_ConversationsAuthoring_DeleteProject + string projectName = "MySampleProject"; + + Operation operation = authoringClient.DeleteProject( + waitUntil: WaitUntil.Completed, + projectName: projectName + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.cs new file mode 100644 index 000000000000..7c44295236c3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample5_ConversationsAuthoring_DeleteProjectAsync.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample5_ConversationsAuthoring_DeleteProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeleteProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample5_ConversationsAuthoring_DeleteProjectAsync + string projectName = "MySampleProjectAsync"; + + Operation operation = await authoringClient.DeleteProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample6_ConversationsAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample6_ConversationsAuthoring_Train.cs new file mode 100644 index 000000000000..05d77baa4321 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample6_ConversationsAuthoring_Train.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample6_ConversationsAuthoring_Train : SamplesBase + { + [Test] + [SyncOnly] + public void Train() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample6_ConversationsAuthoring_Train + string projectName = "MySampleProject"; + + var trainingJobDetails = new TrainingJobDetails( + modelLabel: "MyModel", + trainingMode: TrainingMode.Standard + ) + { + TrainingConfigVersion = "1.0", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + Operation operation = authoringClient.Train( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample6_ConversationsAuthoring_TrainAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample6_ConversationsAuthoring_TrainAsync.cs new file mode 100644 index 000000000000..cdae309d2af6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample6_ConversationsAuthoring_TrainAsync.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample6_ConversationsAuthoring_TrainAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task TrainAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample6_ConversationsAuthoring_TrainAsync + string projectName = "MySampleProjectAsync"; + + var trainingJobDetails = new TrainingJobDetails( + modelLabel: "MyModel", + trainingMode: TrainingMode.Standard + ) + { + TrainingConfigVersion = "1.0", + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + Operation operation = await authoringClient.TrainAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails + ); + + // Extract the operation-location header + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample7_ConversationsAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample7_ConversationsAuthoring_CancelTrainingJob.cs new file mode 100644 index 000000000000..e98dd3df8b39 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample7_ConversationsAuthoring_CancelTrainingJob.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample7_ConversationsAuthoring_CancelTrainingJob : SamplesBase + { + [Test] + [SyncOnly] + public void CancelTrainingJob() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample7_ConversationsAuthoring_CancelTrainingJob + string projectName = "MyProject"; + string jobId = "YourTrainingJobId"; + + Operation cancelOperation = authoringClient.CancelTrainingJob( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId + ); + + // Extract the operation-location header + string operationLocation = cancelOperation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Training job cancellation completed with status: {cancelOperation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.cs new file mode 100644 index 000000000000..67bdb7cb47ca --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample7_ConversationsAuthoring_CancelTrainingJobAsync.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample7_ConversationsAuthoring_CancelTrainingJobAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task CancelTrainingJobAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample7_ConversationsAuthoring_CancelTrainingJobAsync + string projectName = "MyProject"; + string jobId = "YourTrainingJobId"; + + Operation cancelOperation = await authoringClient.CancelTrainingJobAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId + ); + + // Extract the operation-location header + string operationLocation = cancelOperation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + + Console.WriteLine($"Training job cancellation completed with status: {cancelOperation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.cs new file mode 100644 index 000000000000..a24e1e06e19a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummary.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample8_ConversationsAuthoring_GetModelEvaluationSummary : SamplesBase + { + [Test] + [SyncOnly] + public void GetModelEvaluationSummary() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample8_ConversationsAuthoring_GetModelEvaluationSummary + string projectName = "MyProject"; + string trainedModelLabel = "YourTrainedModelLabel"; + + Response evaluationSummaryResponse = authoringClient.GetModelEvaluationSummary( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Print entities evaluation summary + var entitiesEval = evaluationSummaryResponse.Value.EntitiesEvaluation; + Console.WriteLine($"Entities - Micro F1: {entitiesEval.MicroF1}, Micro Precision: {entitiesEval.MicroPrecision}, Micro Recall: {entitiesEval.MicroRecall}"); + Console.WriteLine($"Entities - Macro F1: {entitiesEval.MacroF1}, Macro Precision: {entitiesEval.MacroPrecision}, Macro Recall: {entitiesEval.MacroRecall}"); + + // Print detailed metrics per entity + foreach (var entity in entitiesEval.Entities) + { + Console.WriteLine($"Entity '{entity.Key}': F1 = {entity.Value.F1}, Precision = {entity.Value.Precision}, Recall = {entity.Value.Recall}"); + Console.WriteLine($" True Positives: {entity.Value.TruePositiveCount}, True Negatives: {entity.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {entity.Value.FalsePositiveCount}, False Negatives: {entity.Value.FalseNegativeCount}"); + } + + // Print intents evaluation summary + var intentsEval = evaluationSummaryResponse.Value.IntentsEvaluation; + Console.WriteLine($"Intents - Micro F1: {intentsEval.MicroF1}, Micro Precision: {intentsEval.MicroPrecision}, Micro Recall: {intentsEval.MicroRecall}"); + Console.WriteLine($"Intents - Macro F1: {intentsEval.MacroF1}, Macro Precision: {intentsEval.MacroPrecision}, Macro Recall: {intentsEval.MacroRecall}"); + + // Print detailed metrics per intent + foreach (var intent in intentsEval.Intents) + { + Console.WriteLine($"Intent '{intent.Key}': F1 = {intent.Value.F1}, Precision = {intent.Value.Precision}, Recall = {intent.Value.Recall}"); + Console.WriteLine($" True Positives: {intent.Value.TruePositiveCount}, True Negatives: {intent.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {intent.Value.FalsePositiveCount}, False Negatives: {intent.Value.FalseNegativeCount}"); + } + + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.cs new file mode 100644 index 000000000000..58c1946c6c5d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.AI.Language.Conversations.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task GetModelEvaluationSummaryAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + #region Snippet:Sample8_ConversationsAuthoring_GetModelEvaluationSummaryAsync + string projectName = "MyProject"; + string trainedModelLabel = "YourTrainedModelLabel"; + + Response evaluationSummaryResponse = await authoringClient.GetModelEvaluationSummaryAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Print entities evaluation summary + var entitiesEval = evaluationSummaryResponse.Value.EntitiesEvaluation; + Console.WriteLine($"Entities - Micro F1: {entitiesEval.MicroF1}, Micro Precision: {entitiesEval.MicroPrecision}, Micro Recall: {entitiesEval.MicroRecall}"); + Console.WriteLine($"Entities - Macro F1: {entitiesEval.MacroF1}, Macro Precision: {entitiesEval.MacroPrecision}, Macro Recall: {entitiesEval.MacroRecall}"); + + // Print detailed metrics per entity + foreach (var entity in entitiesEval.Entities) + { + Console.WriteLine($"Entity '{entity.Key}': F1 = {entity.Value.F1}, Precision = {entity.Value.Precision}, Recall = {entity.Value.Recall}"); + Console.WriteLine($" True Positives: {entity.Value.TruePositiveCount}, True Negatives: {entity.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {entity.Value.FalsePositiveCount}, False Negatives: {entity.Value.FalseNegativeCount}"); + } + + // Print intents evaluation summary + var intentsEval = evaluationSummaryResponse.Value.IntentsEvaluation; + Console.WriteLine($"Intents - Micro F1: {intentsEval.MicroF1}, Micro Precision: {intentsEval.MicroPrecision}, Micro Recall: {intentsEval.MicroRecall}"); + Console.WriteLine($"Intents - Macro F1: {intentsEval.MacroF1}, Macro Precision: {intentsEval.MacroPrecision}, Macro Recall: {intentsEval.MacroRecall}"); + + // Print detailed metrics per intent + foreach (var intent in intentsEval.Intents) + { + Console.WriteLine($"Intent '{intent.Key}': F1 = {intent.Value.F1}, Precision = {intent.Value.Precision}, Recall = {intent.Value.Recall}"); + Console.WriteLine($" True Positives: {intent.Value.TruePositiveCount}, True Negatives: {intent.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {intent.Value.FalsePositiveCount}, False Negatives: {intent.Value.FalseNegativeCount}"); + } + + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.cs new file mode 100644 index 000000000000..e12833f95ba6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample9_ConversationsAuthoring_GetModelEvaluationResults.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample9_ConversationsAuthoring_GetModelEvaluationResults : SamplesBase + { + [Test] + [SyncOnly] + public void GetModelEvaluationResults() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string trainedModelLabel = "SampleModel"; + StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + + #region Snippet:Sample9_ConversationsAuthoring_GetModelEvaluationResults + Pageable results = authoringClient.GetModelEvaluationResults( + projectName: projectName, + trainedModelLabel: trainedModelLabel, + stringIndexType: stringIndexType + ); + + foreach (UtteranceEvaluationResult result in results) + { + Console.WriteLine($"Text: {result.Text}"); + Console.WriteLine($"Language: {result.Language}"); + + // Print intents result + Console.WriteLine($"Expected Intent: {result.IntentsResult.ExpectedIntent}"); + Console.WriteLine($"Predicted Intent: {result.IntentsResult.PredictedIntent}"); + + // Print entities result + Console.WriteLine("Expected Entities:"); + foreach (var entity in result.EntitiesResult.ExpectedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine("Predicted Entities:"); + foreach (var entity in result.EntitiesResult.PredictedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine(); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.cs new file mode 100644 index 000000000000..ea1352053904 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/Samples/Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Conversations.Authoring; +using Azure.AI.Language.Conversations.Authoring.Models; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Conversations.Authoring.Tests.Samples +{ + public partial class Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task GetModelEvaluationResultsAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + AnalyzeConversationAuthoring authoringClient = client.GetAnalyzeConversationAuthoringClient(); + + string projectName = "SampleProject"; + string trainedModelLabel = "SampleModel"; + StringIndexType stringIndexType = StringIndexType.Utf16CodeUnit; + + #region Snippet:Sample9_ConversationsAuthoring_GetModelEvaluationResultsAsync + AsyncPageable results = authoringClient.GetModelEvaluationResultsAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel, + stringIndexType: stringIndexType + ); + + await foreach (UtteranceEvaluationResult result in results) + { + Console.WriteLine($"Text: {result.Text}"); + Console.WriteLine($"Language: {result.Language}"); + + // Print intents result + Console.WriteLine($"Expected Intent: {result.IntentsResult.ExpectedIntent}"); + Console.WriteLine($"Predicted Intent: {result.IntentsResult.PredictedIntent}"); + + // Print entities result + Console.WriteLine("Expected Entities:"); + foreach (var entity in result.EntitiesResult.ExpectedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine("Predicted Entities:"); + foreach (var entity in result.EntitiesResult.PredictedEntities) + { + Console.WriteLine($" - Category: {entity.Category}, Offset: {entity.Offset}, Length: {entity.Length}"); + } + + Console.WriteLine(); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CancelTrainingJobAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CancelTrainingJobAsync.json new file mode 100644 index 000000000000..d0620babe08e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CancelTrainingJobAsync.json @@ -0,0 +1,36 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/cd8db9c3-49eb-4cfa-969d-ddd4f72f8e16_638678304000000000/:cancel?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241122.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e2baa58c-3486-4b98-a480-f77b77dc6794", + "Content-Length": "0", + "Date": "Fri, 22 Nov 2024 22:12:14 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/cd8db9c3-49eb-4cfa-969d-ddd4f72f8e16_638678304000000000?api-version=2024-11-15-preview", + "request-id": "e2baa58c-3486-4b98-a480-f77b77dc6794", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "49", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "378964714" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json new file mode 100644 index 000000000000..782b33a7df9d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json @@ -0,0 +1,36 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/cd8db9c3-49eb-4cfa-969d-ddd4f72f8e16_638678304000000000/:cancel?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241122.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f31fab9f-7ca9-4c1d-9279-e499a79372db", + "Content-Length": "0", + "Date": "Fri, 22 Nov 2024 22:15:00 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/cd8db9c3-49eb-4cfa-969d-ddd4f72f8e16_638678304000000000?api-version=2024-11-15-preview", + "request-id": "f31fab9f-7ca9-4c1d-9279-e499a79372db", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "64", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "279668943" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CreateProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CreateProjectAsync.json new file mode 100644 index 000000000000..69486bc81a04 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CreateProjectAsync.json @@ -0,0 +1,52 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync?api-version=2024-11-15-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "136", + "Content-Type": "application/merge-patch+json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectName": "MyNewProjectAsync", + "language": "en", + "projectKind": "Conversation", + "description": "Project description", + "multilingual": true + }, + "StatusCode": 201, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5a132a39-7982-44a5-86b7-9fff49707b7f", + "Content-Length": "223", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 19 Nov 2024 23:45:45 GMT", + "Location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/MyNewProjectAsync", + "request-id": "5a132a39-7982-44a5-86b7-9fff49707b7f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "302", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-11-19T23:45:46Z", + "lastModifiedDateTime": "2024-11-19T23:45:46Z", + "projectKind": "Conversation", + "projectName": "MyNewProjectAsync", + "multilingual": true, + "description": "Project description", + "language": "en" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1814913707" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CreateProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CreateProjectAsyncAsync.json new file mode 100644 index 000000000000..288c1e6dd244 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/CreateProjectAsyncAsync.json @@ -0,0 +1,51 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync?api-version=2024-11-15-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "136", + "Content-Type": "application/merge-patch+json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectName": "MyNewProjectAsync", + "language": "en", + "projectKind": "Conversation", + "description": "Project description", + "multilingual": true + }, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "06002f56-e101-47fe-aa0d-f1d6e4756ae9", + "Content-Length": "223", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 19 Nov 2024 23:53:05 GMT", + "request-id": "06002f56-e101-47fe-aa0d-f1d6e4756ae9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "51", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "0001-01-01T00:00:00Z", + "lastModifiedDateTime": "0001-01-01T00:00:00Z", + "projectKind": "Conversation", + "projectName": "MyNewProjectAsync", + "multilingual": true, + "description": "Project description", + "language": "en" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1238287766" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteDeploymentAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteDeploymentAsync.json new file mode 100644 index 000000000000..90c42b716af5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteDeploymentAsync.json @@ -0,0 +1,252 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1f3d1a97-fc7f-4aa2-9196-f2e680bae38f", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:25:38 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "request-id": "1f3d1a97-fc7f-4aa2-9196-f2e680bae38f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "78", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b74c3e0f-7d36-411d-9138-cb704bb49540", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:38 GMT", + "request-id": "b74c3e0f-7d36-411d-9138-cb704bb49540", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "35", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:39Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "23abf7a2-4b4d-4d63-9492-a42f7bf84f7c", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:39 GMT", + "request-id": "23abf7a2-4b4d-4d63-9492-a42f7bf84f7c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "42", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:39Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "04487de2-8822-44e8-9fe0-94a5d89dd044", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:41 GMT", + "request-id": "04487de2-8822-44e8-9fe0-94a5d89dd044", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:39Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ea85135a-a501-4a10-a204-8c6d575350ee", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:42 GMT", + "request-id": "ea85135a-a501-4a10-a204-8c6d575350ee", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:39Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "96dd0a1d-e1ff-4151-b24c-6dbb07a451ab", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:43 GMT", + "request-id": "96dd0a1d-e1ff-4151-b24c-6dbb07a451ab", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:39Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "dba0d52d-2670-482f-a803-b7216bf334b9", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:44 GMT", + "request-id": "dba0d52d-2670-482f-a803-b7216bf334b9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:39Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "dee35d0d-49e0-4b52-b45b-4d3c90f6a792", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:25:45 GMT", + "request-id": "dee35d0d-49e0-4b52-b45b-4d3c90f6a792", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e97aa4e6-50a5-46b7-881a-fbdcc3c76fa9_638676576000000000", + "createdDateTime": "2024-11-20T04:25:39Z", + "lastUpdatedDateTime": "2024-11-20T04:25:46Z", + "expirationDateTime": "2024-11-27T04:25:39Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1248106840" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json new file mode 100644 index 000000000000..dd149ca34f4c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json @@ -0,0 +1,221 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "94204512-fb52-430e-aa31-c2e81221ea5e", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:27:22 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "request-id": "94204512-fb52-430e-aa31-c2e81221ea5e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "181", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3a16198a-bfb1-4b08-b35f-f8706b7d24a3", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:27:22 GMT", + "request-id": "3a16198a-bfb1-4b08-b35f-f8706b7d24a3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "40", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000", + "createdDateTime": "2024-11-20T04:27:22Z", + "lastUpdatedDateTime": "2024-11-20T04:27:22Z", + "expirationDateTime": "2024-11-27T04:27:22Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "cf0f32f5-f7ad-4a25-826a-610a7b30e4fd", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:27:23 GMT", + "request-id": "cf0f32f5-f7ad-4a25-826a-610a7b30e4fd", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000", + "createdDateTime": "2024-11-20T04:27:22Z", + "lastUpdatedDateTime": "2024-11-20T04:27:22Z", + "expirationDateTime": "2024-11-27T04:27:22Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7ada3e68-6899-426c-835c-6666897bed58", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:27:24 GMT", + "request-id": "7ada3e68-6899-426c-835c-6666897bed58", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000", + "createdDateTime": "2024-11-20T04:27:22Z", + "lastUpdatedDateTime": "2024-11-20T04:27:22Z", + "expirationDateTime": "2024-11-27T04:27:22Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "55c269c7-f91c-4d58-a9a3-6ff828f1569f", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:27:26 GMT", + "request-id": "55c269c7-f91c-4d58-a9a3-6ff828f1569f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000", + "createdDateTime": "2024-11-20T04:27:22Z", + "lastUpdatedDateTime": "2024-11-20T04:27:22Z", + "expirationDateTime": "2024-11-27T04:27:22Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "02ecfec0-402e-4de5-8232-ca77a79d4fa3", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:27:27 GMT", + "request-id": "02ecfec0-402e-4de5-8232-ca77a79d4fa3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000", + "createdDateTime": "2024-11-20T04:27:22Z", + "lastUpdatedDateTime": "2024-11-20T04:27:22Z", + "expirationDateTime": "2024-11-27T04:27:22Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/deployment1/jobs/52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7c9d301e-8256-48d4-8761-11161145596d", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:27:28 GMT", + "request-id": "7c9d301e-8256-48d4-8761-11161145596d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "52147911-b327-4811-8a80-d3f3f49aab60_638676576000000000", + "createdDateTime": "2024-11-20T04:27:22Z", + "lastUpdatedDateTime": "2024-11-20T04:27:27Z", + "expirationDateTime": "2024-11-27T04:27:22Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1737681301" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteProjectAsync.json new file mode 100644 index 000000000000..010386a94de2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteProjectAsync.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyTestProject?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "efdbd4fd-501c-4cf9-8793-8b33c878df44", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:30:13 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/deletion-jobs/2f311218-10bb-4cb3-a9d8-487265b07016_638676576000000000?api-version=2024-11-15-preview", + "request-id": "efdbd4fd-501c-4cf9-8793-8b33c878df44", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "68", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/deletion-jobs/2f311218-10bb-4cb3-a9d8-487265b07016_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "18d3bfad-cc61-41d2-ad81-02ea37c007a1", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:30:13 GMT", + "request-id": "18d3bfad-cc61-41d2-ad81-02ea37c007a1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "2f311218-10bb-4cb3-a9d8-487265b07016_638676576000000000", + "createdDateTime": "2024-11-20T04:30:13Z", + "lastUpdatedDateTime": "2024-11-20T04:30:13Z", + "expirationDateTime": "2024-11-27T04:30:13Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1274721189" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteProjectAsyncAsync.json new file mode 100644 index 000000000000..d49216c2f7a1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteProjectAsyncAsync.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyTestProject?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4376b8f7-bf99-4b2d-b0ce-7fc02685c036", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:33:06 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/deletion-jobs/f88171b3-c9aa-42eb-bfcb-82f071192d0b_638676576000000000?api-version=2024-11-15-preview", + "request-id": "4376b8f7-bf99-4b2d-b0ce-7fc02685c036", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "66", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/global/deletion-jobs/f88171b3-c9aa-42eb-bfcb-82f071192d0b_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "18edff20-e2b6-486d-988a-8f021219cf75", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:33:06 GMT", + "request-id": "18edff20-e2b6-486d-988a-8f021219cf75", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "f88171b3-c9aa-42eb-bfcb-82f071192d0b_638676576000000000", + "createdDateTime": "2024-11-20T04:33:07Z", + "lastUpdatedDateTime": "2024-11-20T04:33:07Z", + "expirationDateTime": "2024-11-27T04:33:07Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "891922001" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteTrainedModelAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteTrainedModelAsync.json new file mode 100644 index 000000000000..31d2bad28756 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteTrainedModelAsync.json @@ -0,0 +1,34 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/models/MyModel?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "bdf69e10-86ae-4f22-8989-6e9380b55726", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:37:02 GMT", + "request-id": "bdf69e10-86ae-4f22-8989-6e9380b55726", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "123", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "417699869" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json new file mode 100644 index 000000000000..5564dbac5ba9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json @@ -0,0 +1,34 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/models/MyModel?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a59f3a13-e718-4897-8cae-9b0a4ece3404", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:37:02 GMT", + "request-id": "a59f3a13-e718-4897-8cae-9b0a4ece3404", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "45", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "225041010" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ExportProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ExportProjectAsync.json new file mode 100644 index 000000000000..b90d5c73ca7d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ExportProjectAsync.json @@ -0,0 +1,68 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/:export?stringIndexType=Utf16CodeUnit&api-version=2024-11-15-preview&format=Conversation", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e566b0d5-7a81-4a84-a659-e57cdf23bed9", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 00:02:24 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/1d6cb95e-1a4c-4f3d-95be-98b9e9dadf1f_638676576000000000?api-version=2024-11-15-preview", + "request-id": "e566b0d5-7a81-4a84-a659-e57cdf23bed9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "89", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/1d6cb95e-1a4c-4f3d-95be-98b9e9dadf1f_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4fa649d5-5912-4500-a541-d3ea4ba0b284", + "Content-Length": "454", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:02:24 GMT", + "request-id": "4fa649d5-5912-4500-a541-d3ea4ba0b284", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36", + "x-ms-region": "East US" + }, + "ResponseBody": { + "resultUrl": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/1d6cb95e-1a4c-4f3d-95be-98b9e9dadf1f_638676576000000000/result?api-version=2024-11-15-preview", + "jobId": "1d6cb95e-1a4c-4f3d-95be-98b9e9dadf1f_638676576000000000", + "createdDateTime": "2024-11-20T00:02:25Z", + "lastUpdatedDateTime": "2024-11-20T00:02:25Z", + "expirationDateTime": "2024-11-27T00:02:25Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1365964072" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ExportProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ExportProjectAsyncAsync.json new file mode 100644 index 000000000000..fdceac76e5b8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ExportProjectAsyncAsync.json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/:export?stringIndexType=Utf16CodeUnit&api-version=2024-11-15-preview&format=Conversation", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0c087c5b-b078-484a-88e1-fead426475d9", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 00:20:33 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/e09d5c1b-8a74-4d5e-b2e6-8e21f9ee1ceb_638676576000000000?api-version=2024-11-15-preview", + "request-id": "0c087c5b-b078-484a-88e1-fead426475d9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "48", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/e09d5c1b-8a74-4d5e-b2e6-8e21f9ee1ceb_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b4646a5a-6805-44a6-8090-3a02e4e1581d", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:20:33 GMT", + "request-id": "b4646a5a-6805-44a6-8090-3a02e4e1581d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e09d5c1b-8a74-4d5e-b2e6-8e21f9ee1ceb_638676576000000000", + "createdDateTime": "2024-11-20T00:20:33Z", + "lastUpdatedDateTime": "2024-11-20T00:20:33Z", + "expirationDateTime": "2024-11-27T00:20:33Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/e09d5c1b-8a74-4d5e-b2e6-8e21f9ee1ceb_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6d452efb-0699-496d-b680-8e1d4a425107", + "Content-Length": "454", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:20:34 GMT", + "request-id": "6d452efb-0699-496d-b680-8e1d4a425107", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "resultUrl": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync/export/jobs/e09d5c1b-8a74-4d5e-b2e6-8e21f9ee1ceb_638676576000000000/result?api-version=2024-11-15-preview", + "jobId": "e09d5c1b-8a74-4d5e-b2e6-8e21f9ee1ceb_638676576000000000", + "createdDateTime": "2024-11-20T00:20:33Z", + "lastUpdatedDateTime": "2024-11-20T00:20:33Z", + "expirationDateTime": "2024-11-27T00:20:33Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1801203526" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json new file mode 100644 index 000000000000..67d578242b09 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationResultsAsync.json @@ -0,0 +1,1795 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/evaluation/result?stringIndexType=Utf16CodeUnit&api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "31989231-8f23-454c-82ad-eb2daa52a158", + "Content-Length": "20554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:06:30 GMT", + "request-id": "31989231-8f23-454c-82ad-eb2daa52a158", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "91", + "x-ms-region": "East US" + }, + "ResponseBody": { + "value": [ + { + "text": "I would like to re-write my out of office response please", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 16, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 25, + "length": 2 + }, + { + "category": "OfficeType", + "offset": 35, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Can you guide me through the process of editing a meeting?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 40, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 14, + "length": 2 + }, + { + "category": "Activity.Edit", + "offset": 40, + "length": 7 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Modify the date and time in the automatic replies I had set", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 50, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 56, + "length": 3 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I need to switch the meeting room.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Please change the meeting room.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 7, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Edit", + "offset": 7, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to edit a meeting", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to modify my case details", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 10, + "length": 6 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 17, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Can you help me make changes to a scheduled meeting?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 21, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 13, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I need your help in editing my out of office responses", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 20, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 20, + "length": 7 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 28, + "length": 2 + }, + { + "category": "OfficeType", + "offset": 38, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "update the time in my out of office replies", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 19, + "length": 2 + }, + { + "category": "OfficeType", + "offset": 29, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to edit my auto responses", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 15, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I'm looking for assistance in making edits to a meeting on my calendar.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 37, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 3 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 59, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "open a new ticket", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Start 29/8/2023, end 31/8/2023", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Date", + "offset": 6, + "length": 9 + }, + { + "category": "Date", + "offset": 21, + "length": 9 + } + ], + "predictedEntities": [ + { + "category": "Date", + "offset": 6, + "length": 9 + }, + { + "category": "Date", + "offset": 21, + "length": 9 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Hello, I want to set out of office from May 18 2023", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 17, + "length": 3 + }, + { + "category": "Date", + "offset": 40, + "length": 11 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 7, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 17, + "length": 3 + }, + { + "category": "OfficeType", + "offset": 28, + "length": 6 + }, + { + "category": "Date", + "offset": 40, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Keep ooo starting from today", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Date", + "offset": 23, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Date", + "offset": 9, + "length": 19 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I need to set my automatic replies as I will be on leave from tomorrow", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 10, + "length": 3 + }, + { + "category": "Date", + "offset": 62, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 10, + "length": 3 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 14, + "length": 2 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 38, + "length": 1 + }, + { + "category": "Location.Country", + "offset": 45, + "length": 2 + }, + { + "category": "SystemName", + "offset": 51, + "length": 5 + }, + { + "category": "Date", + "offset": 62, + "length": 8 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "make changes to meeting scheduled for this friday", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 5, + "length": 7 + }, + { + "category": "Date", + "offset": 43, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Date", + "offset": 38, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Close the automatic responses I had assigned", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 5 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 30, + "length": 1 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Turn off my ooo message", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 8 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 9, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Is it possible to cancel a meeting", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 18, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Location.Country", + "offset": 3, + "length": 2 + }, + { + "category": "Activity.Cancel", + "offset": 18, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "What is the process of cancelling a meeting", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 23, + "length": 10 + } + ], + "predictedEntities": [ + { + "category": "Activity.Cancel", + "offset": 23, + "length": 10 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "can you please locate 'Mary Ma' for me?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 23, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 23, + "length": 7 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 36, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Look up for 'Ang Peng Siong'", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 13, + "length": 14 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 13, + "length": 14 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is chewling ong", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 7, + "length": 12 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 7, + "length": 12 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Who works with amy williams", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 4, + "length": 10 + }, + { + "category": "PersonName", + "offset": 15, + "length": 12 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 4, + "length": 10 + }, + { + "category": "PersonName", + "offset": 15, + "length": 12 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who are the colleagues of Samara", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 12, + "length": 10 + }, + { + "category": "PersonName", + "offset": 26, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 12, + "length": 10 + }, + { + "category": "PersonName", + "offset": 26, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Who does Emma work with?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 9, + "length": 4 + }, + { + "category": "WhoIs_Peers", + "offset": 14, + "length": 9 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 9, + "length": 4 + }, + { + "category": "WhoIs_Peers", + "offset": 14, + "length": 9 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is the peer of emily?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "book a conference room for 35min ", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Duration", + "offset": 27, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "MeetingRoomsList", + "offset": 7, + "length": 15 + }, + { + "category": "Duration", + "offset": 27, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Schedule Out of office replies for 3 days starting from next Monday", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 8 + }, + { + "category": "Duration", + "offset": 35, + "length": 6 + }, + { + "category": "Date", + "offset": 61, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "OfficeType", + "offset": 16, + "length": 6 + }, + { + "category": "Duration", + "offset": 35, + "length": 6 + }, + { + "category": "Date", + "offset": 42, + "length": 25 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Set ooo for 1 week, starting tomorrow", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 8, + "length": 10 + }, + { + "category": "Date", + "offset": 29, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 8, + "length": 10 + }, + { + "category": "Date", + "offset": 20, + "length": 17 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Set meeting for an hour this friday", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 16, + "length": 7 + }, + { + "category": "Date", + "offset": 29, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 12, + "length": 11 + }, + { + "category": "Date", + "offset": 24, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "book a meeting room from 8 to 10am tomorrow", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Duration", + "offset": 25, + "length": 9 + }, + { + "category": "Date", + "offset": 35, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Date", + "offset": 20, + "length": 23 + }, + { + "category": "Duration", + "offset": 20, + "length": 23 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Set out of office response for a day starting this Friday at 5 pm.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 33, + "length": 3 + }, + { + "category": "Date", + "offset": 51, + "length": 6 + }, + { + "category": "StartTime", + "offset": 61, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "OfficeType", + "offset": 11, + "length": 6 + }, + { + "category": "Duration", + "offset": 27, + "length": 9 + }, + { + "category": "Date", + "offset": 37, + "length": 20 + }, + { + "category": "StartTime", + "offset": 58, + "length": 7 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "set ooo from 10th aug to 13th aug starting from 10 am", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Date", + "offset": 13, + "length": 8 + }, + { + "category": "Date", + "offset": 25, + "length": 8 + }, + { + "category": "StartTime", + "offset": 48, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Date", + "offset": 8, + "length": 25 + }, + { + "category": "StartTime", + "offset": 48, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Find an available board room for 8 ppl from 6 pm to 7.30 pm", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Capacity", + "offset": 33, + "length": 5 + }, + { + "category": "StartTime", + "offset": 44, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Capacity", + "offset": 33, + "length": 5 + }, + { + "category": "StartTime", + "offset": 39, + "length": 20 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Reserve the \"Opal\" meeting room for Tuesday at 13:00 for 8 pax", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "Date", + "offset": 36, + "length": 7 + }, + { + "category": "StartTime", + "offset": 47, + "length": 5 + }, + { + "category": "Capacity", + "offset": 57, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "Date", + "offset": 36, + "length": 16 + }, + { + "category": "StartTime", + "offset": 36, + "length": 16 + }, + { + "category": "Capacity", + "offset": 57, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Book a meeting room for 6pers", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Capacity", + "offset": 24, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Help me with booking a meeting room at 9 floor", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 13, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 39, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 5, + "length": 2 + }, + { + "category": "Activity.Raise", + "offset": 13, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 39, + "length": 7 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Reserve a meeting room on the seventh floor", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 30, + "length": 13 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 30, + "length": 13 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to book free meeting room for 7 pers from 18:00-19:00 on the 5th floor this Thursday ", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 10, + "length": 4 + }, + { + "category": "Capacity", + "offset": 37, + "length": 6 + }, + { + "category": "StartTime", + "offset": 49, + "length": 5 + }, + { + "category": "FloorNumber", + "offset": 68, + "length": 9 + }, + { + "category": "Date", + "offset": 83, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 10, + "length": 4 + }, + { + "category": "Capacity", + "offset": 37, + "length": 6 + }, + { + "category": "StartTime", + "offset": 44, + "length": 16 + }, + { + "category": "FloorNumber", + "offset": 68, + "length": 9 + }, + { + "category": "Date", + "offset": 78, + "length": 13 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is the boss of harish desi", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Manager", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 11 + } + ], + "predictedEntities": [ + { + "category": "MeetingRoomsList", + "offset": 11, + "length": 4 + }, + { + "category": "WhoIs_Manager", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is \"Roger's\" direct boss?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 5 + }, + { + "category": "WhoIs_Manager", + "offset": 17, + "length": 11 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 5 + }, + { + "category": "WhoIs_Manager", + "offset": 17, + "length": 11 + }, + { + "category": "MeetingRoomsList", + "offset": 24, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "details about the Manager of Ashley timberlake", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Manager", + "offset": 18, + "length": 7 + }, + { + "category": "PersonName", + "offset": 29, + "length": 17 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Manager", + "offset": 18, + "length": 7 + }, + { + "category": "PersonName", + "offset": 29, + "length": 17 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "status of INC2376012", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 6 + }, + { + "category": "TicketNumber", + "offset": 10, + "length": 10 + } + ], + "predictedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 6 + }, + { + "category": "TicketNumber", + "offset": 10, + "length": 10 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "view status of ticket 123", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 4 + }, + { + "category": "TicketNumber", + "offset": 22, + "length": 3 + } + ], + "predictedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 4 + }, + { + "category": "Activity.View", + "offset": 5, + "length": 6 + }, + { + "category": "TicketNumber", + "offset": 22, + "length": 3 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Who are Jasmine's direct reports", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 7 + }, + { + "category": "WhoIs_DirectReports", + "offset": 18, + "length": 14 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 7 + }, + { + "category": "WhoIs_DirectReports", + "offset": 18, + "length": 14 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who are srianth.kalekar.acuvate@suntory.com direct reports", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonEmail", + "offset": 8, + "length": 35 + }, + { + "category": "WhoIs_DirectReports", + "offset": 44, + "length": 14 + } + ], + "predictedEntities": [ + { + "category": "PersonEmail", + "offset": 8, + "length": 35 + }, + { + "category": "WhoIs_DirectReports", + "offset": 44, + "length": 14 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + } + ], + "nextLink": null + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "643903338" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json new file mode 100644 index 000000000000..5e35996ed877 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationResultsAsyncAsync.json @@ -0,0 +1,1795 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/evaluation/result?stringIndexType=Utf16CodeUnit&api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f5fd7642-b6dd-402a-88f2-a3eb176c62a3", + "Content-Length": "20554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:06:31 GMT", + "request-id": "f5fd7642-b6dd-402a-88f2-a3eb176c62a3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "59", + "x-ms-region": "East US" + }, + "ResponseBody": { + "value": [ + { + "text": "I would like to re-write my out of office response please", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 16, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 25, + "length": 2 + }, + { + "category": "OfficeType", + "offset": 35, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Can you guide me through the process of editing a meeting?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 40, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 14, + "length": 2 + }, + { + "category": "Activity.Edit", + "offset": 40, + "length": 7 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Modify the date and time in the automatic replies I had set", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 50, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 56, + "length": 3 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I need to switch the meeting room.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Please change the meeting room.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 7, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Edit", + "offset": 7, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to edit a meeting", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to modify my case details", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 10, + "length": 6 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 17, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Can you help me make changes to a scheduled meeting?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 21, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 13, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I need your help in editing my out of office responses", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 20, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 20, + "length": 7 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 28, + "length": 2 + }, + { + "category": "OfficeType", + "offset": 38, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "update the time in my out of office replies", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Edit", + "offset": 0, + "length": 6 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 19, + "length": 2 + }, + { + "category": "OfficeType", + "offset": 29, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to edit my auto responses", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Edit", + "offset": 10, + "length": 4 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 15, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I'm looking for assistance in making edits to a meeting on my calendar.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 37, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 3 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 59, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "open a new ticket", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Start 29/8/2023, end 31/8/2023", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Date", + "offset": 6, + "length": 9 + }, + { + "category": "Date", + "offset": 21, + "length": 9 + } + ], + "predictedEntities": [ + { + "category": "Date", + "offset": 6, + "length": 9 + }, + { + "category": "Date", + "offset": 21, + "length": 9 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Hello, I want to set out of office from May 18 2023", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 17, + "length": 3 + }, + { + "category": "Date", + "offset": 40, + "length": 11 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 7, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 17, + "length": 3 + }, + { + "category": "OfficeType", + "offset": 28, + "length": 6 + }, + { + "category": "Date", + "offset": 40, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Keep ooo starting from today", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Date", + "offset": 23, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Date", + "offset": 9, + "length": 19 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I need to set my automatic replies as I will be on leave from tomorrow", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 10, + "length": 3 + }, + { + "category": "Date", + "offset": 62, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 10, + "length": 3 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 14, + "length": 2 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 38, + "length": 1 + }, + { + "category": "Location.Country", + "offset": 45, + "length": 2 + }, + { + "category": "SystemName", + "offset": 51, + "length": 5 + }, + { + "category": "Date", + "offset": 62, + "length": 8 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "make changes to meeting scheduled for this friday", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Edit", + "offset": 5, + "length": 7 + }, + { + "category": "Date", + "offset": 43, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Date", + "offset": 38, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Close the automatic responses I had assigned", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 5 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 30, + "length": 1 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Turn off my ooo message", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "Activity.Cancel", + "offset": 0, + "length": 8 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 9, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Is it possible to cancel a meeting", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 18, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Location.Country", + "offset": 3, + "length": 2 + }, + { + "category": "Activity.Cancel", + "offset": 18, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "What is the process of cancelling a meeting", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Cancel", + "offset": 23, + "length": 10 + } + ], + "predictedEntities": [ + { + "category": "Activity.Cancel", + "offset": 23, + "length": 10 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "can you please locate 'Mary Ma' for me?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 23, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 23, + "length": 7 + }, + { + "category": "WhoIs_WhoAmI", + "offset": 36, + "length": 2 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Look up for 'Ang Peng Siong'", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 13, + "length": 14 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 13, + "length": 14 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is chewling ong", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 7, + "length": 12 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 7, + "length": 12 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Who works with amy williams", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 4, + "length": 10 + }, + { + "category": "PersonName", + "offset": 15, + "length": 12 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 4, + "length": 10 + }, + { + "category": "PersonName", + "offset": 15, + "length": 12 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who are the colleagues of Samara", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 12, + "length": 10 + }, + { + "category": "PersonName", + "offset": 26, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 12, + "length": 10 + }, + { + "category": "PersonName", + "offset": 26, + "length": 6 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Who does Emma work with?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 9, + "length": 4 + }, + { + "category": "WhoIs_Peers", + "offset": 14, + "length": 9 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 9, + "length": 4 + }, + { + "category": "WhoIs_Peers", + "offset": 14, + "length": 9 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is the peer of emily?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Peers", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "book a conference room for 35min ", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Duration", + "offset": 27, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "MeetingRoomsList", + "offset": 7, + "length": 15 + }, + { + "category": "Duration", + "offset": 27, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Schedule Out of office replies for 3 days starting from next Monday", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 8 + }, + { + "category": "Duration", + "offset": 35, + "length": 6 + }, + { + "category": "Date", + "offset": 61, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "OfficeType", + "offset": 16, + "length": 6 + }, + { + "category": "Duration", + "offset": 35, + "length": 6 + }, + { + "category": "Date", + "offset": 42, + "length": 25 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Set ooo for 1 week, starting tomorrow", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 8, + "length": 10 + }, + { + "category": "Date", + "offset": 29, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 8, + "length": 10 + }, + { + "category": "Date", + "offset": 20, + "length": 17 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Set meeting for an hour this friday", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 16, + "length": 7 + }, + { + "category": "Date", + "offset": 29, + "length": 6 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 12, + "length": 11 + }, + { + "category": "Date", + "offset": 24, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "book a meeting room from 8 to 10am tomorrow", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Duration", + "offset": 25, + "length": 9 + }, + { + "category": "Date", + "offset": 35, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Date", + "offset": 20, + "length": 23 + }, + { + "category": "Duration", + "offset": 20, + "length": 23 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Set out of office response for a day starting this Friday at 5 pm.", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Duration", + "offset": 33, + "length": 3 + }, + { + "category": "Date", + "offset": 51, + "length": 6 + }, + { + "category": "StartTime", + "offset": 61, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "OfficeType", + "offset": 11, + "length": 6 + }, + { + "category": "Duration", + "offset": 27, + "length": 9 + }, + { + "category": "Date", + "offset": 37, + "length": 20 + }, + { + "category": "StartTime", + "offset": 58, + "length": 7 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "set ooo from 10th aug to 13th aug starting from 10 am", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Date", + "offset": 13, + "length": 8 + }, + { + "category": "Date", + "offset": 25, + "length": 8 + }, + { + "category": "StartTime", + "offset": 48, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 3 + }, + { + "category": "Date", + "offset": 8, + "length": 25 + }, + { + "category": "StartTime", + "offset": 48, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Find an available board room for 8 ppl from 6 pm to 7.30 pm", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Capacity", + "offset": 33, + "length": 5 + }, + { + "category": "StartTime", + "offset": 44, + "length": 4 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Capacity", + "offset": 33, + "length": 5 + }, + { + "category": "StartTime", + "offset": 39, + "length": 20 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Reserve the \"Opal\" meeting room for Tuesday at 13:00 for 8 pax", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "Date", + "offset": 36, + "length": 7 + }, + { + "category": "StartTime", + "offset": 47, + "length": 5 + }, + { + "category": "Capacity", + "offset": 57, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "Date", + "offset": 36, + "length": 16 + }, + { + "category": "StartTime", + "offset": 36, + "length": 16 + }, + { + "category": "Capacity", + "offset": 57, + "length": 5 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Book a meeting room for 6pers", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + }, + { + "category": "Capacity", + "offset": 24, + "length": 5 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Help me with booking a meeting room at 9 floor", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 13, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 39, + "length": 7 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 5, + "length": 2 + }, + { + "category": "Activity.Raise", + "offset": 13, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 39, + "length": 7 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Reserve a meeting room on the seventh floor", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 30, + "length": 13 + } + ], + "predictedEntities": [ + { + "category": "Activity.Raise", + "offset": 0, + "length": 7 + }, + { + "category": "FloorNumber", + "offset": 30, + "length": 13 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "I want to book free meeting room for 7 pers from 18:00-19:00 on the 5th floor this Thursday ", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.Raise", + "offset": 10, + "length": 4 + }, + { + "category": "Capacity", + "offset": 37, + "length": 6 + }, + { + "category": "StartTime", + "offset": 49, + "length": 5 + }, + { + "category": "FloorNumber", + "offset": 68, + "length": 9 + }, + { + "category": "Date", + "offset": 83, + "length": 8 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_WhoAmI", + "offset": 0, + "length": 1 + }, + { + "category": "Activity.Raise", + "offset": 10, + "length": 4 + }, + { + "category": "Capacity", + "offset": 37, + "length": 6 + }, + { + "category": "StartTime", + "offset": 44, + "length": 16 + }, + { + "category": "FloorNumber", + "offset": 68, + "length": 9 + }, + { + "category": "Date", + "offset": 78, + "length": 13 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is the boss of harish desi", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Manager", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 11 + } + ], + "predictedEntities": [ + { + "category": "MeetingRoomsList", + "offset": 11, + "length": 4 + }, + { + "category": "WhoIs_Manager", + "offset": 11, + "length": 4 + }, + { + "category": "PersonName", + "offset": 19, + "length": 11 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who is \"Roger's\" direct boss?", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 5 + }, + { + "category": "WhoIs_Manager", + "offset": 17, + "length": 11 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 5 + }, + { + "category": "WhoIs_Manager", + "offset": 17, + "length": 11 + }, + { + "category": "MeetingRoomsList", + "offset": 24, + "length": 4 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "details about the Manager of Ashley timberlake", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "WhoIs_Manager", + "offset": 18, + "length": 7 + }, + { + "category": "PersonName", + "offset": 29, + "length": 17 + } + ], + "predictedEntities": [ + { + "category": "WhoIs_Manager", + "offset": 18, + "length": 7 + }, + { + "category": "PersonName", + "offset": 29, + "length": 17 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "status of INC2376012", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 6 + }, + { + "category": "TicketNumber", + "offset": 10, + "length": 10 + } + ], + "predictedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 6 + }, + { + "category": "TicketNumber", + "offset": 10, + "length": 10 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "view status of ticket 123", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 4 + }, + { + "category": "TicketNumber", + "offset": 22, + "length": 3 + } + ], + "predictedEntities": [ + { + "category": "Activity.View", + "offset": 0, + "length": 4 + }, + { + "category": "Activity.View", + "offset": 5, + "length": 6 + }, + { + "category": "TicketNumber", + "offset": 22, + "length": 3 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "Who are Jasmine's direct reports", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 7 + }, + { + "category": "WhoIs_DirectReports", + "offset": 18, + "length": 14 + } + ], + "predictedEntities": [ + { + "category": "PersonName", + "offset": 8, + "length": 7 + }, + { + "category": "WhoIs_DirectReports", + "offset": 18, + "length": 14 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + }, + { + "text": "who are srianth.kalekar.acuvate@suntory.com direct reports", + "language": "en-us", + "entitiesResult": { + "expectedEntities": [ + { + "category": "PersonEmail", + "offset": 8, + "length": 35 + }, + { + "category": "WhoIs_DirectReports", + "offset": 44, + "length": 14 + } + ], + "predictedEntities": [ + { + "category": "PersonEmail", + "offset": 8, + "length": 35 + }, + { + "category": "WhoIs_DirectReports", + "offset": 44, + "length": 14 + } + ] + }, + "intentsResult": { + "expectedIntent": "None", + "predictedIntent": "None" + } + } + ], + "nextLink": null + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "408413148" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json new file mode 100644 index 000000000000..50406a803c21 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json @@ -0,0 +1,493 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/evaluation/summary-result?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ee4889e2-aa70-49d2-83fa-48628ec41a18", + "Content-Length": "7102", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:05:07 GMT", + "request-id": "ee4889e2-aa70-49d2-83fa-48628ec41a18", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "79", + "x-ms-region": "East US" + }, + "ResponseBody": { + "entitiesEvaluation": { + "confusionMatrix": { + "Date": { + "Date": { + "normalizedValue": 88.23529, + "rawValue": 15.0 + }, + "Duration": { + "normalizedValue": 5.882353, + "rawValue": 1.0 + }, + "StartTime": { + "normalizedValue": 5.882353, + "rawValue": 1.0 + } + }, + "UserPreferredLanguage": {}, + "Duration": { + "Duration": { + "normalizedValue": 85.71429, + "rawValue": 6.0 + }, + "Date": { + "normalizedValue": 14.285714, + "rawValue": 1.0 + } + }, + "Activity.Raise": { + "Activity.Raise": { + "normalizedValue": 88.23529, + "rawValue": 15.0 + }, + "$none": { + "normalizedValue": 11.764706, + "rawValue": 2.0 + } + }, + "Activity.Edit": { + "$none": { + "normalizedValue": 38.46154, + "rawValue": 5.0 + }, + "Activity.Edit": { + "normalizedValue": 61.53846, + "rawValue": 8.0 + } + }, + "Activity.Cancel": { + "Activity.Cancel": { + "normalizedValue": 100.0, + "rawValue": 4.0 + } + }, + "Activity.View": { + "Activity.View": { + "normalizedValue": 100.0, + "rawValue": 2.0 + } + }, + "Location.Country": {}, + "TicketNumber": { + "TicketNumber": { + "normalizedValue": 100.0, + "rawValue": 2.0 + } + }, + "Location.City": {}, + "Location.Office": {}, + "StartTime": { + "StartTime": { + "normalizedValue": 83.333336, + "rawValue": 5.0 + }, + "Date": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "FloorNumber": { + "FloorNumber": { + "normalizedValue": 100.0, + "rawValue": 3.0 + } + }, + "Capacity": { + "Capacity": { + "normalizedValue": 75.0, + "rawValue": 3.0 + }, + "$none": { + "normalizedValue": 25.0, + "rawValue": 1.0 + } + }, + "PersonName": { + "PersonName": { + "normalizedValue": 100.0, + "rawValue": 11.0 + } + }, + "PersonEmail": { + "PersonEmail": { + "normalizedValue": 100.0, + "rawValue": 1.0 + } + }, + "MeetingRoomsList": {}, + "SystemName": {}, + "WhoIs_Manager": { + "MeetingRoomsList": { + "normalizedValue": 31.818182, + "rawValue": 1.4 + }, + "WhoIs_Manager": { + "normalizedValue": 68.181816, + "rawValue": 3.0 + } + }, + "WhoIs_Peers": { + "WhoIs_Peers": { + "normalizedValue": 100.0, + "rawValue": 4.0 + } + }, + "WhoIs_WhoAmI": {}, + "WhoIs_DirectReports": { + "WhoIs_DirectReports": { + "normalizedValue": 100.0, + "rawValue": 2.0 + } + }, + "FacilityType": {}, + "OfficeType": {}, + "OfficeName": {}, + "RegionName": {}, + "$none": { + "WhoIs_WhoAmI": { + "normalizedValue": 2.9303622, + "rawValue": 2.761866 + }, + "$none": { + "normalizedValue": 77.76676, + "rawValue": 73.295166 + }, + "OfficeType": { + "normalizedValue": 1.7489973, + "rawValue": 1.6484299 + }, + "Activity.Raise": { + "normalizedValue": 0.07578629, + "rawValue": 0.071428575 + }, + "Date": { + "normalizedValue": 9.199277, + "rawValue": 8.670318 + }, + "Location.Country": { + "normalizedValue": 0.2074151, + "rawValue": 0.19548872 + }, + "SystemName": { + "normalizedValue": 0.13960633, + "rawValue": 0.13157895 + }, + "MeetingRoomsList": { + "normalizedValue": 0.8252285, + "rawValue": 0.7777778 + }, + "Duration": { + "normalizedValue": 0.76807755, + "rawValue": 0.7239131 + }, + "StartTime": { + "normalizedValue": 5.883772, + "rawValue": 5.5454545 + }, + "Activity.View": { + "normalizedValue": 0.45471773, + "rawValue": 0.42857143 + } + } + }, + "entities": { + "Activity.Edit": { + "f1": 0.761904776096344, + "precision": 1.0, + "recall": 0.6153846383094788, + "truePositiveCount": 8, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 5 + }, + "WhoIs_WhoAmI": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 25, + "falseNegativeCount": 0 + }, + "OfficeType": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 6, + "falseNegativeCount": 0 + }, + "Activity.Raise": { + "f1": 0.9090908765792847, + "precision": 0.9375, + "recall": 0.8823529481887817, + "truePositiveCount": 15, + "trueNegativeCount": 0, + "falsePositiveCount": 1, + "falseNegativeCount": 2 + }, + "Date": { + "f1": 0.27586209774017334, + "precision": 0.2857142984867096, + "recall": 0.2666666805744171, + "truePositiveCount": 4, + "trueNegativeCount": 0, + "falsePositiveCount": 10, + "falseNegativeCount": 11 + }, + "Location.Country": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 2, + "falseNegativeCount": 0 + }, + "SystemName": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 1, + "falseNegativeCount": 0 + }, + "Activity.Cancel": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 4, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "PersonName": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 11, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "WhoIs_Peers": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 4, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Duration": { + "f1": 0.5, + "precision": 0.5, + "recall": 0.5, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 3, + "falseNegativeCount": 3 + }, + "MeetingRoomsList": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 3, + "falseNegativeCount": 0 + }, + "StartTime": { + "f1": 0.20000000298023224, + "precision": 0.20000000298023224, + "recall": 0.20000000298023224, + "truePositiveCount": 1, + "trueNegativeCount": 0, + "falsePositiveCount": 4, + "falseNegativeCount": 4 + }, + "Capacity": { + "f1": 0.8571428060531616, + "precision": 1.0, + "recall": 0.75, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 1 + }, + "FloorNumber": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "WhoIs_Manager": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Activity.View": { + "f1": 0.800000011920929, + "precision": 0.6666666865348816, + "recall": 1.0, + "truePositiveCount": 2, + "trueNegativeCount": 0, + "falsePositiveCount": 1, + "falseNegativeCount": 0 + }, + "TicketNumber": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 2, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "WhoIs_DirectReports": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 2, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "PersonEmail": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 1, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "UserPreferredLanguage": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Location.City": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Location.Office": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "FacilityType": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "OfficeName": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "RegionName": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + } + }, + "microF1": 0.6168225, + "microPrecision": 0.5409836, + "microRecall": 0.7173913, + "macroF1": 0.8202667, + "macroPrecision": 0.83932537, + "macroRecall": 0.8142936 + }, + "intentsEvaluation": { + "confusionMatrix": { + "None": { + "None": { + "normalizedValue": 100.0, + "rawValue": 49.0 + } + } + }, + "intents": { + "None": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 49, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + } + }, + "microF1": 1.0, + "microPrecision": 1.0, + "microRecall": 1.0, + "macroF1": 1.0, + "macroPrecision": 1.0, + "macroRecall": 1.0 + }, + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "497265056" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json new file mode 100644 index 000000000000..0f1fa0c13e08 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json @@ -0,0 +1,493 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/evaluation/summary-result?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a0a4b06d-c5e0-4e58-8d85-0d908430c201", + "Content-Length": "7102", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:05:07 GMT", + "request-id": "a0a4b06d-c5e0-4e58-8d85-0d908430c201", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "74", + "x-ms-region": "East US" + }, + "ResponseBody": { + "entitiesEvaluation": { + "confusionMatrix": { + "Date": { + "Date": { + "normalizedValue": 88.23529, + "rawValue": 15.0 + }, + "Duration": { + "normalizedValue": 5.882353, + "rawValue": 1.0 + }, + "StartTime": { + "normalizedValue": 5.882353, + "rawValue": 1.0 + } + }, + "UserPreferredLanguage": {}, + "Duration": { + "Duration": { + "normalizedValue": 85.71429, + "rawValue": 6.0 + }, + "Date": { + "normalizedValue": 14.285714, + "rawValue": 1.0 + } + }, + "Activity.Raise": { + "Activity.Raise": { + "normalizedValue": 88.23529, + "rawValue": 15.0 + }, + "$none": { + "normalizedValue": 11.764706, + "rawValue": 2.0 + } + }, + "Activity.Edit": { + "$none": { + "normalizedValue": 38.46154, + "rawValue": 5.0 + }, + "Activity.Edit": { + "normalizedValue": 61.53846, + "rawValue": 8.0 + } + }, + "Activity.Cancel": { + "Activity.Cancel": { + "normalizedValue": 100.0, + "rawValue": 4.0 + } + }, + "Activity.View": { + "Activity.View": { + "normalizedValue": 100.0, + "rawValue": 2.0 + } + }, + "Location.Country": {}, + "TicketNumber": { + "TicketNumber": { + "normalizedValue": 100.0, + "rawValue": 2.0 + } + }, + "Location.City": {}, + "Location.Office": {}, + "StartTime": { + "StartTime": { + "normalizedValue": 83.333336, + "rawValue": 5.0 + }, + "Date": { + "normalizedValue": 16.666666, + "rawValue": 1.0 + } + }, + "FloorNumber": { + "FloorNumber": { + "normalizedValue": 100.0, + "rawValue": 3.0 + } + }, + "Capacity": { + "Capacity": { + "normalizedValue": 75.0, + "rawValue": 3.0 + }, + "$none": { + "normalizedValue": 25.0, + "rawValue": 1.0 + } + }, + "PersonName": { + "PersonName": { + "normalizedValue": 100.0, + "rawValue": 11.0 + } + }, + "PersonEmail": { + "PersonEmail": { + "normalizedValue": 100.0, + "rawValue": 1.0 + } + }, + "MeetingRoomsList": {}, + "SystemName": {}, + "WhoIs_Manager": { + "MeetingRoomsList": { + "normalizedValue": 31.818182, + "rawValue": 1.4 + }, + "WhoIs_Manager": { + "normalizedValue": 68.181816, + "rawValue": 3.0 + } + }, + "WhoIs_Peers": { + "WhoIs_Peers": { + "normalizedValue": 100.0, + "rawValue": 4.0 + } + }, + "WhoIs_WhoAmI": {}, + "WhoIs_DirectReports": { + "WhoIs_DirectReports": { + "normalizedValue": 100.0, + "rawValue": 2.0 + } + }, + "FacilityType": {}, + "OfficeType": {}, + "OfficeName": {}, + "RegionName": {}, + "$none": { + "WhoIs_WhoAmI": { + "normalizedValue": 2.9303622, + "rawValue": 2.761866 + }, + "$none": { + "normalizedValue": 77.76676, + "rawValue": 73.295166 + }, + "OfficeType": { + "normalizedValue": 1.7489973, + "rawValue": 1.6484299 + }, + "Activity.Raise": { + "normalizedValue": 0.07578629, + "rawValue": 0.071428575 + }, + "Date": { + "normalizedValue": 9.199277, + "rawValue": 8.670318 + }, + "Location.Country": { + "normalizedValue": 0.2074151, + "rawValue": 0.19548872 + }, + "SystemName": { + "normalizedValue": 0.13960633, + "rawValue": 0.13157895 + }, + "MeetingRoomsList": { + "normalizedValue": 0.8252285, + "rawValue": 0.7777778 + }, + "Duration": { + "normalizedValue": 0.76807755, + "rawValue": 0.7239131 + }, + "StartTime": { + "normalizedValue": 5.883772, + "rawValue": 5.5454545 + }, + "Activity.View": { + "normalizedValue": 0.45471773, + "rawValue": 0.42857143 + } + } + }, + "entities": { + "Activity.Edit": { + "f1": 0.761904776096344, + "precision": 1.0, + "recall": 0.6153846383094788, + "truePositiveCount": 8, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 5 + }, + "WhoIs_WhoAmI": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 25, + "falseNegativeCount": 0 + }, + "OfficeType": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 6, + "falseNegativeCount": 0 + }, + "Activity.Raise": { + "f1": 0.9090908765792847, + "precision": 0.9375, + "recall": 0.8823529481887817, + "truePositiveCount": 15, + "trueNegativeCount": 0, + "falsePositiveCount": 1, + "falseNegativeCount": 2 + }, + "Date": { + "f1": 0.27586209774017334, + "precision": 0.2857142984867096, + "recall": 0.2666666805744171, + "truePositiveCount": 4, + "trueNegativeCount": 0, + "falsePositiveCount": 10, + "falseNegativeCount": 11 + }, + "Location.Country": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 2, + "falseNegativeCount": 0 + }, + "SystemName": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 1, + "falseNegativeCount": 0 + }, + "Activity.Cancel": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 4, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "PersonName": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 11, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "WhoIs_Peers": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 4, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Duration": { + "f1": 0.5, + "precision": 0.5, + "recall": 0.5, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 3, + "falseNegativeCount": 3 + }, + "MeetingRoomsList": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 3, + "falseNegativeCount": 0 + }, + "StartTime": { + "f1": 0.20000000298023224, + "precision": 0.20000000298023224, + "recall": 0.20000000298023224, + "truePositiveCount": 1, + "trueNegativeCount": 0, + "falsePositiveCount": 4, + "falseNegativeCount": 4 + }, + "Capacity": { + "f1": 0.8571428060531616, + "precision": 1.0, + "recall": 0.75, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 1 + }, + "FloorNumber": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "WhoIs_Manager": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 3, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Activity.View": { + "f1": 0.800000011920929, + "precision": 0.6666666865348816, + "recall": 1.0, + "truePositiveCount": 2, + "trueNegativeCount": 0, + "falsePositiveCount": 1, + "falseNegativeCount": 0 + }, + "TicketNumber": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 2, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "WhoIs_DirectReports": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 2, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "PersonEmail": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 1, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "UserPreferredLanguage": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Location.City": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Location.Office": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "FacilityType": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "OfficeName": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "RegionName": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + } + }, + "microF1": 0.6168225, + "microPrecision": 0.5409836, + "microRecall": 0.7173913, + "macroF1": 0.8202667, + "macroPrecision": 0.83932537, + "macroRecall": 0.8142936 + }, + "intentsEvaluation": { + "confusionMatrix": { + "None": { + "None": { + "normalizedValue": 100.0, + "rawValue": 49.0 + } + } + }, + "intents": { + "None": { + "f1": 1.0, + "precision": 1.0, + "recall": 1.0, + "truePositiveCount": 49, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + } + }, + "microF1": 1.0, + "microPrecision": 1.0, + "microRecall": 1.0, + "macroF1": 1.0, + "macroPrecision": 1.0, + "macroRecall": 1.0 + }, + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1960375238" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetProjectAsync.json new file mode 100644 index 000000000000..64c9ca209d4f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetProjectAsync.json @@ -0,0 +1,43 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "17e882d5-134f-48d2-bfb8-4a6b7c4479d4", + "Content-Length": "223", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 19 Nov 2024 23:55:15 GMT", + "request-id": "17e882d5-134f-48d2-bfb8-4a6b7c4479d4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "21", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-11-19T23:45:46Z", + "lastModifiedDateTime": "2024-11-19T23:53:05Z", + "projectKind": "Conversation", + "projectName": "MyNewProjectAsync", + "multilingual": true, + "description": "Project description", + "language": "en" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "500255747" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetProjectAsyncAsync.json new file mode 100644 index 000000000000..83d612568000 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/GetProjectAsyncAsync.json @@ -0,0 +1,43 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/MyNewProjectAsync?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b408e48c-b16e-4a52-9bc6-04c1faa814f6", + "Content-Length": "223", + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 19 Nov 2024 23:55:15 GMT", + "request-id": "b408e48c-b16e-4a52-9bc6-04c1faa814f6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-11-19T23:45:46Z", + "lastModifiedDateTime": "2024-11-19T23:53:05Z", + "projectKind": "Conversation", + "projectName": "MyNewProjectAsync", + "multilingual": true, + "description": "Project description", + "language": "en" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1329906302" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ImportProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ImportProjectAsync.json new file mode 100644 index 000000000000..03a7ac40669d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ImportProjectAsync.json @@ -0,0 +1,170 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/:import?api-version=2024-11-15-preview&format=Conversation", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "863", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241120.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectFileVersion": "2022-10-01-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "Conversation", + "settings": { + "confidenceThreshold": 0 + }, + "projectName": "Test-data-labels", + "multilingual": false, + "description": "", + "language": "en-us" + }, + "assets": { + "intents": [ + { + "category": "None" + }, + { + "category": "Buy" + } + ], + "entities": [ + { + "category": "product", + "compositionSetting": "combineComponents" + } + ], + "utterances": [ + { + "entities": [ + { + "category": "product", + "offset": 16, + "length": 5 + } + ], + "text": "I want to buy a house", + "language": "en-us", + "intent": "Buy", + "dataset": "Train" + }, + { + "entities": [ + { + "category": "product", + "offset": 14, + "length": 11 + } + ], + "text": "I want to buy surface pro", + "language": "en-us", + "intent": "Buy", + "dataset": "Train" + }, + { + "entities": [ + { + "category": "product", + "offset": 14, + "length": 4 + } + ], + "text": "I want to buy xbox", + "language": "en-us", + "intent": "Buy", + "dataset": "Train" + } + ], + "projectKind": "Conversation" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9c1a78d4-6658-4991-ad38-81bdb79b1d92", + "Content-Length": "0", + "Date": "Thu, 21 Nov 2024 01:27:32 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/import/jobs/6a2bbc92-8113-4591-bc08-d47e3dbf6530_638677440000000000?api-version=2024-11-15-preview", + "request-id": "9c1a78d4-6658-4991-ad38-81bdb79b1d92", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "250", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/import/jobs/6a2bbc92-8113-4591-bc08-d47e3dbf6530_638677440000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241120.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c8db1d59-5fbe-411a-b925-05337ab4d72b", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 21 Nov 2024 01:27:32 GMT", + "request-id": "c8db1d59-5fbe-411a-b925-05337ab4d72b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "37", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "6a2bbc92-8113-4591-bc08-d47e3dbf6530_638677440000000000", + "createdDateTime": "2024-11-21T01:27:32Z", + "lastUpdatedDateTime": "2024-11-21T01:27:32Z", + "expirationDateTime": "2024-11-28T01:27:32Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/import/jobs/6a2bbc92-8113-4591-bc08-d47e3dbf6530_638677440000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241120.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "bde083d5-e2ba-4bb2-ae0a-69182ef8cc0d", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 21 Nov 2024 01:27:33 GMT", + "request-id": "bde083d5-e2ba-4bb2-ae0a-69182ef8cc0d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "6a2bbc92-8113-4591-bc08-d47e3dbf6530_638677440000000000", + "createdDateTime": "2024-11-21T01:27:32Z", + "lastUpdatedDateTime": "2024-11-21T01:27:33Z", + "expirationDateTime": "2024-11-28T01:27:32Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1283526649" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ImportProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ImportProjectAsyncAsync.json new file mode 100644 index 000000000000..c030753b3cf6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/ImportProjectAsyncAsync.json @@ -0,0 +1,170 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/:import?api-version=2024-11-15-preview&format=Conversation", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "863", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241120.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectFileVersion": "2022-10-01-preview", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "Conversation", + "settings": { + "confidenceThreshold": 0 + }, + "projectName": "Test-data-labels", + "multilingual": false, + "description": "", + "language": "en-us" + }, + "assets": { + "intents": [ + { + "category": "None" + }, + { + "category": "Buy" + } + ], + "entities": [ + { + "category": "product", + "compositionSetting": "combineComponents" + } + ], + "utterances": [ + { + "entities": [ + { + "category": "product", + "offset": 16, + "length": 5 + } + ], + "text": "I want to buy a house", + "language": "en-us", + "intent": "Buy", + "dataset": "Train" + }, + { + "entities": [ + { + "category": "product", + "offset": 14, + "length": 11 + } + ], + "text": "I want to buy surface pro", + "language": "en-us", + "intent": "Buy", + "dataset": "Train" + }, + { + "entities": [ + { + "category": "product", + "offset": 14, + "length": 4 + } + ], + "text": "I want to buy xbox", + "language": "en-us", + "intent": "Buy", + "dataset": "Train" + } + ], + "projectKind": "Conversation" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7f7b13e9-4880-4b08-9a70-0cc3bcd699bf", + "Content-Length": "0", + "Date": "Thu, 21 Nov 2024 01:27:34 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/import/jobs/f06e59d4-d6eb-4283-9dd1-cacc675e1787_638677440000000000?api-version=2024-11-15-preview", + "request-id": "7f7b13e9-4880-4b08-9a70-0cc3bcd699bf", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "205", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/import/jobs/f06e59d4-d6eb-4283-9dd1-cacc675e1787_638677440000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241120.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2f0192ef-d8af-4420-b993-b9612c995711", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 21 Nov 2024 01:27:34 GMT", + "request-id": "2f0192ef-d8af-4420-b993-b9612c995711", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "f06e59d4-d6eb-4283-9dd1-cacc675e1787_638677440000000000", + "createdDateTime": "2024-11-21T01:27:34Z", + "lastUpdatedDateTime": "2024-11-21T01:27:34Z", + "expirationDateTime": "2024-11-28T01:27:34Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/import/jobs/f06e59d4-d6eb-4283-9dd1-cacc675e1787_638677440000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241120.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "14ea3378-1b1a-4aca-9d96-2d73fcce9210", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 21 Nov 2024 01:27:35 GMT", + "request-id": "14ea3378-1b1a-4aca-9d96-2d73fcce9210", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "f06e59d4-d6eb-4283-9dd1-cacc675e1787_638677440000000000", + "createdDateTime": "2024-11-21T01:27:34Z", + "lastUpdatedDateTime": "2024-11-21T01:27:34Z", + "expirationDateTime": "2024-11-28T01:27:34Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1223483235" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/LoadSnapshotAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/LoadSnapshotAsync.json new file mode 100644 index 000000000000..9f8854e5d5be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/LoadSnapshotAsync.json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/:load-snapshot?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "163e3189-0186-4104-9d6d-43ca17b4368c", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 05:07:48 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/load-snapshot/jobs/b9e2306a-3ace-4616-8b9b-6a9bef66e406_638676576000000000?api-version=2024-11-15-preview", + "request-id": "163e3189-0186-4104-9d6d-43ca17b4368c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "135", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/load-snapshot/jobs/b9e2306a-3ace-4616-8b9b-6a9bef66e406_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "cc5113a4-4e10-4a12-a8de-5b2dad72271f", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:07:48 GMT", + "request-id": "cc5113a4-4e10-4a12-a8de-5b2dad72271f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b9e2306a-3ace-4616-8b9b-6a9bef66e406_638676576000000000", + "createdDateTime": "2024-11-20T05:07:49Z", + "lastUpdatedDateTime": "2024-11-20T05:07:49Z", + "expirationDateTime": "2024-11-27T05:07:49Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/load-snapshot/jobs/b9e2306a-3ace-4616-8b9b-6a9bef66e406_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "380345a0-fbfb-4c48-b190-62fb201b99b8", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:07:49 GMT", + "request-id": "380345a0-fbfb-4c48-b190-62fb201b99b8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "63", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b9e2306a-3ace-4616-8b9b-6a9bef66e406_638676576000000000", + "createdDateTime": "2024-11-20T05:07:49Z", + "lastUpdatedDateTime": "2024-11-20T05:07:49Z", + "expirationDateTime": "2024-11-27T05:07:49Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1850441611" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json new file mode 100644 index 000000000000..b82e1a95cd76 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/:load-snapshot?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f375bca8-1c86-403a-ae40-5048ceb692e5", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 05:07:50 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/load-snapshot/jobs/d683339e-f4c0-4bb5-9293-bbc2bd98dc5f_638676576000000000?api-version=2024-11-15-preview", + "request-id": "f375bca8-1c86-403a-ae40-5048ceb692e5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "49", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/load-snapshot/jobs/d683339e-f4c0-4bb5-9293-bbc2bd98dc5f_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "de51dd88-5e5d-4cef-801d-05f097407e6c", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:07:50 GMT", + "request-id": "de51dd88-5e5d-4cef-801d-05f097407e6c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d683339e-f4c0-4bb5-9293-bbc2bd98dc5f_638676576000000000", + "createdDateTime": "2024-11-20T05:07:50Z", + "lastUpdatedDateTime": "2024-11-20T05:07:50Z", + "expirationDateTime": "2024-11-27T05:07:50Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Aurora-CLU-Prod/models/m1/load-snapshot/jobs/d683339e-f4c0-4bb5-9293-bbc2bd98dc5f_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "be6a0a8e-3584-4151-9c86-577772136980", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 05:07:51 GMT", + "request-id": "be6a0a8e-3584-4151-9c86-577772136980", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d683339e-f4c0-4bb5-9293-bbc2bd98dc5f_638676576000000000", + "createdDateTime": "2024-11-20T05:07:50Z", + "lastUpdatedDateTime": "2024-11-20T05:07:50Z", + "expirationDateTime": "2024-11-27T05:07:50Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "312405069" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/SwapDeploymentsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/SwapDeploymentsAsync.json new file mode 100644 index 000000000000..99cd866cca04 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/SwapDeploymentsAsync.json @@ -0,0 +1,257 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/:swap?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "74", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "firstDeploymentName": "deployment1", + "secondDeploymentName": "deployment2" + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c6bd9dc3-65df-4b3e-9419-4f4e82af230f", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:49:59 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "request-id": "c6bd9dc3-65df-4b3e-9419-4f4e82af230f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "326", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "17dfb6fd-6a83-4e16-9c02-574fb93c9073", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:49:59 GMT", + "request-id": "17dfb6fd-6a83-4e16-9c02-574fb93c9073", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "52", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:49:59Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9375a3a2-4ef7-4c1e-a305-4ab727ee24cc", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:00 GMT", + "request-id": "9375a3a2-4ef7-4c1e-a305-4ab727ee24cc", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:49:59Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "42d0169d-6755-440e-97aa-e6856fe09e47", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:01 GMT", + "request-id": "42d0169d-6755-440e-97aa-e6856fe09e47", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:49:59Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e70fb635-9160-4330-adc8-2cd8aee87592", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:03 GMT", + "request-id": "e70fb635-9160-4330-adc8-2cd8aee87592", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:49:59Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "08dff69b-c2fb-436a-bdd1-a3d51efae67b", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:04 GMT", + "request-id": "08dff69b-c2fb-436a-bdd1-a3d51efae67b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:49:59Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "56b66bfd-f740-4584-bb61-a4a91242534d", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:05 GMT", + "request-id": "56b66bfd-f740-4584-bb61-a4a91242534d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:49:59Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7d808ccf-d267-4941-bb17-4ed381df3d0a", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:06 GMT", + "request-id": "7d808ccf-d267-4941-bb17-4ed381df3d0a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7a5dbb43-0470-4f3c-b174-3c7caf1ff54a_638676576000000000", + "createdDateTime": "2024-11-20T04:49:59Z", + "lastUpdatedDateTime": "2024-11-20T04:50:06Z", + "expirationDateTime": "2024-11-27T04:49:59Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "835070108" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json new file mode 100644 index 000000000000..4cb038429a45 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json @@ -0,0 +1,195 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/:swap?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "74", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "firstDeploymentName": "deployment1", + "secondDeploymentName": "deployment2" + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "50a17afa-9afd-47cf-8e93-ac71342045dc", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 04:50:06 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000?api-version=2024-11-15-preview", + "request-id": "50a17afa-9afd-47cf-8e93-ac71342045dc", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "339", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a34998ce-1e0b-4939-a91e-aac7c2e18d10", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:07 GMT", + "request-id": "a34998ce-1e0b-4939-a91e-aac7c2e18d10", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000", + "createdDateTime": "2024-11-20T04:50:07Z", + "lastUpdatedDateTime": "2024-11-20T04:50:07Z", + "expirationDateTime": "2024-11-27T04:50:07Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e97dffa3-4a21-4af5-8319-9594302f87b8", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:08 GMT", + "request-id": "e97dffa3-4a21-4af5-8319-9594302f87b8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000", + "createdDateTime": "2024-11-20T04:50:07Z", + "lastUpdatedDateTime": "2024-11-20T04:50:07Z", + "expirationDateTime": "2024-11-27T04:50:07Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "76e471b9-7a8f-4920-8574-b673389ef3a6", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:09 GMT", + "request-id": "76e471b9-7a8f-4920-8574-b673389ef3a6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000", + "createdDateTime": "2024-11-20T04:50:07Z", + "lastUpdatedDateTime": "2024-11-20T04:50:07Z", + "expirationDateTime": "2024-11-27T04:50:07Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "10094c46-4ca6-4616-868f-ab46f6084021", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:10 GMT", + "request-id": "10094c46-4ca6-4616-868f-ab46f6084021", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000", + "createdDateTime": "2024-11-20T04:50:07Z", + "lastUpdatedDateTime": "2024-11-20T04:50:07Z", + "expirationDateTime": "2024-11-27T04:50:07Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/deployments/swap/jobs/e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8e847caa-2e02-4d9d-a49f-7bb008b52ce9", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 04:50:11 GMT", + "request-id": "8e847caa-2e02-4d9d-a49f-7bb008b52ce9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "e40cdd0a-341d-45fe-9b4a-518cfc6c30fc_638676576000000000", + "createdDateTime": "2024-11-20T04:50:07Z", + "lastUpdatedDateTime": "2024-11-20T04:50:11Z", + "expirationDateTime": "2024-11-27T04:50:07Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "2016216954" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/TrainAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/TrainAsync.json new file mode 100644 index 000000000000..64f010e412f9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/TrainAsync.json @@ -0,0 +1,352 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/:train?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "186", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "dcbffc46-ff41-437d-ab1e-5e1e5548b396", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 00:56:57 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "request-id": "dcbffc46-ff41-437d-ab1e-5e1e5548b396", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "135", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "34f6e849-9340-49ca-8435-45073051b2b8", + "Content-Length": "440", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:56:57 GMT", + "request-id": "34f6e849-9340-49ca-8435-45073051b2b8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "40", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000", + "createdDateTime": "2024-11-20T00:56:57Z", + "lastUpdatedDateTime": "2024-11-20T00:56:57Z", + "expirationDateTime": "2024-11-27T00:56:57Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "800b3a84-39ff-482b-a5d0-6d8128b8a8d2", + "Content-Length": "437", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:56:58 GMT", + "request-id": "800b3a84-39ff-482b-a5d0-6d8128b8a8d2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "38", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000", + "createdDateTime": "2024-11-20T00:56:57Z", + "lastUpdatedDateTime": "2024-11-20T00:56:58Z", + "expirationDateTime": "2024-11-27T00:56:57Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "70796a02-48ea-4d45-8c2e-ec6c34563106", + "Content-Length": "754", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:56:59 GMT", + "request-id": "70796a02-48ea-4d45-8c2e-ec6c34563106", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000", + "createdDateTime": "2024-11-20T00:56:57Z", + "lastUpdatedDateTime": "2024-11-20T00:56:59Z", + "expirationDateTime": "2024-11-27T00:56:57Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7d5789d6-4733-4e9f-bc09-927701fdabaa", + "Content-Length": "754", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:00 GMT", + "request-id": "7d5789d6-4733-4e9f-bc09-927701fdabaa", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000", + "createdDateTime": "2024-11-20T00:56:57Z", + "lastUpdatedDateTime": "2024-11-20T00:56:59Z", + "expirationDateTime": "2024-11-27T00:56:57Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b95822b1-2752-4cca-84c6-c2d26389de13", + "Content-Length": "754", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:02 GMT", + "request-id": "b95822b1-2752-4cca-84c6-c2d26389de13", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "70", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000", + "createdDateTime": "2024-11-20T00:56:57Z", + "lastUpdatedDateTime": "2024-11-20T00:56:59Z", + "expirationDateTime": "2024-11-27T00:56:57Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a90eae53-4dd3-4892-a641-71f1a647b103", + "Content-Length": "849", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:03 GMT", + "request-id": "a90eae53-4dd3-4892-a641-71f1a647b103", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-11-20T00:56:58.8076402Z", + "endDateTime": "2024-11-20T00:57:00.7321859Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "7d2da50c-42c1-411d-a75d-a52288004fd2_638676576000000000", + "createdDateTime": "2024-11-20T00:56:57Z", + "lastUpdatedDateTime": "2024-11-20T00:57:03Z", + "expirationDateTime": "2024-11-27T00:56:57Z", + "status": "succeeded", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "159958576" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/TrainAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/TrainAsyncAsync.json new file mode 100644 index 000000000000..025a096eb35a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tests/SessionRecords/ConversationsAuthoringClientLiveTest/TrainAsyncAsync.json @@ -0,0 +1,414 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/:train?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "186", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b2e48bf6-46de-4d69-8eac-34a6e7ed41ed", + "Content-Length": "0", + "Date": "Wed, 20 Nov 2024 00:57:03 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "request-id": "b2e48bf6-46de-4d69-8eac-34a6e7ed41ed", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "93", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "23066833-7cc2-4dfa-ba5a-c654ffee4d80", + "Content-Length": "440", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:03 GMT", + "request-id": "23066833-7cc2-4dfa-ba5a-c654ffee4d80", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:03Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0bf9516a-dc72-475d-9ee8-fcf96cda1d69", + "Content-Length": "437", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:04 GMT", + "request-id": "0bf9516a-dc72-475d-9ee8-fcf96cda1d69", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:04Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "889ec607-2540-4d17-96e8-d6d190ea296a", + "Content-Length": "852", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:05 GMT", + "request-id": "889ec607-2540-4d17-96e8-d6d190ea296a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-11-20T00:57:05.1715887Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-11-20T00:57:05.1715887Z" + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:05Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "14910b96-4f1a-4c8e-8d6d-1f624fe9d7db", + "Content-Length": "852", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:07 GMT", + "request-id": "14910b96-4f1a-4c8e-8d6d-1f624fe9d7db", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-11-20T00:57:05.1715887Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-11-20T00:57:05.1715887Z" + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:05Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e1ba107d-b251-425c-ad7f-8475df73e6a0", + "Content-Length": "852", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:08 GMT", + "request-id": "e1ba107d-b251-425c-ad7f-8475df73e6a0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-11-20T00:57:05.1715887Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-11-20T00:57:05.1715887Z" + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:05Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2102aea8-7fd2-4b7b-9fa6-9fc78d92c90b", + "Content-Length": "852", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:09 GMT", + "request-id": "2102aea8-7fd2-4b7b-9fa6-9fc78d92c90b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-11-20T00:57:05.1715887Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-11-20T00:57:05.1715887Z" + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:05Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "running", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/Test-data-labels/train/jobs/191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Conversations.Authoring/1.0.0-alpha.20241119.1 (.NET 8.0.10; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e59fd871-c20e-436c-82da-760dd2467199", + "Content-Length": "849", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 20 Nov 2024 00:57:10 GMT", + "request-id": "e59fd871-c20e-436c-82da-760dd2467199", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "MyModel", + "trainingConfigVersion": "2023-04-15", + "trainingMode": "standard", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-11-20T00:57:05.1715887Z", + "endDateTime": "2024-11-20T00:57:07.2622297Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "191b0715-73e6-47d1-9d69-6a6c6b273d87_638676576000000000", + "createdDateTime": "2024-11-20T00:57:03Z", + "lastUpdatedDateTime": "2024-11-20T00:57:09Z", + "expirationDateTime": "2024-11-27T00:57:03Z", + "status": "succeeded", + "warnings": [ + { + "code": "Warning", + "message": "Intent `Buy` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Entity `product` is tagged in `3` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + } + ], + "Variables": { + "AZURE_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_AUTHORING_KEY": "Sanitized", + "RandomSeed": "3863571" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml new file mode 100644 index 000000000000..66b85f8aaf90 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations.Authoring/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeConversations-authoring +commit: 1bbb8f628f6e3083b73a2190e15bb0f5911571a3 +repo: Azure/azure-rest-api-specs + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md index 354e9a8b5a16..b4c9ac591b90 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md @@ -586,7 +586,7 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -[azure_cli]: https://docs.microsoft.com/cli/azure/ +[azure_cli]: https://learn.microsoft.com/cli/azure/ [azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md [azure_identity_install]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#install-the-package [azure_portal]: https://portal.azure.com/ @@ -595,10 +595,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [coc_contact]: mailto:opencode@microsoft.com [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/ +[cognitive_auth]: https://learn.microsoft.com/azure/cognitive-services/authentication/ [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md [core_logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md -[custom_domain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[custom_domain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [language_studio]: https://language.cognitive.azure.com/ [nuget]: https://www.nuget.org/ @@ -607,9 +607,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [conversationanalysis_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/ [conversationanalysis_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/ [conversationanalysis_nuget_package]: https://www.nuget.org/packages/Azure.AI.Language.Conversations/ -[conversationanalysis_docs]: https://docs.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/overview -[conversationanalysis_docs_demos]: https://docs.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/quickstart -[conversationanalysis_docs_features]: https://docs.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/overview -[conversationanalysis_refdocs]: https://docs.microsoft.com/dotnet/api/azure.ai.language.conversations +[conversationanalysis_docs]: https://learn.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/overview +[conversationanalysis_docs_demos]: https://learn.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/quickstart +[conversationanalysis_docs_features]: https://learn.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/overview +[conversationanalysis_refdocs]: https://learn.microsoft.com/dotnet/api/azure.ai.language.conversations [conversationanalysis_restdocs]: https://learn.microsoft.com/rest/api/language/ [conversationalauthoring_samples]: https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Language.Conversations_1.1.0/sdk/cognitivelanguage/Azure.AI.Language.Conversations#create-a-conversationauthoringclient diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md index a95d34cb0124..49d972499e80 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/README.md @@ -337,7 +337,7 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -[azure_cli]: https://docs.microsoft.com/cli/azure/ +[azure_cli]: https://learn.microsoft.com/cli/azure/ [azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md [azure_identity_install]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#install-the-package [azure_portal]: https://portal.azure.com/ @@ -346,22 +346,22 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [coc_contact]: mailto:opencode@microsoft.com [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/ +[cognitive_auth]: https://learn.microsoft.com/azure/cognitive-services/authentication/ [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md [core_logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md -[custom_domain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[custom_domain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [language_studio]: https://language.cognitive.azure.com/ [nuget]: https://www.nuget.org/ [questionanswering_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClient.cs [questionanswering_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/ -[questionanswering_docs]: https://docs.microsoft.com/azure/cognitive-services/qnamaker/ -[questionanswering_docs_chat]: https://docs.microsoft.com/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base +[questionanswering_docs]: https://learn.microsoft.com/azure/cognitive-services/qnamaker/ +[questionanswering_docs_chat]: https://learn.microsoft.com/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base [questionanswering_docs_demos]: https://azure.microsoft.com/services/cognitive-services/qna-maker/#demo [questionanswering_docs_features]: https://azure.microsoft.com/services/cognitive-services/qna-maker/#features [questionanswering_nuget_package]: https://nuget.org/packages/Azure.AI.Language.QuestionAnswering/ -[questionanswering_refdocs]: https://docs.microsoft.com/dotnet/api/Azure.AI.Language.QuestionAnswering/ +[questionanswering_refdocs]: https://learn.microsoft.com/dotnet/api/Azure.AI.Language.QuestionAnswering/ [questionanswering_rest_docs]: https://learn.microsoft.com/rest/api/language/question-answering [questionanswering_rest_docs_projects]: https://learn.microsoft.com/rest/api/language/question-answering-projects [questionanswering_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/samples/README.md diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/samples/Sample2_Chat.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/samples/Sample2_Chat.md index 5775194f00a4..3c5982aa7210 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/samples/Sample2_Chat.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/samples/Sample2_Chat.md @@ -59,4 +59,4 @@ foreach (KnowledgeBaseAnswer answer in response.Value.Answers) } ``` -[questionanswering_docs_chat]: https://docs.microsoft.com/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base +[questionanswering_docs_chat]: https://learn.microsoft.com/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/Azure.AI.Language.Text.Authoring.sln b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/Azure.AI.Language.Text.Authoring.sln new file mode 100644 index 000000000000..5e0c269354e8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/Azure.AI.Language.Text.Authoring.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 +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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Text.Authoring", "src\Azure.AI.Language.Text.Authoring.csproj", "{DFF66C7A-EED6-4AD9-AABB-F65049394E85}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Text.Authoring.Tests", "tests\Azure.AI.Language.Text.Authoring.Tests.csproj", "{7972BA84-D0F6-4602-8D9D-7C2427B53E30}" +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 + {DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFF66C7A-EED6-4AD9-AABB-F65049394E85}.Release|Any CPU.Build.0 = Release|Any CPU + {7972BA84-D0F6-4602-8D9D-7C2427B53E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7972BA84-D0F6-4602-8D9D-7C2427B53E30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7972BA84-D0F6-4602-8D9D-7C2427B53E30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7972BA84-D0F6-4602-8D9D-7C2427B53E30}.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/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md new file mode 100644 index 000000000000..b620545cccd7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/CHANGELOG.md @@ -0,0 +1,15 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0-beta.1 + +- Initial preview of the Azure.AI.Language.Text.Authoring client library. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/Directory.Build.props b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md new file mode 100644 index 000000000000..02503f2ac0d3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.md @@ -0,0 +1,275 @@ +# Azure Authoring client library for .NET + +Azure Text Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that provides tools for creating, managing, and deploying text processing and AI solutions. This client library offers the following features: + +* Creating and managing text analysis projects +* Importing and exporting text analysis projects +* Training models for text processing and analysis +* Evaluating trained models +* Deploying text processing models +* Swapping deployments for active models +* Canceling active training jobs +* Managing project snapshots +* Deleting trained models and deployments + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][text_refdocs] | [Product documentation][text_docs] | [Samples][source_samples] + +## 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 + +Install the client library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.AI.Language.Text.Authoring --prerelease +``` + +|SDK version |Supported API version of service +|-------------|------------------------------------------------------------------ +|1.0.0-beta.1 | 2022-05-01, 2023-04-01, 2023-11-15-preview, 2024-11-15-preview (default) + +### Prerequisites + +* An [Azure subscription][azure_sub]. +* An existing Cognitive Services or Language service resource. + +### Authenticate the client + +In order to interact with the Text Authoring service, you'll need to create an instance of the [`TextAnalysisAuthoring`][textAnalysisAuthoring_class] class. You will need an **endpoint**, and an **API key** to instantiate a client object. For more information regarding authenticating with Cognitive Services, see [Authenticate requests to Azure Cognitive Services][cognitive_auth]. + +#### Get an API key + +You can get the `endpoint` and `API key` from the Cognitive Services resource or Language service resource information in the [Azure Portal][azure_portal]. + +Alternatively, use the [Azure CLI][azure_cli] snippet below to get the API key from the Language service resource. + +```PowerShell +az cognitiveservices account keys list --resource-group --name +``` + +#### Create a TextAnalysisAuthoring Client + +To use the TextAnalysisAuthoring client, include the following namespace in your project: + +```C# +using Azure.AI.Language.Text.Authoring; +``` + +With your endpoint and API key, you can instantiate an AuthoringClient and create a TextAnalysisAuthoring client using specific service options: + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your-api-key"); +AuthoringClient client = new AuthoringClient(endpoint, credential); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +#### Create a client using Azure Active Directory authentication + +You can also create a `TextAnalysisAuthoring` using Azure Active Directory (AAD) authentication. Your user or service principal must be assigned the "Cognitive Services Language Reader" role. +Using the [DefaultAzureCredential], you can authenticate a service using Managed Identity or a service principal, authenticate as a developer working on an application, and more, all without changing code. + +Before you can use the `DefaultAzureCredential`, or any credential type from [Azure.Identity][azure_identity], you'll first need to [install the Azure.Identity package][azure_identity_install]. + +To use DefaultAzureCredential with a client ID and secret, you'll need to set the AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET environment variables; alternatively, you can pass those values to the ClientSecretCredential also in Azure.Identity. + +Make sure you use the right namespace for DefaultAzureCredential at the top of your source file: + +```C# Snippet:TextAuthoring_Identity_Namespace +using Azure.Identity; +using Azure.Core; +``` + +Then you can create an instance of DefaultAzureCredential and pass it to a new instance of your client: + +```C# Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +DefaultAzureCredential credential = new DefaultAzureCredential(); +AuthoringClient client = new AuthoringClient(endpoint, credential); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +Note that regional endpoints do not support AAD authentication. Instead, create a [custom domain][custom_domain] name for your resource to use AAD authentication. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example: + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +If you do not select an API version, we will default to the latest version available, which has the possibility of being a preview version. + +## Key concepts + +### TextAnalysisAuthoring + +The [TextAnalysisAuthoring][TextAnalysisAuthoring_class] is the primary interface for developers using the Azure AI Text Authoring client library. It provides both synchronous and asynchronous operations to access a specific use of text authoring, such as creating and managing text analysis projects. + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other (guideline). 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://learn.microsoft.com/dotnet/azure/sdk/unit-testing-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/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples). + +* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md) +* [Import a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) +* [Import a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md) +* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md) +* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md) +* [Deploy a project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md) +* [Deploy a project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md) +* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md) + +## Troubleshooting + +### General + +When you interact with the Cognitive Language Services Text Authoring client library using the .NET SDK, errors returned by the service correspond to the same HTTP status codes returned for REST API requests. + +For example, if you attempt to create a project with an invalid configuration, a 400 error is returned indicating "Bad Request". + +```C# Snippet:TextAuthoringClient_BadRequest +try +{ + string invalidProjectName = "InvalidProject"; + + var projectData = new + { + projectName = invalidProjectName, + language = "invalid-lang", // Invalid language code + projectKind = "Text", + description = "This is a test for invalid configuration." + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = authoringClient.CreateProject(invalidProjectName, content); +} +catch (RequestFailedException ex) +{ + Console.WriteLine(ex.ToString()); +} +``` + +You will notice that additional information is logged, like the client request ID of the operation. + +```text +Azure.RequestFailedException: The input parameter is invalid. +Status: 400 (Bad Request) +ErrorCode: InvalidArgument + +Content: +Azure.RequestFailedException: Invalid Request. +Status: 400 (Bad Request) +ErrorCode: InvalidRequest + +Content: +{"error":{"code":"InvalidRequest","message":"Invalid Request.","innererror":{"code":"LanguageCodeInvalid","message":"The language code is invalid. Possible values are: en, es, fr, ..."}}} + +Headers: +Transfer-Encoding: chunked +x-envoy-upstream-service-time: REDACTED +apim-request-id: REDACTED +Strict-Transport-Security: REDACTED +X-Content-Type-Options: REDACTED +x-ms-region: REDACTED +Date: Wed, 24 Jul 2024 13:39:00 GMT +Content-Type: application/json; charset=utf-8 +``` + +### Setting up console logging + +The simplest way to see the logs is to enable the console logging. +To create an Azure SDK log listener that outputs messages to the console, use AzureEventSourceListener.CreateConsoleLogger method. + +```C# +// Setup a listener to monitor logged events. +using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger(); +``` + +To learn more about other logging mechanisms, see [here][logging]. + +## Next steps + +View our [samples][source_samples]. +Read about the different [features][text_docs] of the Text Authoring. + +## Contributing + +See the [CONTRIBUTING.md][contributing] for details on building, testing, and contributing to this library. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md +[cla]: https://cla.microsoft.com +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com +[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential +[azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md +[azure_identity_install]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#install-the-package +[custom_domain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[source_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples +[source_migration]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/MigrationGuide.md +[source_root]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src +[package]: https://www.nuget.org/packages/ +[text_refdocs]: https://learn.microsoft.com/dotnet/ +[text_docs]: https://learn.microsoft.com/azure/ai-services/language-service/conversational-language-understanding/overview +[azure_sub]: https://azure.microsoft.com/free/dotnet/ +[textAnalysisAuthoring_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs +[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/ +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_portal]: https://portal.azure.com +[logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs new file mode 100644 index 000000000000..f85b5b84effe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.net8.0.cs @@ -0,0 +1,1894 @@ +namespace Azure.AI.Language.Text.Authoring +{ + public partial class AuthoringClient + { + protected AuthoringClient() { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.Text.Authoring.AuthoringClientOptions options) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Language.Text.Authoring.AuthoringClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.AI.Language.Text.Authoring.TextAnalysisAuthoring GetTextAnalysisAuthoringClient(string apiVersion = "2024-11-15-preview") { throw null; } + } + public partial class AuthoringClientOptions : Azure.Core.ClientOptions + { + public AuthoringClientOptions(Azure.AI.Language.Text.Authoring.AuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Text.Authoring.AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview) { } + public enum ServiceVersion + { + V2023_04_01 = 1, + V2023_04_15_Preview = 2, + V2024_11_15_Preview = 3, + } + } + public partial class TextAnalysisAuthoring + { + protected TextAnalysisAuthoring() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> CopyProjectAuthorizationAsync(string projectName, Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAuthorizationAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CreateProject(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateProjectAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeployment(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteProject(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetAssignedResourceDeployments(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetCopyProjectStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetCopyProjectStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentAsync(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentAsync(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelAsync(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelAsync(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModelManifest(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModelManifest(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelManifestAsync(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelManifestAsync(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetImportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetImportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectAsync(string projectName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectDeletionStatusAsync(string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectDeletionStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSupportedLanguages(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSupportedLanguages(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetSupportedLanguagesAsync(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetSupportedPrebuiltEntities(Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetSupportedPrebuiltEntities(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSupportedPrebuiltEntitiesAsync(Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetSupportedPrebuiltEntitiesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainingConfigVersions(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainingConfigVersions(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainingConfigVersionsAsync(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainingStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainingStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.ExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.ExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation LoadSnapshot(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task LoadSnapshotAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public static partial class TextAuthoringClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } + public static partial class TextAuthoringModelFactory + { + public static Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesJobState AssignDeploymentResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, System.Collections.Generic.IEnumerable deploymentsMetadata = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = 0f, float rawValue = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixRow ConfusionMatrixRow(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CopyProjectJobState CopyProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, System.Collections.Generic.IEnumerable assignedResourceIds = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails CreateProjectDetails(Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind), string storageInputContainerName = null, Azure.AI.Language.Text.Authoring.Models.ProjectSettings settings = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionDocumentEvaluationResult CustomEntityRecognitionDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomHealthcareDocumentEvaluationResult CustomHealthcareDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult customHealthcareResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomHealthcareEvaluationSummary CustomHealthcareEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary customHealthcareEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationDocumentEvaluationResult CustomMultiLabelClassificationDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationDocumentEvaluationResult CustomSingleLabelClassificationDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentDocumentEvaluationResult CustomTextSentimentDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult customTextSentimentResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentEvaluationSummary CustomTextSentimentEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary customTextSentimentEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo DataGenerationConnectionInfo(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind kind = default(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind), string resourceId = null, string deploymentName = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DeploymentJobState DeploymentJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DeploymentResource DeploymentResource(string resourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEntityLabelEvaluationResult DocumentEntityLabelEvaluationResult(string category = null, int offset = 0, int length = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult DocumentEntityRecognitionEvaluationResult(System.Collections.Generic.IEnumerable entities = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEntityRegionEvaluationResult DocumentEntityRegionEvaluationResult(System.Collections.Generic.IEnumerable expectedEntities = null, System.Collections.Generic.IEnumerable predictedEntities = null, int regionOffset = 0, int regionLength = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult DocumentEvaluationResult(string projectKind = null, string location = null, string language = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult DocumentHealthcareEvaluationResult(System.Collections.Generic.IEnumerable entities = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult DocumentMultiLabelClassificationEvaluationResult(System.Collections.Generic.IEnumerable expectedClasses = null, System.Collections.Generic.IEnumerable predictedClasses = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentSentimentLabelEvaluationResult DocumentSentimentLabelEvaluationResult(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment category = default(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment), int offset = 0, int length = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult DocumentSingleLabelClassificationEvaluationResult(string expectedClass = null, string predictedClass = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult DocumentTextSentimentEvaluationResult(System.Collections.Generic.IEnumerable expectedSentimentSpans = null, System.Collections.Generic.IEnumerable predictedSentimentSpans = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EntityEvaluationSummary EntityEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary entities = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult EvaluationJobResult(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationJobState EvaluationJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult result = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationSummary EvaluationSummary(string projectKind = null, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationDocument ExportedCustomAbstractiveSummarizationDocument(string summaryLocation = null, string location = null, string language = null, string dataset = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedModelJobState ExportedModelJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedModelManifest ExportedModelManifest(System.Collections.Generic.IEnumerable modelFiles = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedProject ExportedProject(string projectFileVersion = null, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType = default(Azure.AI.Language.Text.Authoring.Models.StringIndexType), Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails metadata = null, Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets assets = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastExportedModelDateTime = default(System.DateTimeOffset), System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportProjectJobState ExportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, string resultUrl = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ImportProjectJobState ImportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorModel InnerErrorModel(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode code = default(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode), string message = null, System.Collections.Generic.IReadOnlyDictionary details = null, string target = null, Azure.AI.Language.Text.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ModelFile ModelFile(string name = null, System.Uri contentUri = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.MultiLabelClassEvaluationSummary MultiLabelClassEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary MultiLabelClassificationEvaluationSummary(System.Collections.Generic.IReadOnlyDictionary classes = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, System.Collections.Generic.IEnumerable assignedResources = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectMetadata ProjectMetadata(System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? lastTrainedDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastDeployedDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind), string storageInputContainerName = null, Azure.AI.Language.Text.Authoring.Models.ProjectSettings settings = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), int lastTrainingDurationInSeconds = 0, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, bool hasSnapshot = false) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SentimentEvaluationSummary SentimentEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SingleLabelClassEvaluationSummary SingleLabelClassEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary SingleLabelClassificationEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary classes = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary SpanSentimentEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary sentiments = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState SubTrainingJobState(int percentComplete = 0, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringError TextAnalysisAuthoringError(Azure.AI.Language.Text.Authoring.Models.ErrorCode code = default(Azure.AI.Language.Text.Authoring.Models.ErrorCode), string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, Azure.AI.Language.Text.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringWarning TextAnalysisAuthoringWarning(string code = null, string message = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary TextSentimentEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary spanSentimentsEvaluation = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings dataGenerationSettings = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState trainingStatus = null, Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState evaluationStatus = null, System.DateTimeOffset? estimatedEndDateTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingJobState TrainingJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Text.Authoring.Models.TrainingJobResult result = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesJobState UnassignDeploymentResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + } +} +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable resourcesMetadata) { } + public System.Collections.Generic.IList ResourcesMetadata { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignDeploymentResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignDeploymentResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedDeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedDeploymentResource() { } + public string AzureResourceId { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentMetadata() { } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentsMetadata() { } + public System.Collections.Generic.IReadOnlyList DeploymentsMetadata { get { throw null; } } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CompositionSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CompositionSetting(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CompositionSetting CombineComponents { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.CompositionSetting SeparateComponents { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.CompositionSetting 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.Language.Text.Authoring.Models.CompositionSetting left, Azure.AI.Language.Text.Authoring.Models.CompositionSetting right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.CompositionSetting (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.CompositionSetting left, Azure.AI.Language.Text.Authoring.Models.CompositionSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConfusionMatrix : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrix() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixCell : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixCell() { } + public float NormalizedValue { get { throw null; } } + public float RawValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixRow : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixRow() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyProjectDetails(Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string targetProjectName, string accessToken, System.DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) { } + public string AccessToken { get { throw null; } set { } } + public System.DateTimeOffset ExpiresAt { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.ProjectKind ProjectKind { get { throw null; } set { } } + public string TargetProjectName { get { throw null; } set { } } + public string TargetResourceId { get { throw null; } set { } } + public string TargetResourceRegion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CopyProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateDeploymentDetails(string trainedModelLabel) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateProjectDetails(Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string storageInputContainerName, string projectName, string language) { } + public string Description { get { throw null; } set { } } + public string Language { get { throw null; } } + public bool? Multilingual { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ProjectSettings Settings { get { throw null; } set { } } + public string StorageInputContainerName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomEntityRecognitionDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomEntityRecognitionDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult CustomEntityRecognitionResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomEntityRecognitionEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomEntityRecognitionEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomHealthcareDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomHealthcareDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult CustomHealthcareResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomHealthcareEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomHealthcareEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary CustomHealthcareEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomMultiLabelClassificationDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult CustomMultiLabelClassificationResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomMultiLabelClassificationEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomMultiLabelClassificationEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomSingleLabelClassificationDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult CustomSingleLabelClassificationResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomSingleLabelClassificationEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomSingleLabelClassificationEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomTextSentimentDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomTextSentimentDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult CustomTextSentimentResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomTextSentimentEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomTextSentimentEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary CustomTextSentimentEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataGenerationConnectionInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataGenerationConnectionInfo(string resourceId, string deploymentName) { } + public string DeploymentName { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind Kind { get { throw null; } } + public string ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataGenerationConnectionInfoKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataGenerationConnectionInfoKind(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind AzureOpenAI { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind 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.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind left, Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind left, Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataGenerationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataGenerationSettings(bool enableDataGeneration, Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo dataGenerationConnectionInfo) { } + public Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo DataGenerationConnectionInfo { get { throw null; } } + public bool EnableDataGeneration { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeleteDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeleteDeploymentDetails() { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentDeleteFromResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentDeleteFromResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentResource() { } + public string Region { get { throw null; } } + public string ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentEntityLabelEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentEntityLabelEvaluationResult() { } + public string Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityLabelEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityLabelEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentEntityRecognitionEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentEntityRecognitionEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList Entities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentEntityRegionEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentEntityRegionEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedEntities { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedEntities { get { throw null; } } + public int RegionLength { get { throw null; } } + public int RegionOffset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRegionEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRegionEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DocumentEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DocumentEvaluationResult(string location, string language) { } + public string Language { get { throw null; } } + public string Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentHealthcareEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentHealthcareEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList Entities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentMultiLabelClassificationEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentMultiLabelClassificationEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedClasses { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedClasses { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentSentimentLabelEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentSentimentLabelEvaluationResult() { } + public Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSentimentLabelEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSentimentLabelEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentSingleLabelClassificationEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentSingleLabelClassificationEvaluationResult() { } + public string ExpectedClass { get { throw null; } } + public string PredictedClass { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentTextSentimentEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentTextSentimentEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedSentimentSpans { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedSentimentSpans { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntityEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntityEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntityRecognitionEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntityRecognitionEvaluationSummary() { } + public Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Entities { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ErrorCode(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchIndexLimitReached { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchIndexNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Conflict { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Forbidden { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode InternalServerError { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode InvalidArgument { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode NotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode OperationNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode ProjectNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode QuotaExceeded { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode ServiceUnavailable { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Timeout { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode TooManyRequests { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Unauthorized { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Warning { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.ErrorCode 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.Language.Text.Authoring.Models.ErrorCode left, Azure.AI.Language.Text.Authoring.Models.ErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.ErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.ErrorCode left, Azure.AI.Language.Text.Authoring.Models.ErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EvaluationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EvaluationDetails() { } + public Azure.AI.Language.Text.Authoring.Models.EvaluationKind? Kind { get { throw null; } set { } } + public int? TestingSplitPercentage { get { throw null; } set { } } + public int? TrainingSplitPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobResult() { } + public Azure.AI.Language.Text.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + public string ModelLabel { get { throw null; } } + public int PercentComplete { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult Result { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EvaluationKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EvaluationKind(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationKind Manual { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationKind Percentage { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.EvaluationKind 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.Language.Text.Authoring.Models.EvaluationKind left, Azure.AI.Language.Text.Authoring.Models.EvaluationKind right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.EvaluationKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.EvaluationKind left, Azure.AI.Language.Text.Authoring.Models.EvaluationKind right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class EvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions) { } + public Azure.AI.Language.Text.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedClass : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedClass() { } + public string Category { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedClass System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedClass System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCompositeEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCompositeEntity() { } + public string Category { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.CompositionSetting? CompositionSetting { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.ExportedEntityList List { get { throw null; } set { } } + public System.Collections.Generic.IList Prebuilts { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCompositeEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCompositeEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomAbstractiveSummarizationDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomAbstractiveSummarizationDocument(string summaryLocation) { } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + public string SummaryLocation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomAbstractiveSummarizationProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomAbstractiveSummarizationProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomEntityRecognitionDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomEntityRecognitionDocument() { } + public string Dataset { get { throw null; } set { } } + public System.Collections.Generic.IList Entities { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomEntityRecognitionProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomEntityRecognitionProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + public System.Collections.Generic.IList Entities { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomHealthcareDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomHealthcareDocument() { } + public string Dataset { get { throw null; } set { } } + public System.Collections.Generic.IList Entities { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomHealthcareProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomHealthcareProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + public System.Collections.Generic.IList Entities { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomMultiLabelClassificationDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomMultiLabelClassificationDocument() { } + public System.Collections.Generic.IList Classes { get { throw null; } } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomMultiLabelClassificationProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomMultiLabelClassificationProjectAssets() { } + public System.Collections.Generic.IList Classes { get { throw null; } } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomSingleLabelClassificationDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomSingleLabelClassificationDocument() { } + public Azure.AI.Language.Text.Authoring.Models.ExportedDocumentClass Class { get { throw null; } set { } } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomSingleLabelClassificationProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomSingleLabelClassificationProjectAssets() { } + public System.Collections.Generic.IList Classes { get { throw null; } } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomTextSentimentDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomTextSentimentDocument() { } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + public System.Collections.Generic.IList SentimentSpans { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomTextSentimentProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomTextSentimentProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentClass : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentClass() { } + public string Category { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentClass System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentClass System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentEntityLabel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentEntityLabel() { } + public string Category { get { throw null; } set { } } + public int? Length { get { throw null; } set { } } + public int? Offset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityLabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityLabel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentEntityRegion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentEntityRegion() { } + public System.Collections.Generic.IList Labels { get { throw null; } } + public int? RegionLength { get { throw null; } set { } } + public int? RegionOffset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityRegion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityRegion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentSentimentLabel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentSentimentLabel() { } + public Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment? Category { get { throw null; } set { } } + public int? Length { get { throw null; } set { } } + public int? Offset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentSentimentLabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentSentimentLabel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntity() { } + public string Category { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityList : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityList() { } + public System.Collections.Generic.IList Sublists { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityListSynonym : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityListSynonym() { } + public string Language { get { throw null; } set { } } + public System.Collections.Generic.IList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntitySublist : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntitySublist() { } + public string ListKey { get { throw null; } set { } } + public System.Collections.Generic.IList Synonyms { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedModelDetails(string trainedModelLabel) { } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedModelJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelManifest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedModelManifest() { } + public System.Collections.Generic.IReadOnlyList ModelFiles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelManifest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelManifest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedPrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedPrebuiltEntity(string category) { } + public string Category { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedProject : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedProject(string projectFileVersion, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails metadata) { } + public Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets Assets { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails Metadata { get { throw null; } } + public string ProjectFileVersion { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.StringIndexType StringIndexType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ExportedProjectAssets : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ExportedProjectAssets() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedTrainedModel() { } + public string ExportedModelName { get { throw null; } } + public System.DateTimeOffset LastExportedModelDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public string ResultUrl { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct InnerErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InnerErrorCode(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode EmptyRequest { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode ExtractionFailure { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidCountryHint { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidDocument { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidDocumentBatch { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidParameterValue { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidRequestBodyFormat { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode KnowledgeBaseNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode MissingInputDocuments { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode ModelVersionIncorrect { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode UnsupportedLanguageCode { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode 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.Language.Text.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Text.Authoring.Models.InnerErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.InnerErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Text.Authoring.Models.InnerErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InnerErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InnerErrorModel() { } + public Azure.AI.Language.Text.Authoring.Models.InnerErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Details { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobStatus(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Cancelled { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Cancelling { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Failed { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus NotStarted { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus PartiallyCompleted { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Running { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Succeeded { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.JobStatus 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.Language.Text.Authoring.Models.JobStatus left, Azure.AI.Language.Text.Authoring.Models.JobStatus right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.JobStatus (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.JobStatus left, Azure.AI.Language.Text.Authoring.Models.JobStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LoadSnapshotJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LoadSnapshotJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ModelFile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ModelFile() { } + public System.Uri ContentUri { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ModelFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ModelFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MultiLabelClassEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MultiLabelClassEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MultiLabelClassificationEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MultiLabelClassificationEvaluationSummary() { } + public System.Collections.Generic.IReadOnlyDictionary Classes { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PrebuiltEntity() { } + public string Category { get { throw null; } } + public string Description { get { throw null; } } + public string Examples { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeletionJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeletionJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeployment() { } + public System.Collections.Generic.IReadOnlyList AssignedResources { get { throw null; } } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProjectKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProjectKind(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomAbstractiveSummarization { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomEntityRecognition { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomHealthcare { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomMultiLabelClassification { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomSingleLabelClassification { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomTextSentiment { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.ProjectKind 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.Language.Text.Authoring.Models.ProjectKind left, Azure.AI.Language.Text.Authoring.Models.ProjectKind right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.ProjectKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.ProjectKind left, Azure.AI.Language.Text.Authoring.Models.ProjectKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProjectMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectMetadata() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public string Description { get { throw null; } } + public string Language { get { throw null; } } + public System.DateTimeOffset? LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastModifiedDateTime { get { throw null; } } + public System.DateTimeOffset? LastTrainedDateTime { get { throw null; } } + public bool? Multilingual { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ProjectSettings Settings { get { throw null; } } + public string StorageInputContainerName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectSettings() { } + public string AmlProjectPath { get { throw null; } set { } } + public float? ConfidenceThreshold { get { throw null; } set { } } + public int? GptPredictiveLookahead { get { throw null; } set { } } + public bool? IsLabelingLocked { get { throw null; } set { } } + public bool? RunGptPredictions { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectTrainedModel() { } + public bool HasSnapshot { get { throw null; } } + public string Label { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public int LastTrainingDurationInSeconds { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceMetadata(string azureResourceId, string customDomain, string region) { } + public string AzureResourceId { get { throw null; } } + public string CustomDomain { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SentimentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SentimentEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SingleLabelClassEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SingleLabelClassEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SingleLabelClassificationEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SingleLabelClassificationEvaluationSummary() { } + public System.Collections.Generic.IReadOnlyDictionary Classes { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SpanSentimentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SpanSentimentEvaluationSummary() { } + public Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Sentiments { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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.Language.Text.Authoring.Models.StringIndexType Utf16CodeUnit { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.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.Language.Text.Authoring.Models.StringIndexType left, Azure.AI.Language.Text.Authoring.Models.StringIndexType right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.StringIndexType (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.StringIndexType left, Azure.AI.Language.Text.Authoring.Models.StringIndexType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubTrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SubTrainingJobState() { } + public System.DateTimeOffset? EndDateTime { get { throw null; } } + public int PercentComplete { get { throw null; } } + public System.DateTimeOffset? StartDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SupportedLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SupportedLanguage() { } + public string LanguageCode { get { throw null; } } + public string LanguageName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) { } + public string FirstDeploymentName { get { throw null; } } + public string SecondDeploymentName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SwapDeploymentsJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TextAnalysisAuthoringError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextAnalysisAuthoringError() { } + public Azure.AI.Language.Text.Authoring.Models.ErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TextAnalysisAuthoringSentiment : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TextAnalysisAuthoringSentiment(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Negative { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Neutral { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Positive { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment 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.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment left, Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment left, Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TextAnalysisAuthoringWarning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextAnalysisAuthoringWarning() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringWarning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringWarning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TextSentimentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextSentimentEvaluationSummary() { } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary SpanSentimentsEvaluation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingConfigVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingConfigVersion() { } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string TrainingConfigVersionProperty { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TrainingJobDetails(string modelLabel, string trainingConfigVersion) { } + public Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings DataGenerationSettings { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } set { } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobResult() { } + public System.DateTimeOffset? EstimatedEndDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState EvaluationStatus { get { throw null; } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState TrainingStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.TrainingJobResult Result { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UnassignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UnassignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable assignedResourceIds) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UnassignDeploymentResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UnassignDeploymentResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs new file mode 100644 index 000000000000..f85b5b84effe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/api/Azure.AI.Language.Text.Authoring.netstandard2.0.cs @@ -0,0 +1,1894 @@ +namespace Azure.AI.Language.Text.Authoring +{ + public partial class AuthoringClient + { + protected AuthoringClient() { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.Text.Authoring.AuthoringClientOptions options) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public AuthoringClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Language.Text.Authoring.AuthoringClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.AI.Language.Text.Authoring.TextAnalysisAuthoring GetTextAnalysisAuthoringClient(string apiVersion = "2024-11-15-preview") { throw null; } + } + public partial class AuthoringClientOptions : Azure.Core.ClientOptions + { + public AuthoringClientOptions(Azure.AI.Language.Text.Authoring.AuthoringClientOptions.ServiceVersion version = Azure.AI.Language.Text.Authoring.AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview) { } + public enum ServiceVersion + { + V2023_04_01 = 1, + V2023_04_15_Preview = 2, + V2024_11_15_Preview = 3, + } + } + public partial class TextAnalysisAuthoring + { + protected TextAnalysisAuthoring() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AssignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task AssignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Operation CancelTrainingJob(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> CancelTrainingJobAsync(Azure.WaitUntil waitUntil, string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyProject(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CopyProjectAuthorization(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> CopyProjectAuthorizationAsync(string projectName, Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CopyProjectAuthorizationAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CreateOrUpdateExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CreateProject(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateProjectAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeployment(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeleteDeploymentFromResources(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteDeploymentFromResourcesAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteExportedModel(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteExportedModelAsync(Azure.WaitUntil waitUntil, string projectName, string exportedModelName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteProject(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteProjectAsync(Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation DeployProject(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeployProjectAsync(Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation EvaluateModel(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> EvaluateModelAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Export(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ExportAsync(Azure.WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetAssignedResourceDeployments(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetCopyProjectStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetCopyProjectStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetCopyProjectStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeployment(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentAsync(string projectName, string deploymentName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentAsync(string projectName, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeploymentResources(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModel(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelAsync(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelAsync(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportedModelManifest(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportedModelManifest(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportedModelManifestAsync(string projectName, string exportedModelName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportedModelManifestAsync(string projectName, string exportedModelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetExportedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetExportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetExportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetImportStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetImportStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectAsync(string projectName, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetProjectDeletionStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectDeletionStatusAsync(string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectDeletionStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetProjects(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSupportedLanguages(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSupportedLanguages(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetSupportedLanguagesAsync(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetSupportedPrebuiltEntities(Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetSupportedPrebuiltEntities(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSupportedPrebuiltEntitiesAsync(Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetSupportedPrebuiltEntitiesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetSwapDeploymentsStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainedModel(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainedModelAsync(string projectName, string trainedModelLabel, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainedModels(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainingConfigVersions(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTrainingConfigVersions(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainingConfigVersionsAsync(Azure.AI.Language.Text.Authoring.Models.ProjectKind? projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind?), int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTrainingJobs(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTrainingStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTrainingStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTrainingStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.ExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Import(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.ExportedProject body, string format = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ImportAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation LoadSnapshot(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task LoadSnapshotAsync(Azure.WaitUntil waitUntil, string projectName, string trainedModelLabel, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation SwapDeployments(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SwapDeploymentsAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation Train(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TrainAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation UnassignDeploymentResources(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnassignDeploymentResourcesAsync(Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public static partial class TextAuthoringClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } + public static partial class TextAuthoringModelFactory + { + public static Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesJobState AssignDeploymentResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, System.Collections.Generic.IEnumerable deploymentsMetadata = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = 0f, float rawValue = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixRow ConfusionMatrixRow(System.Collections.Generic.IReadOnlyDictionary additionalProperties = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CopyProjectJobState CopyProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, System.Collections.Generic.IEnumerable assignedResourceIds = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails CreateProjectDetails(Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind), string storageInputContainerName = null, Azure.AI.Language.Text.Authoring.Models.ProjectSettings settings = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionDocumentEvaluationResult CustomEntityRecognitionDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomHealthcareDocumentEvaluationResult CustomHealthcareDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult customHealthcareResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomHealthcareEvaluationSummary CustomHealthcareEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary customHealthcareEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationDocumentEvaluationResult CustomMultiLabelClassificationDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationDocumentEvaluationResult CustomSingleLabelClassificationDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentDocumentEvaluationResult CustomTextSentimentDocumentEvaluationResult(string location = null, string language = null, Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult customTextSentimentResult = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentEvaluationSummary CustomTextSentimentEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary customTextSentimentEvaluation = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo DataGenerationConnectionInfo(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind kind = default(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind), string resourceId = null, string deploymentName = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DeploymentJobState DeploymentJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DeploymentResource DeploymentResource(string resourceId = null, string region = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEntityLabelEvaluationResult DocumentEntityLabelEvaluationResult(string category = null, int offset = 0, int length = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult DocumentEntityRecognitionEvaluationResult(System.Collections.Generic.IEnumerable entities = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEntityRegionEvaluationResult DocumentEntityRegionEvaluationResult(System.Collections.Generic.IEnumerable expectedEntities = null, System.Collections.Generic.IEnumerable predictedEntities = null, int regionOffset = 0, int regionLength = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult DocumentEvaluationResult(string projectKind = null, string location = null, string language = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult DocumentHealthcareEvaluationResult(System.Collections.Generic.IEnumerable entities = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult DocumentMultiLabelClassificationEvaluationResult(System.Collections.Generic.IEnumerable expectedClasses = null, System.Collections.Generic.IEnumerable predictedClasses = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentSentimentLabelEvaluationResult DocumentSentimentLabelEvaluationResult(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment category = default(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment), int offset = 0, int length = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult DocumentSingleLabelClassificationEvaluationResult(string expectedClass = null, string predictedClass = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult DocumentTextSentimentEvaluationResult(System.Collections.Generic.IEnumerable expectedSentimentSpans = null, System.Collections.Generic.IEnumerable predictedSentimentSpans = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EntityEvaluationSummary EntityEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary entities = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult EvaluationJobResult(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationJobState EvaluationJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult result = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationSummary EvaluationSummary(string projectKind = null, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationDocument ExportedCustomAbstractiveSummarizationDocument(string summaryLocation = null, string location = null, string language = null, string dataset = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedModelJobState ExportedModelJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedModelManifest ExportedModelManifest(System.Collections.Generic.IEnumerable modelFiles = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedProject ExportedProject(string projectFileVersion = null, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType = default(Azure.AI.Language.Text.Authoring.Models.StringIndexType), Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails metadata = null, Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets assets = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastExportedModelDateTime = default(System.DateTimeOffset), System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ExportProjectJobState ExportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, string resultUrl = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ImportProjectJobState ImportProjectJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorModel InnerErrorModel(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode code = default(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode), string message = null, System.Collections.Generic.IReadOnlyDictionary details = null, string target = null, Azure.AI.Language.Text.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ModelFile ModelFile(string name = null, System.Uri contentUri = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.MultiLabelClassEvaluationSummary MultiLabelClassEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary MultiLabelClassificationEvaluationSummary(System.Collections.Generic.IReadOnlyDictionary classes = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastDeployedDateTime = default(System.DateTimeOffset), System.DateTimeOffset deploymentExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, System.Collections.Generic.IEnumerable assignedResources = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectMetadata ProjectMetadata(System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? lastTrainedDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastDeployedDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind = default(Azure.AI.Language.Text.Authoring.Models.ProjectKind), string storageInputContainerName = null, Azure.AI.Language.Text.Authoring.Models.ProjectSettings settings = null, string projectName = null, bool? multilingual = default(bool?), string description = null, string language = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, System.DateTimeOffset lastTrainedDateTime = default(System.DateTimeOffset), int lastTrainingDurationInSeconds = 0, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset), string modelTrainingConfigVersion = null, bool hasSnapshot = false) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SentimentEvaluationSummary SentimentEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SingleLabelClassEvaluationSummary SingleLabelClassEvaluationSummary(double f1 = 0, double precision = 0, double recall = 0, int truePositiveCount = 0, int trueNegativeCount = 0, int falsePositiveCount = 0, int falseNegativeCount = 0) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary SingleLabelClassificationEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary classes = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary SpanSentimentEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix confusionMatrix = null, System.Collections.Generic.IReadOnlyDictionary sentiments = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState SubTrainingJobState(int percentComplete = 0, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringError TextAnalysisAuthoringError(Azure.AI.Language.Text.Authoring.Models.ErrorCode code = default(Azure.AI.Language.Text.Authoring.Models.ErrorCode), string message = null, string target = null, System.Collections.Generic.IEnumerable details = null, Azure.AI.Language.Text.Authoring.Models.InnerErrorModel innererror = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringWarning TextAnalysisAuthoringWarning(string code = null, string message = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary TextSentimentEvaluationSummary(Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary spanSentimentsEvaluation = null, float microF1 = 0f, float microPrecision = 0f, float microRecall = 0f, float macroF1 = 0f, float macroPrecision = 0f, float macroRecall = 0f) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, System.DateTimeOffset modelExpirationDate = default(System.DateTimeOffset)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions = null, Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings dataGenerationSettings = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState trainingStatus = null, Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState evaluationStatus = null, System.DateTimeOffset? estimatedEndDateTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TrainingJobState TrainingJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null, Azure.AI.Language.Text.Authoring.Models.TrainingJobResult result = null) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesJobState UnassignDeploymentResourcesJobState(string jobId = null, System.DateTimeOffset createdDateTime = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedDateTime = default(System.DateTimeOffset), System.DateTimeOffset? expirationDateTime = default(System.DateTimeOffset?), Azure.AI.Language.Text.Authoring.Models.JobStatus status = default(Azure.AI.Language.Text.Authoring.Models.JobStatus), System.Collections.Generic.IEnumerable warnings = null, System.Collections.Generic.IEnumerable errors = null) { throw null; } + } +} +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable resourcesMetadata) { } + public System.Collections.Generic.IList ResourcesMetadata { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignDeploymentResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignDeploymentResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignDeploymentResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedDeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedDeploymentResource() { } + public string AzureResourceId { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedDeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentMetadata() { } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssignedProjectDeploymentsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssignedProjectDeploymentsMetadata() { } + public System.Collections.Generic.IReadOnlyList DeploymentsMetadata { get { throw null; } } + public string ProjectName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.AssignedProjectDeploymentsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CompositionSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CompositionSetting(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.CompositionSetting CombineComponents { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.CompositionSetting SeparateComponents { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.CompositionSetting 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.Language.Text.Authoring.Models.CompositionSetting left, Azure.AI.Language.Text.Authoring.Models.CompositionSetting right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.CompositionSetting (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.CompositionSetting left, Azure.AI.Language.Text.Authoring.Models.CompositionSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConfusionMatrix : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrix() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixCell : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixCell() { } + public float NormalizedValue { get { throw null; } } + public float RawValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixCell System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConfusionMatrixRow : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ConfusionMatrixRow() { } + public System.Collections.Generic.IReadOnlyDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ConfusionMatrixRow System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyProjectDetails(Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string targetProjectName, string accessToken, System.DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) { } + public string AccessToken { get { throw null; } set { } } + public System.DateTimeOffset ExpiresAt { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.ProjectKind ProjectKind { get { throw null; } set { } } + public string TargetProjectName { get { throw null; } set { } } + public string TargetResourceId { get { throw null; } set { } } + public string TargetResourceRegion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CopyProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CopyProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CopyProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateDeploymentDetails(string trainedModelLabel) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CreateProjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CreateProjectDetails(Azure.AI.Language.Text.Authoring.Models.ProjectKind projectKind, string storageInputContainerName, string projectName, string language) { } + public string Description { get { throw null; } set { } } + public string Language { get { throw null; } } + public bool? Multilingual { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ProjectSettings Settings { get { throw null; } set { } } + public string StorageInputContainerName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomEntityRecognitionDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomEntityRecognitionDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult CustomEntityRecognitionResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomEntityRecognitionEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomEntityRecognitionEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomEntityRecognitionEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomHealthcareDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomHealthcareDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult CustomHealthcareResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomHealthcareEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomHealthcareEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary CustomHealthcareEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomHealthcareEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomMultiLabelClassificationDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult CustomMultiLabelClassificationResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomMultiLabelClassificationEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomMultiLabelClassificationEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomMultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomSingleLabelClassificationDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult CustomSingleLabelClassificationResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomSingleLabelClassificationEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomSingleLabelClassificationEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomSingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomTextSentimentDocumentEvaluationResult : Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomTextSentimentDocumentEvaluationResult() : base (default(string), default(string)) { } + public Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult CustomTextSentimentResult { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentDocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentDocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CustomTextSentimentEvaluationSummary : Azure.AI.Language.Text.Authoring.Models.EvaluationSummary, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CustomTextSentimentEvaluationSummary() : base (default(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails)) { } + public Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary CustomTextSentimentEvaluation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.CustomTextSentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataGenerationConnectionInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataGenerationConnectionInfo(string resourceId, string deploymentName) { } + public string DeploymentName { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind Kind { get { throw null; } } + public string ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataGenerationConnectionInfoKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataGenerationConnectionInfoKind(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind AzureOpenAI { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind 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.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind left, Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind left, Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfoKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataGenerationSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataGenerationSettings(bool enableDataGeneration, Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo dataGenerationConnectionInfo) { } + public Azure.AI.Language.Text.Authoring.Models.DataGenerationConnectionInfo DataGenerationConnectionInfo { get { throw null; } } + public bool EnableDataGeneration { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeleteDeploymentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeleteDeploymentDetails() { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeleteDeploymentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentDeleteFromResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentDeleteFromResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentDeleteFromResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentResource() { } + public string Region { get { throw null; } } + public string ResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DeploymentResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentEntityLabelEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentEntityLabelEvaluationResult() { } + public string Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityLabelEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityLabelEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentEntityRecognitionEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentEntityRecognitionEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList Entities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRecognitionEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentEntityRegionEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentEntityRegionEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedEntities { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedEntities { get { throw null; } } + public int RegionLength { get { throw null; } } + public int RegionOffset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRegionEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEntityRegionEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DocumentEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DocumentEvaluationResult(string location, string language) { } + public string Language { get { throw null; } } + public string Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentHealthcareEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentHealthcareEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList Entities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentHealthcareEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentMultiLabelClassificationEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentMultiLabelClassificationEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedClasses { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedClasses { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentMultiLabelClassificationEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentSentimentLabelEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentSentimentLabelEvaluationResult() { } + public Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Category { get { throw null; } } + public int Length { get { throw null; } } + public int Offset { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSentimentLabelEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSentimentLabelEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentSingleLabelClassificationEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentSingleLabelClassificationEvaluationResult() { } + public string ExpectedClass { get { throw null; } } + public string PredictedClass { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentSingleLabelClassificationEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DocumentTextSentimentEvaluationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentTextSentimentEvaluationResult() { } + public System.Collections.Generic.IReadOnlyList ExpectedSentimentSpans { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PredictedSentimentSpans { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.DocumentTextSentimentEvaluationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntityEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntityEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntityRecognitionEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EntityRecognitionEvaluationSummary() { } + public Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Entities { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EntityRecognitionEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ErrorCode(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchIndexLimitReached { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchIndexNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Conflict { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Forbidden { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode InternalServerError { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode InvalidArgument { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode NotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode OperationNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode ProjectNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode QuotaExceeded { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode ServiceUnavailable { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Timeout { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode TooManyRequests { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Unauthorized { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ErrorCode Warning { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.ErrorCode 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.Language.Text.Authoring.Models.ErrorCode left, Azure.AI.Language.Text.Authoring.Models.ErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.ErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.ErrorCode left, Azure.AI.Language.Text.Authoring.Models.ErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EvaluationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EvaluationDetails() { } + public Azure.AI.Language.Text.Authoring.Models.EvaluationKind? Kind { get { throw null; } set { } } + public int? TestingSplitPercentage { get { throw null; } set { } } + public int? TrainingSplitPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobResult() { } + public Azure.AI.Language.Text.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + public string ModelLabel { get { throw null; } } + public int PercentComplete { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EvaluationJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EvaluationJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.EvaluationJobResult Result { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EvaluationKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EvaluationKind(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationKind Manual { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.EvaluationKind Percentage { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.EvaluationKind 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.Language.Text.Authoring.Models.EvaluationKind left, Azure.AI.Language.Text.Authoring.Models.EvaluationKind right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.EvaluationKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.EvaluationKind left, Azure.AI.Language.Text.Authoring.Models.EvaluationKind right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class EvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EvaluationSummary(Azure.AI.Language.Text.Authoring.Models.EvaluationDetails evaluationOptions) { } + public Azure.AI.Language.Text.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.EvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedClass : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedClass() { } + public string Category { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedClass System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedClass System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCompositeEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCompositeEntity() { } + public string Category { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.CompositionSetting? CompositionSetting { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.ExportedEntityList List { get { throw null; } set { } } + public System.Collections.Generic.IList Prebuilts { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCompositeEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCompositeEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomAbstractiveSummarizationDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomAbstractiveSummarizationDocument(string summaryLocation) { } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + public string SummaryLocation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomAbstractiveSummarizationProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomAbstractiveSummarizationProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomAbstractiveSummarizationProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomEntityRecognitionDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomEntityRecognitionDocument() { } + public string Dataset { get { throw null; } set { } } + public System.Collections.Generic.IList Entities { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomEntityRecognitionProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomEntityRecognitionProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + public System.Collections.Generic.IList Entities { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomEntityRecognitionProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomHealthcareDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomHealthcareDocument() { } + public string Dataset { get { throw null; } set { } } + public System.Collections.Generic.IList Entities { get { throw null; } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomHealthcareProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomHealthcareProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + public System.Collections.Generic.IList Entities { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomHealthcareProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomMultiLabelClassificationDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomMultiLabelClassificationDocument() { } + public System.Collections.Generic.IList Classes { get { throw null; } } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomMultiLabelClassificationProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomMultiLabelClassificationProjectAssets() { } + public System.Collections.Generic.IList Classes { get { throw null; } } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomMultiLabelClassificationProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomSingleLabelClassificationDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomSingleLabelClassificationDocument() { } + public Azure.AI.Language.Text.Authoring.Models.ExportedDocumentClass Class { get { throw null; } set { } } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomSingleLabelClassificationProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomSingleLabelClassificationProjectAssets() { } + public System.Collections.Generic.IList Classes { get { throw null; } } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomSingleLabelClassificationProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomTextSentimentDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomTextSentimentDocument() { } + public string Dataset { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + public string Location { get { throw null; } set { } } + public System.Collections.Generic.IList SentimentSpans { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentDocument System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedCustomTextSentimentProjectAssets : Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedCustomTextSentimentProjectAssets() { } + public System.Collections.Generic.IList Documents { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedCustomTextSentimentProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentClass : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentClass() { } + public string Category { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentClass System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentClass System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentEntityLabel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentEntityLabel() { } + public string Category { get { throw null; } set { } } + public int? Length { get { throw null; } set { } } + public int? Offset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityLabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityLabel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentEntityRegion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentEntityRegion() { } + public System.Collections.Generic.IList Labels { get { throw null; } } + public int? RegionLength { get { throw null; } set { } } + public int? RegionOffset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityRegion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentEntityRegion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedDocumentSentimentLabel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedDocumentSentimentLabel() { } + public Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment? Category { get { throw null; } set { } } + public int? Length { get { throw null; } set { } } + public int? Offset { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentSentimentLabel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedDocumentSentimentLabel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntity() { } + public string Category { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityList : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityList() { } + public System.Collections.Generic.IList Sublists { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntityListSynonym : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntityListSynonym() { } + public string Language { get { throw null; } set { } } + public System.Collections.Generic.IList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntityListSynonym System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedEntitySublist : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedEntitySublist() { } + public string ListKey { get { throw null; } set { } } + public System.Collections.Generic.IList Synonyms { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedEntitySublist System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedModelDetails(string trainedModelLabel) { } + public string TrainedModelLabel { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedModelJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedModelManifest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedModelManifest() { } + public System.Collections.Generic.IReadOnlyList ModelFiles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelManifest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedModelManifest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedPrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedPrebuiltEntity(string category) { } + public string Category { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedPrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedProject : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportedProject(string projectFileVersion, Azure.AI.Language.Text.Authoring.Models.StringIndexType stringIndexType, Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails metadata) { } + public Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets Assets { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.CreateProjectDetails Metadata { get { throw null; } } + public string ProjectFileVersion { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.StringIndexType StringIndexType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class ExportedProjectAssets : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ExportedProjectAssets() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedProjectAssets System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportedTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportedTrainedModel() { } + public string ExportedModelName { get { throw null; } } + public System.DateTimeOffset LastExportedModelDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportedTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public string ResultUrl { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ExportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ImportProjectJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImportProjectJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ImportProjectJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct InnerErrorCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InnerErrorCode(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode AzureCognitiveSearchNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode AzureCognitiveSearchThrottling { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode EmptyRequest { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode ExtractionFailure { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidCountryHint { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidDocument { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidDocumentBatch { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidParameterValue { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidRequest { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode InvalidRequestBodyFormat { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode KnowledgeBaseNotFound { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode MissingInputDocuments { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode ModelVersionIncorrect { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.InnerErrorCode UnsupportedLanguageCode { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode 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.Language.Text.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Text.Authoring.Models.InnerErrorCode right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.InnerErrorCode (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.InnerErrorCode left, Azure.AI.Language.Text.Authoring.Models.InnerErrorCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class InnerErrorModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal InnerErrorModel() { } + public Azure.AI.Language.Text.Authoring.Models.InnerErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Details { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.InnerErrorModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobStatus(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Cancelled { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Cancelling { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Failed { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus NotStarted { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus PartiallyCompleted { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Running { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.JobStatus Succeeded { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.JobStatus 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.Language.Text.Authoring.Models.JobStatus left, Azure.AI.Language.Text.Authoring.Models.JobStatus right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.JobStatus (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.JobStatus left, Azure.AI.Language.Text.Authoring.Models.JobStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LoadSnapshotJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LoadSnapshotJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.LoadSnapshotJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ModelFile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ModelFile() { } + public System.Uri ContentUri { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ModelFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ModelFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MultiLabelClassEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MultiLabelClassEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MultiLabelClassificationEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MultiLabelClassificationEvaluationSummary() { } + public System.Collections.Generic.IReadOnlyDictionary Classes { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.MultiLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PrebuiltEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PrebuiltEntity() { } + public string Category { get { throw null; } } + public string Description { get { throw null; } } + public string Examples { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.PrebuiltEntity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeletionJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeletionJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeletionJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectDeployment() { } + public System.Collections.Generic.IReadOnlyList AssignedResources { get { throw null; } } + public System.DateTimeOffset DeploymentExpirationDate { get { throw null; } } + public string DeploymentName { get { throw null; } } + public System.DateTimeOffset LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectDeployment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProjectKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProjectKind(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomAbstractiveSummarization { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomEntityRecognition { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomHealthcare { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomMultiLabelClassification { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomSingleLabelClassification { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.ProjectKind CustomTextSentiment { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.ProjectKind 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.Language.Text.Authoring.Models.ProjectKind left, Azure.AI.Language.Text.Authoring.Models.ProjectKind right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.ProjectKind (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.ProjectKind left, Azure.AI.Language.Text.Authoring.Models.ProjectKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProjectMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectMetadata() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public string Description { get { throw null; } } + public string Language { get { throw null; } } + public System.DateTimeOffset? LastDeployedDateTime { get { throw null; } } + public System.DateTimeOffset LastModifiedDateTime { get { throw null; } } + public System.DateTimeOffset? LastTrainedDateTime { get { throw null; } } + public bool? Multilingual { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ProjectKind ProjectKind { get { throw null; } } + public string ProjectName { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ProjectSettings Settings { get { throw null; } } + public string StorageInputContainerName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectSettings() { } + public string AmlProjectPath { get { throw null; } set { } } + public float? ConfidenceThreshold { get { throw null; } set { } } + public int? GptPredictiveLookahead { get { throw null; } set { } } + public bool? IsLabelingLocked { get { throw null; } set { } } + public bool? RunGptPredictions { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectTrainedModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProjectTrainedModel() { } + public bool HasSnapshot { get { throw null; } } + public string Label { get { throw null; } } + public System.DateTimeOffset LastTrainedDateTime { get { throw null; } } + public int LastTrainingDurationInSeconds { get { throw null; } } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string ModelId { get { throw null; } } + public string ModelTrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ProjectTrainedModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceMetadata(string azureResourceId, string customDomain, string region) { } + public string AzureResourceId { get { throw null; } } + public string CustomDomain { get { throw null; } } + public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.ResourceMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SentimentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SentimentEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SingleLabelClassEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SingleLabelClassEvaluationSummary() { } + public double F1 { get { throw null; } } + public int FalseNegativeCount { get { throw null; } } + public int FalsePositiveCount { get { throw null; } } + public double Precision { get { throw null; } } + public double Recall { get { throw null; } } + public int TrueNegativeCount { get { throw null; } } + public int TruePositiveCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SingleLabelClassificationEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SingleLabelClassificationEvaluationSummary() { } + public System.Collections.Generic.IReadOnlyDictionary Classes { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SingleLabelClassificationEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SpanSentimentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SpanSentimentEvaluationSummary() { } + public Azure.AI.Language.Text.Authoring.Models.ConfusionMatrix ConfusionMatrix { get { throw null; } } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Sentiments { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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.Language.Text.Authoring.Models.StringIndexType Utf16CodeUnit { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.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.Language.Text.Authoring.Models.StringIndexType left, Azure.AI.Language.Text.Authoring.Models.StringIndexType right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.StringIndexType (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.StringIndexType left, Azure.AI.Language.Text.Authoring.Models.StringIndexType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SubTrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SubTrainingJobState() { } + public System.DateTimeOffset? EndDateTime { get { throw null; } } + public int PercentComplete { get { throw null; } } + public System.DateTimeOffset? StartDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SupportedLanguage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SupportedLanguage() { } + public string LanguageCode { get { throw null; } } + public string LanguageName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SupportedLanguage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) { } + public string FirstDeploymentName { get { throw null; } } + public string SecondDeploymentName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SwapDeploymentsJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SwapDeploymentsJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.SwapDeploymentsJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TextAnalysisAuthoringError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextAnalysisAuthoringError() { } + public Azure.AI.Language.Text.Authoring.Models.ErrorCode Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.InnerErrorModel Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TextAnalysisAuthoringSentiment : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TextAnalysisAuthoringSentiment(string value) { throw null; } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Negative { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Neutral { get { throw null; } } + public static Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment Positive { get { throw null; } } + public bool Equals(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment 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.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment left, Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment right) { throw null; } + public static implicit operator Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment (string value) { throw null; } + public static bool operator !=(Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment left, Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringSentiment right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TextAnalysisAuthoringWarning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextAnalysisAuthoringWarning() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringWarning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextAnalysisAuthoringWarning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TextSentimentEvaluationSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TextSentimentEvaluationSummary() { } + public float MacroF1 { get { throw null; } } + public float MacroPrecision { get { throw null; } } + public float MacroRecall { get { throw null; } } + public float MicroF1 { get { throw null; } } + public float MicroPrecision { get { throw null; } } + public float MicroRecall { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.SpanSentimentEvaluationSummary SpanSentimentsEvaluation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TextSentimentEvaluationSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingConfigVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingConfigVersion() { } + public System.DateTimeOffset ModelExpirationDate { get { throw null; } } + public string TrainingConfigVersionProperty { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingConfigVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TrainingJobDetails(string modelLabel, string trainingConfigVersion) { } + public Azure.AI.Language.Text.Authoring.Models.DataGenerationSettings DataGenerationSettings { get { throw null; } set { } } + public Azure.AI.Language.Text.Authoring.Models.EvaluationDetails EvaluationOptions { get { throw null; } set { } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobResult() { } + public System.DateTimeOffset? EstimatedEndDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState EvaluationStatus { get { throw null; } } + public string ModelLabel { get { throw null; } } + public string TrainingConfigVersion { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.SubTrainingJobState TrainingStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TrainingJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TrainingJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.TrainingJobResult Result { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.TrainingJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UnassignDeploymentResourcesDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UnassignDeploymentResourcesDetails(System.Collections.Generic.IEnumerable assignedResourceIds) { } + public System.Collections.Generic.IList AssignedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UnassignDeploymentResourcesJobState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UnassignDeploymentResourcesJobState() { } + public System.DateTimeOffset CreatedDateTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.DateTimeOffset? ExpirationDateTime { get { throw null; } } + public string JobId { get { throw null; } } + public System.DateTimeOffset LastUpdatedDateTime { get { throw null; } } + public Azure.AI.Language.Text.Authoring.Models.JobStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesJobState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Language.Text.Authoring.Models.UnassignDeploymentResourcesJobState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md new file mode 100644 index 000000000000..43feea12e14a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/README.md @@ -0,0 +1,41 @@ +--- +page_type: sample +languages: +- csharp +products: +# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +- azure +name: Azure.AI.Language.Text.Authoring samples for .NET +description: Samples for the Azure.AI.Language.Text.Authoring client library. +--- + +# Azure.AI.Language.Text.Authoring Samples + +Azure Text Authoring is part of the Azure Cognitive Service for Language, a cloud-based service that enables creating, managing, and deploying text analysis solutions. This client library provides the following features: + +## Common Scenarios Samples + +* [Create a New Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md) +* [Create a New Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md) +* [Import a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md) +* [Import a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md) +* [Get Project Details (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md) +* [Get Project Details (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md) +* [Delete a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md) +* [Delete a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md) +* [Train a Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md) +* [Train a Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md) +* [Cancel Training Job (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md) +* [Cancel Training Job (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md) +* [Get Model Evaluation Summary (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md) +* [Get Model Evaluation Summary (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md) +* [Load Snapshot (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md) +* [Load Snapshot (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md) +* [Delete a Trained Model (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md) +* [Delete a Trained Model (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md) +* [Deploy a Project (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md) +* [Deploy a Project (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md) +* [Swap Deployments (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md) +* [Swap Deployments (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md) +* [Delete a Deployment (Sync)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md) +* [Delete a Deployment (Async)](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md new file mode 100644 index 000000000000..23fec75d8a15 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProject.md @@ -0,0 +1,36 @@ +# Deploying a Project Synchronously in Azure AI Language + +This sample demonstrates how to deploy a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Deploy a Project Synchronously + +To deploy a project, call DeployProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample10_TextAuthoring_DeployProject +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +var deploymentDetails = new CreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = authoringClient.DeployProject( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName, + body: deploymentDetails +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProject method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md new file mode 100644 index 000000000000..feb5ecb731bd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample10_TextAuthoring_DeployProjectAsync.md @@ -0,0 +1,36 @@ +# Deploying a Project Asynchronously in Azure AI Language + +This sample demonstrates how to deploy a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Deploy a Project Asynchronously + +To deploy a project, call DeployProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample10_TextAuthoring_DeployProjectAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentName"; +var deploymentConfig = new CreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + +Operation operation = await authoringClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName, + body: deploymentConfig +); + +Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); +``` + +To deploy a project, the DeployProjectAsync method sends a request with the project name, deployment name, and deployment configuration. The method returns an Operation object indicating the deployment status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md new file mode 100644 index 000000000000..ebee97ac9dfd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeployments.md @@ -0,0 +1,37 @@ +# Swapping Deployments Synchronously in Azure AI Language + +This sample demonstrates how to swap deployments synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Swap Deployments Synchronously + +To swap deployments, call SwapDeployments on the TextAnalysisAuthoring client. + +```C# Snippet:Sample11_TextAuthoring_SwapDeployments +string projectName = "LoanAgreements"; +var swapDetails = new SwapDeploymentsDetails( + firstDeploymentName: "DeploymentA", + secondDeploymentName: "DeploymentB" + ); + +Operation operation = authoringClient.SwapDeployments( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails +); + +Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); +``` + +To swap deployments, the SwapDeployments method sends a request with the project name and the deployment swap configuration. The method returns an Operation object indicating the swap status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md new file mode 100644 index 000000000000..d61012baa0af --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample11_TextAuthoring_SwapDeploymentsAsync.md @@ -0,0 +1,38 @@ +# Swapping Deployments Asynchronously in Azure AI Language + +This sample demonstrates how to swap deployments asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Swap Deployments Asynchronously + +To swap deployments, call SwapDeploymentsAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample11_TextAuthoring_SwapDeploymentsAsync +string projectName = "LoanAgreements"; +var swapDetails = new SwapDeploymentsDetails +( + firstDeploymentName: "DeploymentA", + secondDeploymentName: "DeploymentB" + ); + +Operation operation = await authoringClient.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails +); + +Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); +``` + +To swap deployments, the SwapDeploymentsAsync method sends a request with the project name and the deployment swap configuration. The method returns an Operation object indicating the swap status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md new file mode 100644 index 000000000000..368e38283bf7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeployment.md @@ -0,0 +1,34 @@ +# Deleting a Deployment Synchronously in Azure AI Language + +This sample demonstrates how to delete a deployment synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Delete a Deployment Synchronously + +To delete a deployment, call DeleteDeployment on the TextAnalysisAuthoring client. + +```C# Snippet:Sample12_TextAuthoring_DeleteDeployment +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentA"; + +Operation operation = authoringClient.DeleteDeployment( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName +); + +Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a deployment, the DeleteDeployment method sends a request with the project name and deployment name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md new file mode 100644 index 000000000000..bb8c7e49ee64 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample12_TextAuthoring_DeleteDeploymentAsync.md @@ -0,0 +1,34 @@ +# Deleting a Deployment Asynchronously in Azure AI Language + +This sample demonstrates how to delete a deployment asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Delete a Deployment Asynchronously + +To delete a deployment, call DeleteDeploymentAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample12_TextAuthoring_DeleteDeploymentAsync +string projectName = "LoanAgreements"; +string deploymentName = "DeploymentA"; + +Operation operation = await authoringClient.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName +); + +Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a deployment, the DeleteDeploymentAsync method sends a request with the project name and deployment name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md new file mode 100644 index 000000000000..69c48b0b8c11 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProject.md @@ -0,0 +1,33 @@ +# Retrieving Project Metadata Synchronously in Azure AI Language +This sample demonstrates how to retrieve metadata of a project synchronously using the Azure.AI.Language.Text.Authoring SDK. + +## Create an AuthoringClient +To create an AuthoringClient, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an AuthoringClientOptions instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Retrieve Project Metadata Synchronously +To retrieve metadata of a project, call GetProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample1_TextAuthoring_GetProject +string projectName = "MyTextProject"; + +Response response = authoringClient.GetProject(projectName); +ProjectMetadata projectMetadata = response.Value; + +Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); +Console.WriteLine($"Language: {projectMetadata.Language}"); +Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); +Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); +Console.WriteLine($"Description: {projectMetadata.Description}"); +``` + +To retrieve project metadata synchronously, call GetProject on the TextAnalysisAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md new file mode 100644 index 000000000000..3914557e0c77 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample1_TextAuthoring_GetProjectAsync.md @@ -0,0 +1,36 @@ +# Retrieving Project Metadata Asynchronously in Azure AI Language + +This sample demonstrates how to retrieve metadata of a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Retrieve Project Metadata Asynchronously + +To retrieve metadata of a project, call GetProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample1_TextAuthoring_GetProjectAsync +string projectName = "MyTextProjectAsync"; + +Response response = await authoringClient.GetProjectAsync(projectName); +ProjectMetadata projectMetadata = response.Value; + +Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); +Console.WriteLine($"Language: {projectMetadata.Language}"); +Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); +Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); +Console.WriteLine($"Description: {projectMetadata.Description}"); +``` + +To retrieve project metadata asynchronously, call GetProjectAsync on the TextAnalysisAuthoring client. The method returns a ProjectMetadata object that contains detailed information about the project, such as its creation date, last modification date, description, and more. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md new file mode 100644 index 000000000000..62fb00b66103 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_Import.md @@ -0,0 +1,150 @@ +# Importing Project Data Synchronously in Azure AI Language + +This sample demonstrates how to import project data synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Import Project Data Synchronously + +To import project data, call Import on the TextAnalysisAuthoring client. + +```C# Snippet:Sample2_TextAuthoring_Import +string projectName = "LoanAgreements"; + +var projectMetadata = new CreateProjectDetails( + projectKind: "CustomEntityRecognition", + storageInputContainerName: "loanagreements", + projectName: projectName, + language: "en" +) +{ + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false, + Settings = new ProjectSettings() +}; + +var projectAssets = new ExportedCustomEntityRecognitionProjectAssets +{ + Entities = + { + new ExportedEntity + { + Category = "Date" + }, + new ExportedEntity + { + Category = "LenderName" + }, + new ExportedEntity + { + Category = "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } +}; + +var exportedProject = new ExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata +) +{ + Assets = projectAssets +}; + +Operation operation = authoringClient.Import( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); +``` + +To import project data synchronously, call Import on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md new file mode 100644 index 000000000000..b9ffe2dccbc8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample2_TextAuthoring_ImportAsync.md @@ -0,0 +1,149 @@ +# Importing Project Data Asynchronously in Azure AI Language + +This sample demonstrates how to import project data asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Import Project Data Asynchronously + +To import project data, call ImportAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample2_TextAuthoring_ImportAsync +string projectName = "LoanAgreements"; + +var projectMetadata = new CreateProjectDetails( + projectKind: "CustomEntityRecognition", + storageInputContainerName: "loanagreements", + projectName: projectName, + language: "en" +) +{ + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false, + Settings = new ProjectSettings() +}; + +var projectAssets = new ExportedCustomEntityRecognitionProjectAssets +{ + Entities = + { + new ExportedEntity + { + Category= "Date" + }, + new ExportedEntity + { + Category= "LenderName" + }, + new ExportedEntity + { + Category= "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } +}; + +var exportedProject = new ExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata) +{ + Assets = projectAssets +}; + +Operation operation = await authoringClient.ImportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); +``` + +To import project data asynchronously, call ImportAsync on the TextAnalysisAuthoring client. The method returns an Operation object, allowing you to track the import's status and results. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md new file mode 100644 index 000000000000..d10088e0b2a2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProject.md @@ -0,0 +1,40 @@ +# Creating a Project Synchronously in Azure AI Language + +This sample demonstrates how to create a new project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +The values of the endpoint and apiKey variables can be retrieved from environment variables, configuration settings, or any other secure approach that works for your application. + +## Create a Project Synchronously + +To create a new project, call CreateProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample3_TextAuthoring_CreateProject +string projectName = "MyNewProject"; +var projectData = new +{ + projectName = projectName, + language = "en", + projectKind = "CustomEntityRecognition", + description = "Project description for a Custom Entity Recognition project", + multilingual = true +}; + +using RequestContent content = RequestContent.Create(projectData); +Response response = authoringClient.CreateProject(projectName, content); + +Console.WriteLine($"Project created with status: {response.Status}"); +``` + +To create a project, the CreateProject method sends a request with the necessary project data (such as name, language, and project type). The method returns a Response object indicating the creation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md new file mode 100644 index 000000000000..a4f3ec365bf7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample3_TextAuthoring_CreateProjectAsync.md @@ -0,0 +1,38 @@ +# Creating a Project Asynchronously in Azure AI Language + +This sample demonstrates how to create a new project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Create a Project Asynchronously + +To create a new project, call CreateProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample3_TextAuthoring_CreateProjectAsync +string projectName = "MyNewProjectAsync"; +var projectData = new +{ + projectName = projectName, + language = "en", + projectKind = "CustomEntityRecognition", + description = "Project description for a Custom Entity Recognition project", + multilingual = true +}; + +using RequestContent content = RequestContent.Create(projectData); +Response response = await authoringClient.CreateProjectAsync(projectName, content); + +Console.WriteLine($"Project created with status: {response.Status}"); +``` + +To create a project, the CreateProject method sends a request with the necessary project data (such as name, language, and project type). The method returns a Response object indicating the creation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md new file mode 100644 index 000000000000..22c31cc91b40 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProject.md @@ -0,0 +1,34 @@ +# Deleting a Project Synchronously in Azure AI Language + +This sample demonstrates how to delete a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Delete a Project Synchronously + +To delete a project, call DeleteProject on the TextAnalysisAuthoring client. + +```C# Snippet:Sample4_TextAuthoring_DeleteProject +string projectName = "ProjectToDelete"; + +Operation operation = authoringClient.DeleteProject( + waitUntil: WaitUntil.Completed, + projectName: projectName +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a project, the DeleteProject method sends a request with the project name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md new file mode 100644 index 000000000000..cddaa8bf6494 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample4_TextAuthoring_DeleteProjectAsync.md @@ -0,0 +1,34 @@ +# Deleting a Project Asynchronously in Azure AI Language + +This sample demonstrates how to delete a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Delete a Project Asynchronously + +To delete a project, call DeleteProjectAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample4_TextAuthoring_DeleteProjectAsync +string projectName = "ProjectToDelete"; + +Operation operation = await authoringClient.DeleteProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); +``` + +To delete a project, the DeleteProjectAsync method sends a request with the project name. The method returns an Operation object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md new file mode 100644 index 000000000000..887502f6897a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_Train.md @@ -0,0 +1,48 @@ +# Training a Project Synchronously in Azure AI Language + +This sample demonstrates how to train a project synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Train a Project Synchronously + +To train a project, call Train on the TextAnalysisAuthoring client. + +```C# Snippet:Sample5_TextAuthoring_Train +string projectName = "LoanAgreements"; + +var trainingJobDetails = new TrainingJobDetails( + modelLabel: "model1", + trainingConfigVersion: "latest" +) +{ + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } +}; + +Operation operation = authoringClient.Train( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); +``` + +To train a project, the Train method sends a request with the necessary training job configuration. The method returns an Operation object indicating the training status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md new file mode 100644 index 000000000000..2966ebf17ec1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample5_TextAuthoring_TrainAsync.md @@ -0,0 +1,48 @@ +# Training a Project Asynchronously in Azure AI Language + +This sample demonstrates how to train a project asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Train a Project Asynchronously + +To train a project, call TrainAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample5_TextAuthoring_TrainAsync +string projectName = "LoanAgreements"; + +var trainingJobConfig = new TrainingJobDetails( + modelLabel: "model1", + trainingConfigVersion: "latest" +) +{ + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } +}; + +Operation operation = await authoringClient.TrainAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobConfig +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); +``` + +To train a project, the TrainAsync method sends a request with the necessary training job configuration. The method returns an Operation object indicating the training status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md new file mode 100644 index 000000000000..e3b6a8edd3c5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJob.md @@ -0,0 +1,36 @@ +# Canceling a Training Job Synchronously in Azure AI Language + +This sample demonstrates how to cancel a training job synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Cancel a Training Job Synchronously + +To cancel a training job, call CancelTrainingJob on the TextAnalysisAuthoring client. + +```C# Snippet:Sample6_TextAuthoring_CancelTrainingJob +string projectName = "LoanAgreements"; +string jobId = "training-job-id"; // Replace with an actual job ID. + +Operation operation = authoringClient.CancelTrainingJob( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); +``` + +To cancel a training job, the CancelTrainingJob method sends a request with the project name and the job ID. The method returns an Operation object indicating the cancellation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md new file mode 100644 index 000000000000..134bbc04d79e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample6_TextAuthoring_CancelTrainingJobAsync.md @@ -0,0 +1,36 @@ +# Canceling a Training Job Asynchronously in Azure AI Language + +This sample demonstrates how to cancel a training job asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Cancel a Training Job Asynchronously + +To cancel a training job, call CancelTrainingJobAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample6_TextAuthoring_CancelTrainingJobAsync +string projectName = "LoanAgreements"; +string jobId = "training-job-id"; // Replace with an actual job ID. + +Operation operation = await authoringClient.CancelTrainingJobAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); +``` + +To cancel a training job, the CancelTrainingJobAsync method sends a request with the project name and the job ID. The method returns an Operation object indicating the cancellation status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md new file mode 100644 index 000000000000..efd9dffffe6f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummary.md @@ -0,0 +1,79 @@ +# Retrieving Model Evaluation Summary Synchronously in Azure AI Language + +This sample demonstrates how to retrieve the evaluation summary of a trained model synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Get Model Evaluation Summary Synchronously + +To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummary on the TextAnalysisAuthoring client. + +```C# Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummary +string projectName = "LoanAgreements"; +string trainedModelLabel = "model2"; + +// Get the evaluation summary for the trained model +Response evaluationSummaryResponse = authoringClient.GetModelEvaluationSummary(projectName, trainedModelLabel); + +EvaluationSummary evaluationSummary = evaluationSummaryResponse.Value; + +// Cast to the specific evaluation summary type for custom single label classification +if (evaluationSummary is CustomSingleLabelClassificationEvaluationSummary singleLabelSummary) +{ + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix.AdditionalProperties) + { + Console.WriteLine($"Row: {row.Key}"); + var columnData = row.Value.ToObjectFromJson>(); + foreach (var col in columnData) + { + var values = col.Value.ToObjectFromJson>(); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {values["normalizedValue"]}, Raw Value: {values["rawValue"]}"); + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } +} +else +{ + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); +} +``` + +To retrieve a model evaluation summary, the GetModelEvaluationSummary method sends a request with the project name and the model label. It returns a specific EvaluationSummary object containing metrics such as F1 score, precision, recall, and class-specific metrics. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md new file mode 100644 index 000000000000..e68332330016 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.md @@ -0,0 +1,79 @@ +# Retrieving Model Evaluation Summary Asynchronously in Azure AI Language + +This sample demonstrates how to retrieve the evaluation summary of a trained model asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Get Model Evaluation Summary Asynchronously + +To retrieve the evaluation summary of a trained model, call GetModelEvaluationSummaryAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync +string projectName = "LoanAgreements"; +string trainedModelLabel = "model2"; + +// Get the evaluation summary for the trained model +Response evaluationSummaryResponse = await authoringClient.GetModelEvaluationSummaryAsync(projectName, trainedModelLabel); + +EvaluationSummary evaluationSummary = evaluationSummaryResponse.Value; + +// Cast to the specific evaluation summary type for custom single label classification +if (evaluationSummary is CustomSingleLabelClassificationEvaluationSummary singleLabelSummary) +{ + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix.AdditionalProperties) + { + Console.WriteLine($"Row: {row.Key}"); + var columnData = row.Value.ToObjectFromJson>(); + foreach (var col in columnData) + { + var values = col.Value.ToObjectFromJson>(); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {values["normalizedValue"]}, Raw Value: {values["rawValue"]}"); + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } +} +else +{ + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); +} +``` + +To retrieve a model evaluation summary, the GetModelEvaluationSummaryAsync method sends a request with the project name and the model label. It returns a specific EvaluationSummary object containing metrics such as F1 score, precision, recall, and class-specific metrics. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md new file mode 100644 index 000000000000..c940b37ace08 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshot.md @@ -0,0 +1,36 @@ +# Loading a Snapshot Synchronously in Azure AI Language + +This sample demonstrates how to load a snapshot synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Load a Snapshot Synchronously + +To load a snapshot, call LoadSnapshot on the TextAnalysisAuthoring client. + +```C# Snippet:Sample8_TextAuthoring_LoadSnapshot +string projectName = "LoanAgreements"; +string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. + +Operation operation = authoringClient.LoadSnapshot( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); +``` + +To load a snapshot, the LoadSnapshot method sends a request with the project name and trained model label. The method returns an Operation object indicating the status of the snapshot loading. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md new file mode 100644 index 000000000000..bf083928f25a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample8_TextAuthoring_LoadSnapshotAsync.md @@ -0,0 +1,36 @@ +# Loading a Snapshot Asynchronously in Azure AI Language + +This sample demonstrates how to load a snapshot asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Load a Snapshot Asynchronously + +To load a snapshot, call LoadSnapshotAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample8_TextAuthoring_LoadSnapshotAsync +string projectName = "LoanAgreements"; +string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. + +Operation operation = await authoringClient.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; +Console.WriteLine($"Operation Location: {operationLocation}"); +Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); +``` + +To load a snapshot, the LoadSnapshotAsync method sends a request with the project name and trained model label. The method returns an Operation object indicating the status of the snapshot loading. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md new file mode 100644 index 000000000000..d445f7c50152 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModel.md @@ -0,0 +1,33 @@ +# Deleting a Trained Model Synchronously in Azure AI Language + +This sample demonstrates how to delete a trained model synchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Delete a Trained Model Synchronously + +To delete a trained model, call DeleteTrainedModel on the TextAnalysisAuthoring client. + +```C# Snippet:Sample9_TextAuthoring_DeleteTrainedModel +string projectName = "LoanAgreements"; +string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. + +Response response = authoringClient.DeleteTrainedModel( + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); +``` + +To delete a trained model, the DeleteTrainedModel method sends a request with the project name and the model label. The method returns a Response object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md new file mode 100644 index 000000000000..61754afe9117 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.md @@ -0,0 +1,33 @@ +# Deleting a Trained Model Asynchronously in Azure AI Language + +This sample demonstrates how to delete a trained model asynchronously using the `Azure.AI.Language.Text.Authoring` SDK. + +## Create an `AuthoringClient` + +To create an `AuthoringClient`, you will need the service endpoint and credentials of your Language resource. You can specify the service version by providing an `AuthoringClientOptions` instance. + +```C# Snippet:CreateTextAuthoringClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new("your apikey"); +AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); +AuthoringClient client = new AuthoringClient(endpoint, credential, options); +TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); +``` + +## Delete a Trained Model Asynchronously + +To delete a trained model, call DeleteTrainedModelAsync on the TextAnalysisAuthoring client. + +```C# Snippet:Sample9_TextAuthoring_DeleteTrainedModelAsync +string projectName = "LoanAgreements"; +string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. + +Response response = await authoringClient.DeleteTrainedModelAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel +); + +Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); +``` + +To delete a trained model, the DeleteTrainedModelAsync method sends a request with the project name and the model label. The method returns a Response object indicating the deletion status. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/AuthoringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/AuthoringClientOptions.cs new file mode 100644 index 000000000000..8ba4de6a81a1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/AuthoringClientOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + public partial class AuthoringClientOptions : ClientOptions + { + /// + /// Gets or sets the audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. + /// + /// If null, will be assumed. + internal TextAuthoringAudience? Audience { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Azure.AI.Language.Text.Authoring.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Azure.AI.Language.Text.Authoring.csproj new file mode 100644 index 000000000000..388316ddf1e3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Azure.AI.Language.Text.Authoring.csproj @@ -0,0 +1,22 @@ + + + This is the Authoring client library for developing .NET applications with rich experience. + Azure SDK Code Generation Authoring for Azure Data Plane + 1.0.0-beta.1 + Azure Authoring + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs new file mode 100644 index 000000000000..c9d187a629d9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClient.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Text.Authoring +{ + // Data plane generated client. + /// The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. + public partial class AuthoringClient + { + 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; + + /// 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 AuthoringClient for mocking. + protected AuthoringClient() + { + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AuthoringClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AuthoringClientOptions()) + { + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AuthoringClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AuthoringClientOptions()) + { + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AuthoringClient(Uri endpoint, AzureKeyCredential credential, AuthoringClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AuthoringClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of AuthoringClient. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AuthoringClient(Uri endpoint, TokenCredential credential, AuthoringClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AuthoringClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of TextAnalysisAuthoring. + /// The API version to use for this operation. + /// is null. + public virtual TextAnalysisAuthoring GetTextAnalysisAuthoringClient(string apiVersion = "2024-11-15-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new TextAnalysisAuthoring(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClientOptions.cs new file mode 100644 index 000000000000..4c7c68bce1dd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/AuthoringClientOptions.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + /// Client options for AuthoringClient. + public partial class AuthoringClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-04-01". + V2023_04_01 = 1, + /// Service version "2023-04-15-preview". + V2023_04_15_Preview = 2, + /// Service version "2024-11-15-preview". + V2024_11_15_Preview = 3, + } + + internal string Version { get; } + + /// Initializes new instance of AuthoringClientOptions. + public AuthoringClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_04_01 => "2023-04-01", + ServiceVersion.V2023_04_15_Preview => "2023-04-15-preview", + ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Docs/TextAnalysisAuthoring.xml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Docs/TextAnalysisAuthoring.xml new file mode 100644 index 000000000000..9d6677f775eb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Docs/TextAnalysisAuthoring.xml @@ -0,0 +1,5789 @@ + + + + + +This sample shows how to call GetProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> +This sample shows how to call GetProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> + + + +This sample shows how to call GetProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> +This sample shows how to call GetProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> + + + +This sample shows how to call GetProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call GetProjectAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call GetProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call GetProject with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CreateProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", +}); +Response response = await client.CreateProjectAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call CreateProjectAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", +}); +Response response = await client.CreateProjectAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CreateProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", +}); +Response response = client.CreateProject("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call CreateProject with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", +}); +Response response = client.CreateProject("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorization. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", +}); +Response response = await client.CopyProjectAuthorizationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, +}); +Response response = await client.CopyProjectAuthorizationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> + + + +This sample shows how to call CopyProjectAuthorization and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", +}); +Response response = client.CopyProjectAuthorization("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, +}); +Response response = client.CopyProjectAuthorization("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetCopyProjectStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> +This sample shows how to call GetDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> + + + +This sample shows how to call GetDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> +This sample shows how to call GetDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> + + + +This sample shows how to call GetDeploymentAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> +This sample shows how to call GetDeploymentAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> + + + +This sample shows how to call GetDeployment and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> +This sample shows how to call GetDeployment with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> +This sample shows how to call GetExportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetExportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> +This sample shows how to call GetExportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> + + + +This sample shows how to call GetExportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("resultUrl").ToString()); +]]> + + + +This sample shows how to call GetExportStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("resultUrl").ToString()); +]]> + + + +This sample shows how to call GetExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> +This sample shows how to call GetExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> + + + +This sample shows how to call GetExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> +This sample shows how to call GetExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> + + + +This sample shows how to call GetExportedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> +This sample shows how to call GetExportedModelAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> + + + +This sample shows how to call GetExportedModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> +This sample shows how to call GetExportedModel with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("exportedModelName").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportedModelJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportedModelManifestAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", ""); +]]> +This sample shows how to call GetExportedModelManifestAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", ""); +]]> + + + +This sample shows how to call GetExportedModelManifest. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", ""); +]]> +This sample shows how to call GetExportedModelManifest with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", ""); +]]> + + + +This sample shows how to call GetExportedModelManifestAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> +This sample shows how to call GetExportedModelManifestAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> + + + +This sample shows how to call GetExportedModelManifest and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> +This sample shows how to call GetExportedModelManifest with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> + + + +This sample shows how to call GetImportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> +This sample shows how to call GetImportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetImportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> +This sample shows how to call GetImportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> + + + +This sample shows how to call GetImportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetImportStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetImportStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetImportStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetTrainedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> + + + +This sample shows how to call GetTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> +This sample shows how to call GetTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> + + + +This sample shows how to call GetTrainedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> + + + +This sample shows how to call GetTrainedModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> +This sample shows how to call GetTrainedModel with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("label").ToString()); +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> + + + +This sample shows how to call DeleteTrainedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.DeleteTrainedModelAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.DeleteTrainedModelAsync("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> +This sample shows how to call GetEvaluationStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call GetEvaluationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call GetEvaluationStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummary. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +]]> + + + +This sample shows how to call GetModelEvaluationSummary and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetTrainingStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> + + + +This sample shows how to call GetTrainingStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> +This sample shows how to call GetTrainingStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> + + + +This sample shows how to call GetTrainingStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call GetTrainingStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call GetTrainingStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetProjectDeletionStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetProjectsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectMetadata item in client.GetProjectsAsync()) +{ +} +]]> +This sample shows how to call GetProjectsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetProjects. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectMetadata item in client.GetProjects()) +{ +} +]]> +This sample shows how to call GetProjects with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetProjectsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetProjectsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetProjects and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetProjects(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetProjects with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) +{ +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectDeployment item in client.GetDeployments("")) +{ +} +]]> +This sample shows how to call GetDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetExportedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) +{ +} +]]> +This sample shows how to call GetExportedModelsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetExportedModels. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ExportedTrainedModel item in client.GetExportedModels("")) +{ +} +]]> +This sample shows how to call GetExportedModels with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetExportedModelsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> +This sample shows how to call GetExportedModelsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> + + + +This sample shows how to call GetExportedModels and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> +This sample shows how to call GetExportedModels with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> + + + +This sample shows how to call GetTrainedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) +{ +} +]]> +This sample shows how to call GetTrainedModelsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainedModels. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectTrainedModel item in client.GetTrainedModels("")) +{ +} +]]> +This sample shows how to call GetTrainedModels with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainedModelsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> +This sample shows how to call GetTrainedModelsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> + + + +This sample shows how to call GetTrainedModels and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> +This sample shows how to call GetTrainedModels with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResultsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResults. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResultsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResults and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) +{ +} +]]> +This sample shows how to call GetDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) +{ +} +]]> +This sample shows how to call GetDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentResourcesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResources and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentResources with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingJobsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) +{ +} +]]> +This sample shows how to call GetTrainingJobsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingJobs. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingJobState item in client.GetTrainingJobs("")) +{ +} +]]> +This sample shows how to call GetTrainingJobs with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingJobsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +} +]]> +This sample shows how to call GetTrainingJobsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingJobs and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +} +]]> +This sample shows how to call GetTrainingJobs with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +} +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync()) +{ +} +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetAssignedResourceDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments()) +{ +} +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call GetAssignedResourceDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetAssignedResourceDeployments(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetAssignedResourceDeployments(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync()) +{ +} +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetSupportedLanguages. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (SupportedLanguage item in client.GetSupportedLanguages()) +{ +} +]]> +This sample shows how to call GetSupportedLanguages with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (SupportedLanguage item in client.GetSupportedLanguages(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedLanguagesAsync(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedLanguagesAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedLanguages and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedLanguages(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> +This sample shows how to call GetSupportedLanguages with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedLanguages("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) +{ +} +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) +{ +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) +{ +} +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) +{ +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync()) +{ +} +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingConfigVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions()) +{ +} +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingConfigVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingConfigVersions(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingConfigVersions("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call DeleteProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> +This sample shows how to call DeleteProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call DeleteProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> +This sample shows how to call DeleteProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call CopyProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call CopyProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = client.CopyProject(WaitUntil.Completed, "", body); +]]> +This sample shows how to call CopyProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectDetails body = new CopyProjectDetails( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = client.CopyProject(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call CopyProjectAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CopyProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = client.CopyProject(WaitUntil.Completed, "", content); +]]> +This sample shows how to call CopyProject with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = client.CopyProject(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); +]]> +This sample shows how to call ExportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); +]]> +This sample shows how to call Export with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); +]]> +This sample shows how to call ExportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); +]]> +This sample shows how to call Export with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call ImportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") +{ + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", +}) +{ + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") + { + Location = "", + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, format: ""); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); +Operation operation = client.Import(WaitUntil.Completed, "", body); +]]> +This sample shows how to call Import with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") +{ + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", +}) +{ + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") + { + Location = "", + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = client.Import(WaitUntil.Completed, "", body, format: ""); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call ImportAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { + new + { + summaryLocation = "", + location = "", + language = "", + dataset = "", + } + }, + projectKind = "CustomAbstractiveSummarization", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: ""); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content); +]]> +This sample shows how to call Import with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { + new + { + summaryLocation = "", + location = "", + language = "", + dataset = "", + } + }, + projectKind = "CustomAbstractiveSummarization", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content, format: ""); +]]> + + + +This sample shows how to call TrainAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", ""); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call TrainAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", "") +{ + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), +}; +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call Train. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", ""); +Operation operation = client.Train(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call Train with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobDetails body = new TrainingJobDetails("", "") +{ + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), +}; +Operation operation = client.Train(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call TrainAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", +}); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call TrainAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, +}); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call Train and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", +}); +Operation operation = client.Train(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call Train with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, +}); +Operation operation = client.Train(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails(""); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails(""); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentDetails body = new CreateDeploymentDetails("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeployProjectAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeployProject with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails(); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails(); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentDetails body = new DeleteDeploymentDetails +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); +]]> +This sample shows how to call SwapDeployments with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelDetails body = new ExportedModelDetails(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call EvaluateModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails(); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> +This sample shows how to call EvaluateModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails +{ + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, +}; +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call EvaluateModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails(); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> +This sample shows how to call EvaluateModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationDetails body = new EvaluationDetails +{ + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, +}; +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call EvaluateModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call EvaluateModelAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, +}); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call EvaluateModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call EvaluateModel with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, +}); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call LoadSnapshotAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call LoadSnapshotAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call LoadSnapshot. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call LoadSnapshot with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call AssignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call AssignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call AssignDeploymentResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); +]]> +This sample shows how to call AssignDeploymentResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CancelTrainingJobAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call CancelTrainingJobAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call CancelTrainingJob. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call CancelTrainingJob with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call CancelTrainingJobAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call CancelTrainingJobAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call CancelTrainingJob and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call CancelTrainingJob with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Argument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..3fa25d1d24da --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..74e36eab8e74 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ChangeTrackingList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..403fa2389393 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Text.Authoring +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..3c5697bcb4b4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Optional.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..017fd861b854 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.AI.Language.Text.Authoring +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..9575d889e32b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs new file mode 100644 index 000000000000..70b3163cb78c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourcesMetadata"u8); + writer.WriteStartArray(); + foreach (var item in ResourcesMetadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignDeploymentResourcesDetails(document.RootElement, options); + } + + internal static AssignDeploymentResourcesDetails DeserializeAssignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList resourcesMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourcesMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceMetadata.DeserializeResourceMetadata(item, options)); + } + resourcesMetadata = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignDeploymentResourcesDetails(resourcesMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); + } + } + + AssignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignDeploymentResourcesDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignDeploymentResourcesDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignDeploymentResourcesDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs new file mode 100644 index 000000000000..2bbfb5188cb7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesDetails.cs @@ -0,0 +1,76 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the options for assigning Azure resources to a project. + public partial class AssignDeploymentResourcesDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the metadata for the resources to be assigned. + /// is null. + public AssignDeploymentResourcesDetails(IEnumerable resourcesMetadata) + { + Argument.AssertNotNull(resourcesMetadata, nameof(resourcesMetadata)); + + ResourcesMetadata = resourcesMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Represents the metadata for the resources to be assigned. + /// Keeps track of any properties unknown to the library. + internal AssignDeploymentResourcesDetails(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + { + ResourcesMetadata = resourcesMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignDeploymentResourcesDetails() + { + } + + /// Represents the metadata for the resources to be assigned. + public IList ResourcesMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.Serialization.cs new file mode 100644 index 000000000000..bda18efe99e8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignDeploymentResourcesJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignDeploymentResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignDeploymentResourcesJobState(document.RootElement, options); + } + + internal static AssignDeploymentResourcesJobState DeserializeAssignDeploymentResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignDeploymentResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support writing '{options.Format}' format."); + } + } + + AssignDeploymentResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignDeploymentResourcesJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignDeploymentResourcesJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignDeploymentResourcesJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.cs new file mode 100644 index 000000000000..7661a3cd0353 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignDeploymentResourcesJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a assign deployment resources job. + public partial class AssignDeploymentResourcesJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal AssignDeploymentResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal AssignDeploymentResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignDeploymentResourcesJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs new file mode 100644 index 000000000000..9bfeba044263 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignedDeploymentResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + } + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedDeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedDeploymentResource(document.RootElement, options); + } + + internal static AssignedDeploymentResource DeserializeAssignedDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{options.Format}' format."); + } + } + + AssignedDeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedDeploymentResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedDeploymentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedDeploymentResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.cs new file mode 100644 index 000000000000..3981d1d5e0f4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedDeploymentResource.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the assigned deployment resource. + public partial class AssignedDeploymentResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource region. + /// is null. + internal AssignedDeploymentResource(string region) + { + Argument.AssertNotNull(region, nameof(region)); + + Region = region; + } + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// Keeps track of any properties unknown to the library. + internal AssignedDeploymentResource(string azureResourceId, string region, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedDeploymentResource() + { + } + + /// The resource ID. + public string AzureResourceId { get; } + /// The resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs new file mode 100644 index 000000000000..d30582549888 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignedProjectDeploymentMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedProjectDeploymentMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + } + + internal static AssignedProjectDeploymentMetadata DeserializeAssignedProjectDeploymentMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedProjectDeploymentMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedProjectDeploymentMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs new file mode 100644 index 000000000000..8b5d9c8fe883 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentMetadata.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the metadata for an assigned deployment. + public partial class AssignedProjectDeploymentMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// is null. + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate) + { + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + DeploymentName = deploymentName; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + } + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Keeps track of any properties unknown to the library. + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedProjectDeploymentMetadata() + { + } + + /// Represents the deployment name. + public string DeploymentName { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs new file mode 100644 index 000000000000..fa117bf2c3ec --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class AssignedProjectDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + } + writer.WritePropertyName("deploymentsMetadata"u8); + writer.WriteStartArray(); + foreach (var item in DeploymentsMetadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssignedProjectDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + } + + internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = default; + IReadOnlyList deploymentsMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentsMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssignedProjectDeploymentMetadata.DeserializeAssignedProjectDeploymentMetadata(item, options)); + } + deploymentsMetadata = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedProjectDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedProjectDeploymentsMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs new file mode 100644 index 000000000000..f7ddb77f5cdb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs @@ -0,0 +1,80 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the metadata for assigned deployments for a project. + public partial class AssignedProjectDeploymentsMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the resource region. + /// is null. + internal AssignedProjectDeploymentsMetadata(IEnumerable deploymentsMetadata) + { + Argument.AssertNotNull(deploymentsMetadata, nameof(deploymentsMetadata)); + + DeploymentsMetadata = deploymentsMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// Keeps track of any properties unknown to the library. + internal AssignedProjectDeploymentsMetadata(string projectName, IReadOnlyList deploymentsMetadata, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + DeploymentsMetadata = deploymentsMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedProjectDeploymentsMetadata() + { + } + + /// Represents the project name. + public string ProjectName { get; } + /// Represents the resource region. + public IReadOnlyList DeploymentsMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CompositionSetting.cs new file mode 100644 index 000000000000..2ee1a6c15cce --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CompositionSetting.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The CompositionSetting. + public readonly partial struct CompositionSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CompositionSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SeparateComponentsValue = "separateComponents"; + private const string CombineComponentsValue = "combineComponents"; + + /// Every component's match or prediction is returned as a separate instance of the entity. + public static CompositionSetting SeparateComponents { get; } = new CompositionSetting(SeparateComponentsValue); + /// When two or more components are found in the text and overlap, the components' spans are merged together into one span combining all of them. + public static CompositionSetting CombineComponents { get; } = new CompositionSetting(CombineComponentsValue); + /// Determines if two values are the same. + public static bool operator ==(CompositionSetting left, CompositionSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CompositionSetting left, CompositionSetting right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CompositionSetting(string value) => new CompositionSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CompositionSetting other && Equals(other); + /// + public bool Equals(CompositionSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs new file mode 100644 index 000000000000..130f76344bd0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ConfusionMatrix : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{format}' format."); + } + + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + ConfusionMatrix IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrix(document.RootElement, options); + } + + internal static ConfusionMatrix DeserializeConfusionMatrix(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ConfusionMatrix(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrix IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrix(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrix FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrix(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.cs new file mode 100644 index 000000000000..004bbed08c3c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrix.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The ConfusionMatrix. + public partial class ConfusionMatrix + { + /// Initializes a new instance of . + internal ConfusionMatrix() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal ConfusionMatrix(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs new file mode 100644 index 000000000000..8b4459453a7b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("normalizedValue"u8); + writer.WriteNumberValue(NormalizedValue); + writer.WritePropertyName("rawValue"u8); + writer.WriteNumberValue(RawValue); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrixCell(document.RootElement, options); + } + + internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float normalizedValue = default; + float rawValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("normalizedValue"u8)) + { + normalizedValue = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("rawValue"u8)) + { + rawValue = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrixCell(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrixCell FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrixCell(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.cs new file mode 100644 index 000000000000..b75dec32f7eb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixCell.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a cell in a confusion matrix. + public partial class ConfusionMatrixCell + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + internal ConfusionMatrixCell(float normalizedValue, float rawValue) + { + NormalizedValue = normalizedValue; + RawValue = rawValue; + } + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + /// Keeps track of any properties unknown to the library. + internal ConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) + { + NormalizedValue = normalizedValue; + RawValue = rawValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConfusionMatrixCell() + { + } + + /// Represents normalized value in percentages. + public float NormalizedValue { get; } + /// Represents raw value. + public float RawValue { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs new file mode 100644 index 000000000000..eb422157be56 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{format}' format."); + } + + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + ConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrixRow(document.RootElement, options); + } + + internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ConfusionMatrixRow(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrixRow(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrixRow FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrixRow(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.cs new file mode 100644 index 000000000000..248f7077a849 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ConfusionMatrixRow.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The ConfusionMatrixRow. + public partial class ConfusionMatrixRow + { + /// Initializes a new instance of . + internal ConfusionMatrixRow() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal ConfusionMatrixRow(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs new file mode 100644 index 000000000000..f258f2a8eedf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + internal partial class CopyProjectAuthorizationRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + if (Optional.IsDefined(AllowOverwrite)) + { + writer.WritePropertyName("allowOverwrite"u8); + writer.WriteBooleanValue(AllowOverwrite.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyProjectAuthorizationRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement, options); + } + + internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizationRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string storageInputContainerName = default; + bool? allowOverwrite = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowOverwrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowOverwrite = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectAuthorizationRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectAuthorizationRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs new file mode 100644 index 000000000000..5082f591b1ea --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectAuthorizationRequest.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The CopyProjectAuthorizationRequest. + internal partial class CopyProjectAuthorizationRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + internal CopyProjectAuthorizationRequest(ProjectKind projectKind) + { + ProjectKind = projectKind; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// Keeps track of any properties unknown to the library. + internal CopyProjectAuthorizationRequest(ProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + AllowOverwrite = allowOverwrite; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectAuthorizationRequest() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The name of the storage container. + public string StorageInputContainerName { get; } + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + public bool? AllowOverwrite { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs new file mode 100644 index 000000000000..699a616472f5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CopyProjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("targetProjectName"u8); + writer.WriteStringValue(TargetProjectName); + writer.WritePropertyName("accessToken"u8); + writer.WriteStringValue(AccessToken); + writer.WritePropertyName("expiresAt"u8); + writer.WriteStringValue(ExpiresAt, "O"); + writer.WritePropertyName("targetResourceId"u8); + writer.WriteStringValue(TargetResourceId); + writer.WritePropertyName("targetResourceRegion"u8); + writer.WriteStringValue(TargetResourceRegion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectDetails(document.RootElement, options); + } + + internal static CopyProjectDetails DeserializeCopyProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string targetProjectName = default; + string accessToken = default; + DateTimeOffset expiresAt = default; + string targetResourceId = default; + string targetResourceRegion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetProjectName"u8)) + { + targetProjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessToken"u8)) + { + accessToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiresAt"u8)) + { + expiresAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("targetResourceId"u8)) + { + targetResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceRegion"u8)) + { + targetResourceRegion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectDetails( + projectKind, + targetProjectName, + accessToken, + expiresAt, + targetResourceId, + targetResourceRegion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.cs new file mode 100644 index 000000000000..899d7879a650 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectDetails.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options for copying an existing project to another Azure resource. + public partial class CopyProjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project name to be copied-into. + /// The access token. + /// The expiration of the access token. + /// Represents the target Azure resource ID. + /// Represents the target Azure resource region. + /// , , or is null. + public CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) + { + Argument.AssertNotNull(targetProjectName, nameof(targetProjectName)); + Argument.AssertNotNull(accessToken, nameof(accessToken)); + Argument.AssertNotNull(targetResourceId, nameof(targetResourceId)); + Argument.AssertNotNull(targetResourceRegion, nameof(targetResourceRegion)); + + ProjectKind = projectKind; + TargetProjectName = targetProjectName; + AccessToken = accessToken; + ExpiresAt = expiresAt; + TargetResourceId = targetResourceId; + TargetResourceRegion = targetResourceRegion; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project name to be copied-into. + /// The access token. + /// The expiration of the access token. + /// Represents the target Azure resource ID. + /// Represents the target Azure resource region. + /// Keeps track of any properties unknown to the library. + internal CopyProjectDetails(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + TargetProjectName = targetProjectName; + AccessToken = accessToken; + ExpiresAt = expiresAt; + TargetResourceId = targetResourceId; + TargetResourceRegion = targetResourceRegion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectDetails() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; set; } + /// The project name to be copied-into. + public string TargetProjectName { get; set; } + /// The access token. + public string AccessToken { get; set; } + /// The expiration of the access token. + public DateTimeOffset ExpiresAt { get; set; } + /// Represents the target Azure resource ID. + public string TargetResourceId { get; set; } + /// Represents the target Azure resource region. + public string TargetResourceRegion { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs new file mode 100644 index 000000000000..f920a14de3e7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CopyProjectJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectJobState(document.RootElement, options); + } + + internal static CopyProjectJobState DeserializeCopyProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.cs new file mode 100644 index 000000000000..7c7212e10068 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CopyProjectJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a copy job. + public partial class CopyProjectJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal CopyProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal CopyProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs new file mode 100644 index 000000000000..a432f8ae24e3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CreateDeploymentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("trainedModelLabel"u8); + writer.WriteStringValue(TrainedModelLabel); + if (Optional.IsCollectionDefined(AssignedResourceIds)) + { + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateDeploymentDetails(document.RootElement, options); + } + + internal static CreateDeploymentDetails DeserializeCreateDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainedModelLabel = default; + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainedModelLabel"u8)) + { + trainedModelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support writing '{options.Format}' format."); + } + } + + CreateDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateDeploymentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateDeploymentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateDeploymentDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateDeploymentDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.cs new file mode 100644 index 000000000000..31478d43ba9a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateDeploymentDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options for creating or updating a project deployment. + public partial class CreateDeploymentDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the trained model label. + /// is null. + public CreateDeploymentDetails(string trainedModelLabel) + { + Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); + + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the trained model label. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// Keeps track of any properties unknown to the library. + internal CreateDeploymentDetails(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateDeploymentDetails() + { + } + + /// Represents the trained model label. + public string TrainedModelLabel { get; } + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs new file mode 100644 index 000000000000..06633dd50ab3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CreateProjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CreateProjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateProjectDetails(document.RootElement, options); + } + + internal static CreateProjectDetails DeserializeCreateProjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string storageInputContainerName = default; + ProjectSettings settings = default; + string projectName = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateProjectDetails( + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support writing '{options.Format}' format."); + } + } + + CreateProjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateProjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateProjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateProjectDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateProjectDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.cs new file mode 100644 index 000000000000..4a9996f0b77c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CreateProjectDetails.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options used to create or update a project. + public partial class CreateProjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The new project name. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// , or is null. + public CreateProjectDetails(ProjectKind projectKind, string storageInputContainerName, string projectName, string language) + { + Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal CreateProjectDetails(ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Settings = settings; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateProjectDetails() + { + } + + /// The project kind. + public ProjectKind ProjectKind { get; } + /// The storage container name. + public string StorageInputContainerName { get; } + /// The project settings. + public ProjectSettings Settings { get; set; } + /// The new project name. + public string ProjectName { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; set; } + /// The project description. + public string Description { get; set; } + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..c44a091cde5e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomEntityRecognitionDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customEntityRecognitionResult"u8); + writer.WriteObjectValue(CustomEntityRecognitionResult, options); + } + + CustomEntityRecognitionDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntityRecognitionDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomEntityRecognitionDocumentEvaluationResult DeserializeCustomEntityRecognitionDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customEntityRecognitionResult"u8)) + { + customEntityRecognitionResult = DocumentEntityRecognitionEvaluationResult.DeserializeDocumentEntityRecognitionEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntityRecognitionDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customEntityRecognitionResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomEntityRecognitionDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomEntityRecognitionDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomEntityRecognitionDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomEntityRecognitionDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs new file mode 100644 index 000000000000..21e1cc79ba6f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the document evaluation result for a custom entity recognition project. + public partial class CustomEntityRecognitionDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for entity recognition. + /// , or is null. + internal CustomEntityRecognitionDocumentEvaluationResult(string location, string language, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customEntityRecognitionResult, nameof(customEntityRecognitionResult)); + + ProjectKind = ProjectKind.CustomEntityRecognition; + CustomEntityRecognitionResult = customEntityRecognitionResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for entity recognition. + internal CustomEntityRecognitionDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomEntityRecognitionResult = customEntityRecognitionResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntityRecognitionDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for entity recognition. + public DocumentEntityRecognitionEvaluationResult CustomEntityRecognitionResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..02086fc20371 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomEntityRecognitionEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customEntityRecognitionEvaluation"u8); + writer.WriteObjectValue(CustomEntityRecognitionEvaluation, options); + } + + CustomEntityRecognitionEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntityRecognitionEvaluationSummary(document.RootElement, options); + } + + internal static CustomEntityRecognitionEvaluationSummary DeserializeCustomEntityRecognitionEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = default; + ProjectKind projectKind = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customEntityRecognitionEvaluation"u8)) + { + customEntityRecognitionEvaluation = EntityRecognitionEvaluationSummary.DeserializeEntityRecognitionEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntityRecognitionEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customEntityRecognitionEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomEntityRecognitionEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomEntityRecognitionEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomEntityRecognitionEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomEntityRecognitionEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs new file mode 100644 index 000000000000..af1ea805f081 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom entity recognition project. + public partial class CustomEntityRecognitionEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to extraction evaluation. + /// or is null. + internal CustomEntityRecognitionEvaluationSummary(EvaluationDetails evaluationOptions, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customEntityRecognitionEvaluation, nameof(customEntityRecognitionEvaluation)); + + ProjectKind = ProjectKind.CustomEntityRecognition; + CustomEntityRecognitionEvaluation = customEntityRecognitionEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to extraction evaluation. + internal CustomEntityRecognitionEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomEntityRecognitionEvaluation = customEntityRecognitionEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntityRecognitionEvaluationSummary() + { + } + + /// Contains the data related to extraction evaluation. + public EntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..726a1d144e16 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomHealthcareDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customHealthcareResult"u8); + writer.WriteObjectValue(CustomHealthcareResult, options); + } + + CustomHealthcareDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomHealthcareDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomHealthcareDocumentEvaluationResult DeserializeCustomHealthcareDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentHealthcareEvaluationResult customHealthcareResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customHealthcareResult"u8)) + { + customHealthcareResult = DocumentHealthcareEvaluationResult.DeserializeDocumentHealthcareEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomHealthcareDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customHealthcareResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomHealthcareDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomHealthcareDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomHealthcareDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomHealthcareDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs new file mode 100644 index 000000000000..f89d84726837 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the document evaluation result for a custom entity recognition project. + public partial class CustomHealthcareDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for entity recognition. + /// , or is null. + internal CustomHealthcareDocumentEvaluationResult(string location, string language, DocumentHealthcareEvaluationResult customHealthcareResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customHealthcareResult, nameof(customHealthcareResult)); + + ProjectKind = ProjectKind.CustomHealthcare; + CustomHealthcareResult = customHealthcareResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for entity recognition. + internal CustomHealthcareDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentHealthcareEvaluationResult customHealthcareResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomHealthcareResult = customHealthcareResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomHealthcareDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for entity recognition. + public DocumentHealthcareEvaluationResult CustomHealthcareResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..02df1aaacae0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomHealthcareEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customHealthcareEvaluation"u8); + writer.WriteObjectValue(CustomHealthcareEvaluation, options); + } + + CustomHealthcareEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomHealthcareEvaluationSummary(document.RootElement, options); + } + + internal static CustomHealthcareEvaluationSummary DeserializeCustomHealthcareEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntityRecognitionEvaluationSummary customHealthcareEvaluation = default; + ProjectKind projectKind = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customHealthcareEvaluation"u8)) + { + customHealthcareEvaluation = EntityRecognitionEvaluationSummary.DeserializeEntityRecognitionEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomHealthcareEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customHealthcareEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomHealthcareEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomHealthcareEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomHealthcareEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomHealthcareEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs new file mode 100644 index 000000000000..b42fd9a30698 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomHealthcareEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom health care project. + public partial class CustomHealthcareEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to health care evaluation. + /// or is null. + internal CustomHealthcareEvaluationSummary(EvaluationDetails evaluationOptions, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customHealthcareEvaluation, nameof(customHealthcareEvaluation)); + + ProjectKind = ProjectKind.CustomHealthcare; + CustomHealthcareEvaluation = customHealthcareEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to health care evaluation. + internal CustomHealthcareEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomHealthcareEvaluation = customHealthcareEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomHealthcareEvaluationSummary() + { + } + + /// Contains the data related to health care evaluation. + public EntityRecognitionEvaluationSummary CustomHealthcareEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..242c6b8fb74c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customMultiLabelClassificationResult"u8); + writer.WriteObjectValue(CustomMultiLabelClassificationResult, options); + } + + CustomMultiLabelClassificationDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomMultiLabelClassificationDocumentEvaluationResult DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customMultiLabelClassificationResult"u8)) + { + customMultiLabelClassificationResult = DocumentMultiLabelClassificationEvaluationResult.DeserializeDocumentMultiLabelClassificationEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomMultiLabelClassificationDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customMultiLabelClassificationResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomMultiLabelClassificationDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomMultiLabelClassificationDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs new file mode 100644 index 000000000000..b313a7e7bf08 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the document evaluation result for a custom multi-label classification project. + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for multi label classification. + /// , or is null. + internal CustomMultiLabelClassificationDocumentEvaluationResult(string location, string language, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customMultiLabelClassificationResult, nameof(customMultiLabelClassificationResult)); + + ProjectKind = ProjectKind.CustomMultiLabelClassification; + CustomMultiLabelClassificationResult = customMultiLabelClassificationResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for multi label classification. + internal CustomMultiLabelClassificationDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomMultiLabelClassificationResult = customMultiLabelClassificationResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomMultiLabelClassificationDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for multi label classification. + public DocumentMultiLabelClassificationEvaluationResult CustomMultiLabelClassificationResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..95bcd9182059 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomMultiLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customMultiLabelClassificationEvaluation"u8); + writer.WriteObjectValue(CustomMultiLabelClassificationEvaluation, options); + } + + CustomMultiLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static CustomMultiLabelClassificationEvaluationSummary DeserializeCustomMultiLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = default; + ProjectKind projectKind = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customMultiLabelClassificationEvaluation"u8)) + { + customMultiLabelClassificationEvaluation = MultiLabelClassificationEvaluationSummary.DeserializeMultiLabelClassificationEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomMultiLabelClassificationEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customMultiLabelClassificationEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomMultiLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomMultiLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomMultiLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..89dfb90ee5bb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom multi-label classification project. + public partial class CustomMultiLabelClassificationEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to multi label classification evaluation. + /// or is null. + internal CustomMultiLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customMultiLabelClassificationEvaluation, nameof(customMultiLabelClassificationEvaluation)); + + ProjectKind = ProjectKind.CustomMultiLabelClassification; + CustomMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to multi label classification evaluation. + internal CustomMultiLabelClassificationEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomMultiLabelClassificationEvaluationSummary() + { + } + + /// Contains the data related to multi label classification evaluation. + public MultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..57861eb5a1b5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customSingleLabelClassificationResult"u8); + writer.WriteObjectValue(CustomSingleLabelClassificationResult, options); + } + + CustomSingleLabelClassificationDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomSingleLabelClassificationDocumentEvaluationResult DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customSingleLabelClassificationResult"u8)) + { + customSingleLabelClassificationResult = DocumentSingleLabelClassificationEvaluationResult.DeserializeDocumentSingleLabelClassificationEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomSingleLabelClassificationDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customSingleLabelClassificationResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomSingleLabelClassificationDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomSingleLabelClassificationDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs new file mode 100644 index 000000000000..5bae1e7e6c4c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the document evaluation result for a custom single-label classification project. + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for single label classification. + /// , or is null. + internal CustomSingleLabelClassificationDocumentEvaluationResult(string location, string language, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customSingleLabelClassificationResult, nameof(customSingleLabelClassificationResult)); + + ProjectKind = ProjectKind.CustomSingleLabelClassification; + CustomSingleLabelClassificationResult = customSingleLabelClassificationResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for single label classification. + internal CustomSingleLabelClassificationDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomSingleLabelClassificationResult = customSingleLabelClassificationResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomSingleLabelClassificationDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for single label classification. + public DocumentSingleLabelClassificationEvaluationResult CustomSingleLabelClassificationResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..06c9c7209461 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomSingleLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customSingleLabelClassificationEvaluation"u8); + writer.WriteObjectValue(CustomSingleLabelClassificationEvaluation, options); + } + + CustomSingleLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static CustomSingleLabelClassificationEvaluationSummary DeserializeCustomSingleLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = default; + ProjectKind projectKind = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customSingleLabelClassificationEvaluation"u8)) + { + customSingleLabelClassificationEvaluation = SingleLabelClassificationEvaluationSummary.DeserializeSingleLabelClassificationEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomSingleLabelClassificationEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customSingleLabelClassificationEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomSingleLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomSingleLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomSingleLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..01cb6675593c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom single-label classification project. + public partial class CustomSingleLabelClassificationEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to single label classification evaluation. + /// or is null. + internal CustomSingleLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customSingleLabelClassificationEvaluation, nameof(customSingleLabelClassificationEvaluation)); + + ProjectKind = ProjectKind.CustomSingleLabelClassification; + CustomSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to single label classification evaluation. + internal CustomSingleLabelClassificationEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomSingleLabelClassificationEvaluationSummary() + { + } + + /// Contains the data related to single label classification evaluation. + public SingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..60121f8ea4a9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomTextSentimentDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customTextSentimentResult"u8); + writer.WriteObjectValue(CustomTextSentimentResult, options); + } + + CustomTextSentimentDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomTextSentimentDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomTextSentimentDocumentEvaluationResult DeserializeCustomTextSentimentDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentTextSentimentEvaluationResult customTextSentimentResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customTextSentimentResult"u8)) + { + customTextSentimentResult = DocumentTextSentimentEvaluationResult.DeserializeDocumentTextSentimentEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomTextSentimentDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customTextSentimentResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomTextSentimentDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomTextSentimentDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomTextSentimentDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomTextSentimentDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs new file mode 100644 index 000000000000..ab07896bc858 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the document evaluation result for a custom sentiment project. + public partial class CustomTextSentimentDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for text sentiment. + /// , or is null. + internal CustomTextSentimentDocumentEvaluationResult(string location, string language, DocumentTextSentimentEvaluationResult customTextSentimentResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customTextSentimentResult, nameof(customTextSentimentResult)); + + ProjectKind = ProjectKind.CustomTextSentiment; + CustomTextSentimentResult = customTextSentimentResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for text sentiment. + internal CustomTextSentimentDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentTextSentimentEvaluationResult customTextSentimentResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomTextSentimentResult = customTextSentimentResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomTextSentimentDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for text sentiment. + public DocumentTextSentimentEvaluationResult CustomTextSentimentResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..4946c6b8b920 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class CustomTextSentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("customTextSentimentEvaluation"u8); + writer.WriteObjectValue(CustomTextSentimentEvaluation, options); + } + + CustomTextSentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomTextSentimentEvaluationSummary(document.RootElement, options); + } + + internal static CustomTextSentimentEvaluationSummary DeserializeCustomTextSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TextSentimentEvaluationSummary customTextSentimentEvaluation = default; + ProjectKind projectKind = default; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customTextSentimentEvaluation"u8)) + { + customTextSentimentEvaluation = TextSentimentEvaluationSummary.DeserializeTextSentimentEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomTextSentimentEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customTextSentimentEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomTextSentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomTextSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomTextSentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomTextSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs new file mode 100644 index 000000000000..8c2df398ef37 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom text sentiment project. + public partial class CustomTextSentimentEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to custom sentiment evaluation. + /// or is null. + internal CustomTextSentimentEvaluationSummary(EvaluationDetails evaluationOptions, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customTextSentimentEvaluation, nameof(customTextSentimentEvaluation)); + + ProjectKind = ProjectKind.CustomTextSentiment; + CustomTextSentimentEvaluation = customTextSentimentEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to custom sentiment evaluation. + internal CustomTextSentimentEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomTextSentimentEvaluation = customTextSentimentEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomTextSentimentEvaluationSummary() + { + } + + /// Contains the data related to custom sentiment evaluation. + public TextSentimentEvaluationSummary CustomTextSentimentEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs new file mode 100644 index 000000000000..4a5bdf19b9c7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DataGenerationConnectionInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataGenerationConnectionInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataGenerationConnectionInfo(document.RootElement, options); + } + + internal static DataGenerationConnectionInfo DeserializeDataGenerationConnectionInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataGenerationConnectionInfoKind kind = default; + string resourceId = default; + string deploymentName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new DataGenerationConnectionInfoKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support writing '{options.Format}' format."); + } + } + + DataGenerationConnectionInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataGenerationConnectionInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataGenerationConnectionInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDataGenerationConnectionInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfo.cs new file mode 100644 index 000000000000..a7dbaf33884a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfo.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + public partial class DataGenerationConnectionInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// or is null. + public DataGenerationConnectionInfo(string resourceId, string deploymentName) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + ResourceId = resourceId; + DeploymentName = deploymentName; + } + + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// Keeps track of any properties unknown to the library. + internal DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind, string resourceId, string deploymentName, IDictionary serializedAdditionalRawData) + { + Kind = kind; + ResourceId = resourceId; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataGenerationConnectionInfo() + { + } + + /// Connection type for data generation settings. Currently only supports Azure Open AI. + public DataGenerationConnectionInfoKind Kind { get; } = DataGenerationConnectionInfoKind.AzureOpenAI; + + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + public string ResourceId { get; } + /// Deployment name of model to be used for synthetic data generation. + public string DeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfoKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfoKind.cs new file mode 100644 index 000000000000..2fc2bf8a9467 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationConnectionInfoKind.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The DataGenerationConnectionInfo_kind. + public readonly partial struct DataGenerationConnectionInfoKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataGenerationConnectionInfoKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "azureOpenAI"; + + /// azureOpenAI. + public static DataGenerationConnectionInfoKind AzureOpenAI { get; } = new DataGenerationConnectionInfoKind(AzureOpenAIValue); + /// Determines if two values are the same. + public static bool operator ==(DataGenerationConnectionInfoKind left, DataGenerationConnectionInfoKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataGenerationConnectionInfoKind left, DataGenerationConnectionInfoKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataGenerationConnectionInfoKind(string value) => new DataGenerationConnectionInfoKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataGenerationConnectionInfoKind other && Equals(other); + /// + public bool Equals(DataGenerationConnectionInfoKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.Serialization.cs new file mode 100644 index 000000000000..02b4ca7c8475 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DataGenerationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("enableDataGeneration"u8); + writer.WriteBooleanValue(EnableDataGeneration); + writer.WritePropertyName("dataGenerationConnectionInfo"u8); + writer.WriteObjectValue(DataGenerationConnectionInfo, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataGenerationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataGenerationSettings(document.RootElement, options); + } + + internal static DataGenerationSettings DeserializeDataGenerationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enableDataGeneration = default; + DataGenerationConnectionInfo dataGenerationConnectionInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableDataGeneration"u8)) + { + enableDataGeneration = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dataGenerationConnectionInfo"u8)) + { + dataGenerationConnectionInfo = DataGenerationConnectionInfo.DeserializeDataGenerationConnectionInfo(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataGenerationSettings(enableDataGeneration, dataGenerationConnectionInfo, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataGenerationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataGenerationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataGenerationSettings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDataGenerationSettings(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.cs new file mode 100644 index 000000000000..ec47c688c67e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DataGenerationSettings.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the settings for using data generation as part of training a custom model. + public partial class DataGenerationSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// If set to true, augment customer provided training data with synthetic data to improve model quality. + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + /// is null. + public DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo) + { + Argument.AssertNotNull(dataGenerationConnectionInfo, nameof(dataGenerationConnectionInfo)); + + EnableDataGeneration = enableDataGeneration; + DataGenerationConnectionInfo = dataGenerationConnectionInfo; + } + + /// Initializes a new instance of . + /// If set to true, augment customer provided training data with synthetic data to improve model quality. + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + /// Keeps track of any properties unknown to the library. + internal DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo, IDictionary serializedAdditionalRawData) + { + EnableDataGeneration = enableDataGeneration; + DataGenerationConnectionInfo = dataGenerationConnectionInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataGenerationSettings() + { + } + + /// If set to true, augment customer provided training data with synthetic data to improve model quality. + public bool EnableDataGeneration { get; } + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + public DataGenerationConnectionInfo DataGenerationConnectionInfo { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs new file mode 100644 index 000000000000..77445449cbf0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DeleteDeploymentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AssignedResourceIds)) + { + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeleteDeploymentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeleteDeploymentDetails(document.RootElement, options); + } + + internal static DeleteDeploymentDetails DeserializeDeleteDeploymentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeleteDeploymentDetails(assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support writing '{options.Format}' format."); + } + } + + DeleteDeploymentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeleteDeploymentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeleteDeploymentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeleteDeploymentDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeleteDeploymentDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs new file mode 100644 index 000000000000..013bd28896db --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeleteDeploymentDetails.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options for deleting a project deployment. + public partial class DeleteDeploymentDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeleteDeploymentDetails() + { + AssignedResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the resource IDs to delete the deployment from. If not provided, the deployment will be rolled out from all the resources it is deployed to. If provided, it will delete the deployment only from the specified assigned resources, and leave it for the rest. + /// Keeps track of any properties unknown to the library. + internal DeleteDeploymentDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the resource IDs to delete the deployment from. If not provided, the deployment will be rolled out from all the resources it is deployed to. If provided, it will delete the deployment only from the specified assigned resources, and leave it for the rest. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs new file mode 100644 index 000000000000..e10e17952121 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DeploymentDeleteFromResourcesJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentDeleteFromResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + } + + internal static DeploymentDeleteFromResourcesJobState DeserializeDeploymentDeleteFromResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentDeleteFromResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support writing '{options.Format}' format."); + } + } + + DeploymentDeleteFromResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentDeleteFromResourcesJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentDeleteFromResourcesJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentDeleteFromResourcesJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs new file mode 100644 index 000000000000..6a8b7545d2f6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentDeleteFromResourcesJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of an existing delete deployment from specific resources job. + public partial class DeploymentDeleteFromResourcesJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal DeploymentDeleteFromResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal DeploymentDeleteFromResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentDeleteFromResourcesJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs new file mode 100644 index 000000000000..abc14808d6d1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DeploymentJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentJobState(document.RootElement, options); + } + + internal static DeploymentJobState DeserializeDeploymentJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support writing '{options.Format}' format."); + } + } + + DeploymentJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.cs new file mode 100644 index 000000000000..f888f341cfa1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a deployment job. + public partial class DeploymentJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal DeploymentJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal DeploymentJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs new file mode 100644 index 000000000000..326ec2ad2885 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DeploymentResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentResource(document.RootElement, options); + } + + internal static DeploymentResource DeserializeDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceId = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentResource(resourceId, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{options.Format}' format."); + } + } + + DeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.cs new file mode 100644 index 000000000000..1f71c697bb26 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DeploymentResource.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an Azure resource assigned to a deployment. + public partial class DeploymentResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// or is null. + internal DeploymentResource(string resourceId, string region) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + Argument.AssertNotNull(region, nameof(region)); + + ResourceId = resourceId; + Region = region; + } + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// Keeps track of any properties unknown to the library. + internal DeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentResource() + { + } + + /// Represents the Azure resource Id. + public string ResourceId { get; } + /// Represents the resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..13631a460ef0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentEntityLabelEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentEntityLabelEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEntityLabelEvaluationResult(document.RootElement, options); + } + + internal static DocumentEntityLabelEvaluationResult DeserializeDocumentEntityLabelEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + int offset = default; + int length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentEntityLabelEvaluationResult(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEntityLabelEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEntityLabelEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEntityLabelEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEntityLabelEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs new file mode 100644 index 000000000000..9845875ce00c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an evaluation result entity label. + public partial class DocumentEntityLabelEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// is null. + internal DocumentEntityLabelEvaluationResult(string category, int offset, int length) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// Keeps track of any properties unknown to the library. + internal DocumentEntityLabelEvaluationResult(string category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEntityLabelEvaluationResult() + { + } + + /// Represents the entity category. + public string Category { get; } + /// Represents the entity offset index relative to the original text. + public int Offset { get; } + /// Represents the entity length. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..9aff1eb0d6b0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentEntityRecognitionEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentEntityRecognitionEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement, options); + } + + internal static DocumentEntityRecognitionEvaluationResult DeserializeDocumentEntityRecognitionEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList entities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityRegionEvaluationResult.DeserializeDocumentEntityRegionEvaluationResult(item, options)); + } + entities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentEntityRecognitionEvaluationResult(entities, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEntityRecognitionEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEntityRecognitionEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs new file mode 100644 index 000000000000..8a2ca5336833 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs @@ -0,0 +1,76 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the entity recognition evaluation result for a document. + public partial class DocumentEntityRecognitionEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// is null. + internal DocumentEntityRecognitionEvaluationResult(IEnumerable entities) + { + Argument.AssertNotNull(entities, nameof(entities)); + + Entities = entities.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// Keeps track of any properties unknown to the library. + internal DocumentEntityRecognitionEvaluationResult(IReadOnlyList entities, IDictionary serializedAdditionalRawData) + { + Entities = entities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEntityRecognitionEvaluationResult() + { + } + + /// Represents the document labelled entities. + public IReadOnlyList Entities { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..6102fe7633be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentEntityRegionEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("expectedEntities"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedEntities"u8); + writer.WriteStartArray(); + foreach (var item in PredictedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("regionOffset"u8); + writer.WriteNumberValue(RegionOffset); + writer.WritePropertyName("regionLength"u8); + writer.WriteNumberValue(RegionLength); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentEntityRegionEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEntityRegionEvaluationResult(document.RootElement, options); + } + + internal static DocumentEntityRegionEvaluationResult DeserializeDocumentEntityRegionEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedEntities = default; + IReadOnlyList predictedEntities = default; + int regionOffset = default; + int regionLength = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityLabelEvaluationResult.DeserializeDocumentEntityLabelEvaluationResult(item, options)); + } + expectedEntities = array; + continue; + } + if (property.NameEquals("predictedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityLabelEvaluationResult.DeserializeDocumentEntityLabelEvaluationResult(item, options)); + } + predictedEntities = array; + continue; + } + if (property.NameEquals("regionOffset"u8)) + { + regionOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("regionLength"u8)) + { + regionLength = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentEntityRegionEvaluationResult(expectedEntities, predictedEntities, regionOffset, regionLength, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEntityRegionEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEntityRegionEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEntityRegionEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEntityRegionEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs new file mode 100644 index 000000000000..f961a2eb7ba7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs @@ -0,0 +1,95 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the evaluation comparison between the expected and predicted entities of a document region. + public partial class DocumentEntityRegionEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the region's expected entity labels. + /// Represents the region's predicted entity labels. + /// Represents the region offset. + /// Represents the region length. + /// or is null. + internal DocumentEntityRegionEvaluationResult(IEnumerable expectedEntities, IEnumerable predictedEntities, int regionOffset, int regionLength) + { + Argument.AssertNotNull(expectedEntities, nameof(expectedEntities)); + Argument.AssertNotNull(predictedEntities, nameof(predictedEntities)); + + ExpectedEntities = expectedEntities.ToList(); + PredictedEntities = predictedEntities.ToList(); + RegionOffset = regionOffset; + RegionLength = regionLength; + } + + /// Initializes a new instance of . + /// Represents the region's expected entity labels. + /// Represents the region's predicted entity labels. + /// Represents the region offset. + /// Represents the region length. + /// Keeps track of any properties unknown to the library. + internal DocumentEntityRegionEvaluationResult(IReadOnlyList expectedEntities, IReadOnlyList predictedEntities, int regionOffset, int regionLength, IDictionary serializedAdditionalRawData) + { + ExpectedEntities = expectedEntities; + PredictedEntities = predictedEntities; + RegionOffset = regionOffset; + RegionLength = regionLength; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEntityRegionEvaluationResult() + { + } + + /// Represents the region's expected entity labels. + public IReadOnlyList ExpectedEntities { get; } + /// Represents the region's predicted entity labels. + public IReadOnlyList PredictedEntities { get; } + /// Represents the region offset. + public int RegionOffset { get; } + /// Represents the region length. + public int RegionLength { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..be013318e43f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + [PersistableModelProxy(typeof(UnknownDocumentEvaluationResult))] + public partial class DocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + + internal static DocumentEvaluationResult DeserializeDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CustomEntityRecognition": return CustomEntityRecognitionDocumentEvaluationResult.DeserializeCustomEntityRecognitionDocumentEvaluationResult(element, options); + case "CustomHealthcare": return CustomHealthcareDocumentEvaluationResult.DeserializeCustomHealthcareDocumentEvaluationResult(element, options); + case "CustomMultiLabelClassification": return CustomMultiLabelClassificationDocumentEvaluationResult.DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(element, options); + case "CustomSingleLabelClassification": return CustomSingleLabelClassificationDocumentEvaluationResult.DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(element, options); + case "CustomTextSentiment": return CustomTextSentimentDocumentEvaluationResult.DeserializeCustomTextSentimentDocumentEvaluationResult(element, options); + } + } + return UnknownDocumentEvaluationResult.DeserializeUnknownDocumentEvaluationResult(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.cs new file mode 100644 index 000000000000..1eb6a64b3511 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentEvaluationResult.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// + /// Represents the evaluation result of a document. + /// 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 DocumentEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// or is null. + protected DocumentEvaluationResult(string location, string language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + + Location = location; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal DocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + Location = location; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEvaluationResult() + { + } + + /// Represents the project kind. + internal ProjectKind ProjectKind { get; set; } + /// Represents the document path. + public string Location { get; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..5e07d6d93ee0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentHealthcareEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentHealthcareEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentHealthcareEvaluationResult(document.RootElement, options); + } + + internal static DocumentHealthcareEvaluationResult DeserializeDocumentHealthcareEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList entities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityRegionEvaluationResult.DeserializeDocumentEntityRegionEvaluationResult(item, options)); + } + entities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentHealthcareEvaluationResult(entities, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentHealthcareEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentHealthcareEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentHealthcareEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentHealthcareEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentHealthcareEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentHealthcareEvaluationResult.cs new file mode 100644 index 000000000000..abb12a64155d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentHealthcareEvaluationResult.cs @@ -0,0 +1,76 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the healthcare evaluation result for a document. + public partial class DocumentHealthcareEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// is null. + internal DocumentHealthcareEvaluationResult(IEnumerable entities) + { + Argument.AssertNotNull(entities, nameof(entities)); + + Entities = entities.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// Keeps track of any properties unknown to the library. + internal DocumentHealthcareEvaluationResult(IReadOnlyList entities, IDictionary serializedAdditionalRawData) + { + Entities = entities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentHealthcareEvaluationResult() + { + } + + /// Represents the document labelled entities. + public IReadOnlyList Entities { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..75e31cc7c7fe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentMultiLabelClassificationEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("expectedClasses"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedClasses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedClasses"u8); + writer.WriteStartArray(); + foreach (var item in PredictedClasses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentMultiLabelClassificationEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentMultiLabelClassificationEvaluationResult(document.RootElement, options); + } + + internal static DocumentMultiLabelClassificationEvaluationResult DeserializeDocumentMultiLabelClassificationEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedClasses = default; + IReadOnlyList predictedClasses = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedClasses"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + expectedClasses = array; + continue; + } + if (property.NameEquals("predictedClasses"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + predictedClasses = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentMultiLabelClassificationEvaluationResult(expectedClasses, predictedClasses, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentMultiLabelClassificationEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentMultiLabelClassificationEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentMultiLabelClassificationEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentMultiLabelClassificationEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs new file mode 100644 index 000000000000..0b5e696def25 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs @@ -0,0 +1,83 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the comparison between the expected and predicted classes that are result from the evaluation operation. + public partial class DocumentMultiLabelClassificationEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document's expected classes. + /// Represents the document's predicted classes. + /// or is null. + internal DocumentMultiLabelClassificationEvaluationResult(IEnumerable expectedClasses, IEnumerable predictedClasses) + { + Argument.AssertNotNull(expectedClasses, nameof(expectedClasses)); + Argument.AssertNotNull(predictedClasses, nameof(predictedClasses)); + + ExpectedClasses = expectedClasses.ToList(); + PredictedClasses = predictedClasses.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document's expected classes. + /// Represents the document's predicted classes. + /// Keeps track of any properties unknown to the library. + internal DocumentMultiLabelClassificationEvaluationResult(IReadOnlyList expectedClasses, IReadOnlyList predictedClasses, IDictionary serializedAdditionalRawData) + { + ExpectedClasses = expectedClasses; + PredictedClasses = predictedClasses; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentMultiLabelClassificationEvaluationResult() + { + } + + /// Represents the document's expected classes. + public IReadOnlyList ExpectedClasses { get; } + /// Represents the document's predicted classes. + public IReadOnlyList PredictedClasses { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..6331cb3ab415 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentSentimentLabelEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.ToString()); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentSentimentLabelEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentSentimentLabelEvaluationResult(document.RootElement, options); + } + + internal static DocumentSentimentLabelEvaluationResult DeserializeDocumentSentimentLabelEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TextAnalysisAuthoringSentiment category = default; + int offset = default; + int length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = new TextAnalysisAuthoringSentiment(property.Value.GetString()); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentSentimentLabelEvaluationResult(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentSentimentLabelEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentSentimentLabelEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentSentimentLabelEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentSentimentLabelEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs new file mode 100644 index 000000000000..ca2ed6833c38 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an evaluation result Sentiment label. + public partial class DocumentSentimentLabelEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the sentiment category. + /// Represents the sentiment offset index relative to the original text. + /// Represents the sentiment length. + internal DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment category, int offset, int length) + { + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// Represents the sentiment category. + /// Represents the sentiment offset index relative to the original text. + /// Represents the sentiment length. + /// Keeps track of any properties unknown to the library. + internal DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentSentimentLabelEvaluationResult() + { + } + + /// Represents the sentiment category. + public TextAnalysisAuthoringSentiment Category { get; } + /// Represents the sentiment offset index relative to the original text. + public int Offset { get; } + /// Represents the sentiment length. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..3b5eb266d588 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentSingleLabelClassificationEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("expectedClass"u8); + writer.WriteStringValue(ExpectedClass); + writer.WritePropertyName("predictedClass"u8); + writer.WriteStringValue(PredictedClass); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentSingleLabelClassificationEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentSingleLabelClassificationEvaluationResult(document.RootElement, options); + } + + internal static DocumentSingleLabelClassificationEvaluationResult DeserializeDocumentSingleLabelClassificationEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string expectedClass = default; + string predictedClass = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedClass"u8)) + { + expectedClass = property.Value.GetString(); + continue; + } + if (property.NameEquals("predictedClass"u8)) + { + predictedClass = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentSingleLabelClassificationEvaluationResult(expectedClass, predictedClass, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentSingleLabelClassificationEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentSingleLabelClassificationEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentSingleLabelClassificationEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentSingleLabelClassificationEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs new file mode 100644 index 000000000000..c9e158bbc731 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the comparison between the expected and predicted class that result from an evaluation operation. + public partial class DocumentSingleLabelClassificationEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document's expected class. + /// Represents the document's predicted class. + /// or is null. + internal DocumentSingleLabelClassificationEvaluationResult(string expectedClass, string predictedClass) + { + Argument.AssertNotNull(expectedClass, nameof(expectedClass)); + Argument.AssertNotNull(predictedClass, nameof(predictedClass)); + + ExpectedClass = expectedClass; + PredictedClass = predictedClass; + } + + /// Initializes a new instance of . + /// Represents the document's expected class. + /// Represents the document's predicted class. + /// Keeps track of any properties unknown to the library. + internal DocumentSingleLabelClassificationEvaluationResult(string expectedClass, string predictedClass, IDictionary serializedAdditionalRawData) + { + ExpectedClass = expectedClass; + PredictedClass = predictedClass; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentSingleLabelClassificationEvaluationResult() + { + } + + /// Represents the document's expected class. + public string ExpectedClass { get; } + /// Represents the document's predicted class. + public string PredictedClass { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..2c2a0bff2696 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class DocumentTextSentimentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("expectedSentimentSpans"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedSentimentSpans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedSentimentSpans"u8); + writer.WriteStartArray(); + foreach (var item in PredictedSentimentSpans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentTextSentimentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentTextSentimentEvaluationResult(document.RootElement, options); + } + + internal static DocumentTextSentimentEvaluationResult DeserializeDocumentTextSentimentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedSentimentSpans = default; + IReadOnlyList predictedSentimentSpans = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedSentimentSpans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentSentimentLabelEvaluationResult.DeserializeDocumentSentimentLabelEvaluationResult(item, options)); + } + expectedSentimentSpans = array; + continue; + } + if (property.NameEquals("predictedSentimentSpans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentSentimentLabelEvaluationResult.DeserializeDocumentSentimentLabelEvaluationResult(item, options)); + } + predictedSentimentSpans = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentTextSentimentEvaluationResult(expectedSentimentSpans, predictedSentimentSpans, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentTextSentimentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentTextSentimentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentTextSentimentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentTextSentimentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs new file mode 100644 index 000000000000..3e547f73170e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs @@ -0,0 +1,83 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the comparison between the expected and predicted sentiment that result from an evaluation operation. + public partial class DocumentTextSentimentEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document's expected sentiment labels. + /// Represents the document's predicted sentiment labels. + /// or is null. + internal DocumentTextSentimentEvaluationResult(IEnumerable expectedSentimentSpans, IEnumerable predictedSentimentSpans) + { + Argument.AssertNotNull(expectedSentimentSpans, nameof(expectedSentimentSpans)); + Argument.AssertNotNull(predictedSentimentSpans, nameof(predictedSentimentSpans)); + + ExpectedSentimentSpans = expectedSentimentSpans.ToList(); + PredictedSentimentSpans = predictedSentimentSpans.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document's expected sentiment labels. + /// Represents the document's predicted sentiment labels. + /// Keeps track of any properties unknown to the library. + internal DocumentTextSentimentEvaluationResult(IReadOnlyList expectedSentimentSpans, IReadOnlyList predictedSentimentSpans, IDictionary serializedAdditionalRawData) + { + ExpectedSentimentSpans = expectedSentimentSpans; + PredictedSentimentSpans = predictedSentimentSpans; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentTextSentimentEvaluationResult() + { + } + + /// Represents the document's expected sentiment labels. + public IReadOnlyList ExpectedSentimentSpans { get; } + /// Represents the document's predicted sentiment labels. + public IReadOnlyList PredictedSentimentSpans { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..5826c81af6f9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class EntityEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EntityEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityEvaluationSummary(document.RootElement, options); + } + + internal static EntityEvaluationSummary DeserializeEntityEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntityEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EntityEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntityEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.cs new file mode 100644 index 000000000000..9cdb7004ae61 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for an entity. + public partial class EntityEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntityEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..6ba8e6fbc90d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class EntityRecognitionEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("entities"u8); + writer.WriteStartObject(); + foreach (var item in Entities) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EntityRecognitionEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityRecognitionEvaluationSummary(document.RootElement, options); + } + + internal static EntityRecognitionEvaluationSummary DeserializeEntityRecognitionEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary entities = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("entities"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, EntityEvaluationSummary.DeserializeEntityEvaluationSummary(property0.Value, options)); + } + entities = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityRecognitionEvaluationSummary( + confusionMatrix, + entities, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntityRecognitionEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityRecognitionEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EntityRecognitionEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntityRecognitionEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs new file mode 100644 index 000000000000..d397bd5cbc09 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EntityRecognitionEvaluationSummary.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom entity recognition project. + public partial class EntityRecognitionEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + /// Represents the entities evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// or is null. + internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(entities, nameof(entities)); + + ConfusionMatrix = confusionMatrix; + Entities = entities; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + /// Represents the entities evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Entities = entities; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntityRecognitionEvaluationSummary() + { + } + + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the entities evaluation. + public IReadOnlyDictionary Entities { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ErrorCode.cs new file mode 100644 index 000000000000..b25c560b3483 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ErrorCode.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Human-readable error code. + public readonly partial struct ErrorCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ErrorCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidRequestValue = "InvalidRequest"; + private const string InvalidArgumentValue = "InvalidArgument"; + private const string UnauthorizedValue = "Unauthorized"; + private const string ForbiddenValue = "Forbidden"; + private const string NotFoundValue = "NotFound"; + private const string ProjectNotFoundValue = "ProjectNotFound"; + private const string OperationNotFoundValue = "OperationNotFound"; + private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; + private const string AzureCognitiveSearchIndexNotFoundValue = "AzureCognitiveSearchIndexNotFound"; + private const string TooManyRequestsValue = "TooManyRequests"; + private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; + private const string AzureCognitiveSearchIndexLimitReachedValue = "AzureCognitiveSearchIndexLimitReached"; + private const string InternalServerErrorValue = "InternalServerError"; + private const string ServiceUnavailableValue = "ServiceUnavailable"; + private const string TimeoutValue = "Timeout"; + private const string QuotaExceededValue = "QuotaExceeded"; + private const string ConflictValue = "Conflict"; + private const string WarningValue = "Warning"; + + /// InvalidRequest. + public static ErrorCode InvalidRequest { get; } = new ErrorCode(InvalidRequestValue); + /// InvalidArgument. + public static ErrorCode InvalidArgument { get; } = new ErrorCode(InvalidArgumentValue); + /// Unauthorized. + public static ErrorCode Unauthorized { get; } = new ErrorCode(UnauthorizedValue); + /// Forbidden. + public static ErrorCode Forbidden { get; } = new ErrorCode(ForbiddenValue); + /// NotFound. + public static ErrorCode NotFound { get; } = new ErrorCode(NotFoundValue); + /// ProjectNotFound. + public static ErrorCode ProjectNotFound { get; } = new ErrorCode(ProjectNotFoundValue); + /// OperationNotFound. + public static ErrorCode OperationNotFound { get; } = new ErrorCode(OperationNotFoundValue); + /// AzureCognitiveSearchNotFound. + public static ErrorCode AzureCognitiveSearchNotFound { get; } = new ErrorCode(AzureCognitiveSearchNotFoundValue); + /// AzureCognitiveSearchIndexNotFound. + public static ErrorCode AzureCognitiveSearchIndexNotFound { get; } = new ErrorCode(AzureCognitiveSearchIndexNotFoundValue); + /// TooManyRequests. + public static ErrorCode TooManyRequests { get; } = new ErrorCode(TooManyRequestsValue); + /// AzureCognitiveSearchThrottling. + public static ErrorCode AzureCognitiveSearchThrottling { get; } = new ErrorCode(AzureCognitiveSearchThrottlingValue); + /// AzureCognitiveSearchIndexLimitReached. + public static ErrorCode AzureCognitiveSearchIndexLimitReached { get; } = new ErrorCode(AzureCognitiveSearchIndexLimitReachedValue); + /// InternalServerError. + public static ErrorCode InternalServerError { get; } = new ErrorCode(InternalServerErrorValue); + /// ServiceUnavailable. + public static ErrorCode ServiceUnavailable { get; } = new ErrorCode(ServiceUnavailableValue); + /// Timeout. + public static ErrorCode Timeout { get; } = new ErrorCode(TimeoutValue); + /// QuotaExceeded. + public static ErrorCode QuotaExceeded { get; } = new ErrorCode(QuotaExceededValue); + /// Conflict. + public static ErrorCode Conflict { get; } = new ErrorCode(ConflictValue); + /// Warning. + public static ErrorCode Warning { get; } = new ErrorCode(WarningValue); + /// Determines if two values are the same. + public static bool operator ==(ErrorCode left, ErrorCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ErrorCode left, ErrorCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ErrorCode(string value) => new ErrorCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ErrorCode other && Equals(other); + /// + public bool Equals(ErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs new file mode 100644 index 000000000000..f136f882d5bb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class EvaluationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + if (Optional.IsDefined(TrainingSplitPercentage)) + { + writer.WritePropertyName("trainingSplitPercentage"u8); + writer.WriteNumberValue(TrainingSplitPercentage.Value); + } + if (Optional.IsDefined(TestingSplitPercentage)) + { + writer.WritePropertyName("testingSplitPercentage"u8); + writer.WriteNumberValue(TestingSplitPercentage.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationDetails(document.RootElement, options); + } + + internal static EvaluationDetails DeserializeEvaluationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EvaluationKind? kind = default; + int? trainingSplitPercentage = default; + int? testingSplitPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new EvaluationKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingSplitPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trainingSplitPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("testingSplitPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testingSplitPercentage = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationDetails(kind, trainingSplitPercentage, testingSplitPercentage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support writing '{options.Format}' format."); + } + } + + EvaluationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.cs new file mode 100644 index 000000000000..1fc4598f9317 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationDetails.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options used running the evaluation. + public partial class EvaluationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EvaluationDetails() + { + } + + /// Initializes a new instance of . + /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. + /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. + /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. + /// Keeps track of any properties unknown to the library. + internal EvaluationDetails(EvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) + { + Kind = kind; + TrainingSplitPercentage = trainingSplitPercentage; + TestingSplitPercentage = testingSplitPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the evaluation kind. By default, the evaluation kind is set to percentage. + public EvaluationKind? Kind { get; set; } + /// Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage. + public int? TrainingSplitPercentage { get; set; } + /// Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage. + public int? TestingSplitPercentage { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs new file mode 100644 index 000000000000..8a079924352a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class EvaluationJobResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationJobResult(document.RootElement, options); + } + + internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EvaluationDetails evaluationOptions = default; + string modelLabel = default; + string trainingConfigVersion = default; + int percentComplete = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + percentComplete = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{options.Format}' format."); + } + } + + EvaluationJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationJobResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationJobResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationJobResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.cs new file mode 100644 index 000000000000..787dbacb2620 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobResult.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The EvaluationJobResult. + public partial class EvaluationJobResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// , or is null. + internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + + EvaluationOptions = evaluationOptions; + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + PercentComplete = percentComplete; + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// Keeps track of any properties unknown to the library. + internal EvaluationJobResult(EvaluationDetails evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) + { + EvaluationOptions = evaluationOptions; + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + PercentComplete = percentComplete; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationJobResult() + { + } + + /// Represents the options used running the evaluation. + public EvaluationDetails EvaluationOptions { get; } + /// Represents trained model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents progress percentage. + public int PercentComplete { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs new file mode 100644 index 000000000000..4218bfdf7891 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class EvaluationJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationJobState(document.RootElement, options); + } + + internal static EvaluationJobState DeserializeEvaluationJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + EvaluationJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = EvaluationJobResult.DeserializeEvaluationJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support writing '{options.Format}' format."); + } + } + + EvaluationJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.cs new file mode 100644 index 000000000000..acecb242d3f9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationJobState.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a evaluation job. + public partial class EvaluationJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents evaluation task detailed result. + /// is null. + internal EvaluationJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, EvaluationJobResult result) + { + Argument.AssertNotNull(result, nameof(result)); + + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents evaluation task detailed result. + /// Keeps track of any properties unknown to the library. + internal EvaluationJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, EvaluationJobResult result, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents evaluation task detailed result. + public EvaluationJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationKind.cs new file mode 100644 index 000000000000..6cd9bbab3779 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The EvaluationKind. + public readonly partial struct EvaluationKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EvaluationKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PercentageValue = "percentage"; + private const string ManualValue = "manual"; + + /// Split the data into training and test sets according to user-defined percentages. + public static EvaluationKind Percentage { get; } = new EvaluationKind(PercentageValue); + /// Split the data according to the chosen dataset for every example in the data. + public static EvaluationKind Manual { get; } = new EvaluationKind(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(EvaluationKind left, EvaluationKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EvaluationKind left, EvaluationKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EvaluationKind(string value) => new EvaluationKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EvaluationKind other && Equals(other); + /// + public bool Equals(EvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..56dcc54bebb9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + [PersistableModelProxy(typeof(UnknownEvaluationSummary))] + public partial class EvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationSummary(document.RootElement, options); + } + + internal static EvaluationSummary DeserializeEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CustomEntityRecognition": return CustomEntityRecognitionEvaluationSummary.DeserializeCustomEntityRecognitionEvaluationSummary(element, options); + case "CustomHealthcare": return CustomHealthcareEvaluationSummary.DeserializeCustomHealthcareEvaluationSummary(element, options); + case "CustomMultiLabelClassification": return CustomMultiLabelClassificationEvaluationSummary.DeserializeCustomMultiLabelClassificationEvaluationSummary(element, options); + case "CustomSingleLabelClassification": return CustomSingleLabelClassificationEvaluationSummary.DeserializeCustomSingleLabelClassificationEvaluationSummary(element, options); + case "CustomTextSentiment": return CustomTextSentimentEvaluationSummary.DeserializeCustomTextSentimentEvaluationSummary(element, options); + } + } + return UnknownEvaluationSummary.DeserializeUnknownEvaluationSummary(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.cs new file mode 100644 index 000000000000..864f4d85893c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/EvaluationSummary.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// + /// Represents the summary for an evaluation operation. + /// 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 EvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// is null. + protected EvaluationSummary(EvaluationDetails evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + + EvaluationOptions = evaluationOptions; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + internal EvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + EvaluationOptions = evaluationOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationSummary() + { + } + + /// Represents the project type that the evaluation ran on. + internal ProjectKind ProjectKind { get; set; } + /// Represents the options used running the evaluation. + public EvaluationDetails EvaluationOptions { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs new file mode 100644 index 000000000000..e730c672af60 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.Serialization.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportProjectJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ResultUrl)) + { + writer.WritePropertyName("resultUrl"u8); + writer.WriteStringValue(ResultUrl); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportProjectJobState(document.RootElement, options); + } + + internal static ExportProjectJobState DeserializeExportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + string resultUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("resultUrl"u8)) + { + resultUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + resultUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support writing '{options.Format}' format."); + } + } + + ExportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportProjectJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportProjectJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportProjectJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportProjectJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.cs new file mode 100644 index 000000000000..9850d7221eab --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportProjectJobState.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of an export job. + public partial class ExportProjectJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ExportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// Keeps track of any properties unknown to the library. + internal ExportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUrl, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + ResultUrl = resultUrl; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportProjectJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// The URL to use in order to download the exported project. + public string ResultUrl { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedClass.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedClass.Serialization.cs new file mode 100644 index 000000000000..ad6193bfa96d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedClass.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedClass : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedClass)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedClass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedClass)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedClass(document.RootElement, options); + } + + internal static ExportedClass DeserializeExportedClass(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedClass(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedClass)} does not support writing '{options.Format}' format."); + } + } + + ExportedClass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedClass(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedClass)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedClass FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedClass(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedClass.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedClass.cs new file mode 100644 index 000000000000..8e5ad37b09df --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedClass.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a class of an exported project. + public partial class ExportedClass + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedClass() + { + } + + /// Initializes a new instance of . + /// The class category. + /// Keeps track of any properties unknown to the library. + internal ExportedClass(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class category. + public string Category { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs new file mode 100644 index 000000000000..5e806b73d13a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCompositeEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CompositionSetting)) + { + writer.WritePropertyName("compositionSetting"u8); + writer.WriteStringValue(CompositionSetting.Value.ToString()); + } + if (Optional.IsDefined(List)) + { + writer.WritePropertyName("list"u8); + writer.WriteObjectValue(List, options); + } + if (Optional.IsCollectionDefined(Prebuilts)) + { + writer.WritePropertyName("prebuilts"u8); + writer.WriteStartArray(); + foreach (var item in Prebuilts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCompositeEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCompositeEntity(document.RootElement, options); + } + + internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CompositionSetting? compositionSetting = default; + ExportedEntityList list = default; + IList prebuilts = default; + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("compositionSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compositionSetting = new CompositionSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("list"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + list = ExportedEntityList.DeserializeExportedEntityList(property.Value, options); + continue; + } + if (property.NameEquals("prebuilts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedPrebuiltEntity.DeserializeExportedPrebuiltEntity(item, options)); + } + prebuilts = array; + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCompositeEntity(compositionSetting, list, prebuilts ?? new ChangeTrackingList(), category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedCompositeEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCompositeEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCompositeEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCompositeEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs new file mode 100644 index 000000000000..d48e0060c13c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCompositeEntity.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an entity in an exported project with composite entities enabled. + public partial class ExportedCompositeEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCompositeEntity() + { + Prebuilts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The entity category. + /// Keeps track of any properties unknown to the library. + internal ExportedCompositeEntity(CompositionSetting? compositionSetting, ExportedEntityList list, IList prebuilts, string category, IDictionary serializedAdditionalRawData) + { + CompositionSetting = compositionSetting; + List = list; + Prebuilts = prebuilts; + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The behavior to follow when the entity's components overlap with each other. + public CompositionSetting? CompositionSetting { get; set; } + /// The list component of the entity. + public ExportedEntityList List { get; set; } + /// The prebuilt entities components. + public IList Prebuilts { get; } + /// The entity category. + public string Category { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs new file mode 100644 index 000000000000..02b4790e7d13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomAbstractiveSummarizationDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("summaryLocation"u8); + writer.WriteStringValue(SummaryLocation); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCustomAbstractiveSummarizationDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomAbstractiveSummarizationDocument(document.RootElement, options); + } + + internal static ExportedCustomAbstractiveSummarizationDocument DeserializeExportedCustomAbstractiveSummarizationDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string summaryLocation = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("summaryLocation"u8)) + { + summaryLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomAbstractiveSummarizationDocument(summaryLocation, location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomAbstractiveSummarizationDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomAbstractiveSummarizationDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomAbstractiveSummarizationDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomAbstractiveSummarizationDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs new file mode 100644 index 000000000000..1e9bde79d55c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported document for a custom abstractive summarization project. + public partial class ExportedCustomAbstractiveSummarizationDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the summary file location in the blob store container associated with the project. + /// is null. + public ExportedCustomAbstractiveSummarizationDocument(string summaryLocation) + { + Argument.AssertNotNull(summaryLocation, nameof(summaryLocation)); + + SummaryLocation = summaryLocation; + } + + /// Initializes a new instance of . + /// Represents the summary file location in the blob store container associated with the project. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomAbstractiveSummarizationDocument(string summaryLocation, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + SummaryLocation = summaryLocation; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedCustomAbstractiveSummarizationDocument() + { + } + + /// Represents the summary file location in the blob store container associated with the project. + public string SummaryLocation { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs new file mode 100644 index 000000000000..8130c91d17a0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomAbstractiveSummarizationProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ExportedCustomAbstractiveSummarizationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomAbstractiveSummarizationProjectAssets DeserializeExportedCustomAbstractiveSummarizationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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(ExportedCustomAbstractiveSummarizationDocument.DeserializeExportedCustomAbstractiveSummarizationDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomAbstractiveSummarizationProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomAbstractiveSummarizationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomAbstractiveSummarizationProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs new file mode 100644 index 000000000000..f6b5213b4f13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the exported assets for an abstractive summarization project. + public partial class ExportedCustomAbstractiveSummarizationProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomAbstractiveSummarizationProjectAssets() + { + ProjectKind = ProjectKind.CustomAbstractiveSummarization; + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of documents belonging to this project. + internal ExportedCustomAbstractiveSummarizationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Documents = documents; + } + + /// The list of documents belonging to this project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs new file mode 100644 index 000000000000..36c3b019617b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomEntityRecognitionDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCustomEntityRecognitionDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomEntityRecognitionDocument(document.RootElement, options); + } + + internal static ExportedCustomEntityRecognitionDocument DeserializeExportedCustomEntityRecognitionDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentEntityRegion.DeserializeExportedDocumentEntityRegion(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomEntityRecognitionDocument(entities ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomEntityRecognitionDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomEntityRecognitionDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomEntityRecognitionDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomEntityRecognitionDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs new file mode 100644 index 000000000000..457f66c0e720 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported document for a custom entity recognition project. + public partial class ExportedCustomEntityRecognitionDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomEntityRecognitionDocument() + { + Entities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of entity labels belonging to the document. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomEntityRecognitionDocument(IList entities, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Entities = entities; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of entity labels belonging to the document. + public IList Entities { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs new file mode 100644 index 000000000000..e29002a15116 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomEntityRecognitionProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ExportedCustomEntityRecognitionProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExportedCustomEntityRecognitionProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntity.DeserializeExportedEntity(item, options)); + } + entities = 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(ExportedCustomEntityRecognitionDocument.DeserializeExportedCustomEntityRecognitionDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomEntityRecognitionProjectAssets(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomEntityRecognitionProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomEntityRecognitionProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs new file mode 100644 index 000000000000..15b8b18d382b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the exported assets for a entity recognition project. + public partial class ExportedCustomEntityRecognitionProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomEntityRecognitionProjectAssets() + { + ProjectKind = ProjectKind.CustomEntityRecognition; + Entities = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of entities belonging to the project. + /// The list of documents belonging to the project. + internal ExportedCustomEntityRecognitionProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Entities = entities; + Documents = documents; + } + + /// The list of entities belonging to the project. + public IList Entities { get; } + /// The list of documents belonging to the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs new file mode 100644 index 000000000000..b0cbdac083f4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomHealthcareDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCustomHealthcareDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomHealthcareDocument(document.RootElement, options); + } + + internal static ExportedCustomHealthcareDocument DeserializeExportedCustomHealthcareDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentEntityRegion.DeserializeExportedDocumentEntityRegion(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomHealthcareDocument(entities ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomHealthcareDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomHealthcareDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomHealthcareDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomHealthcareDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareDocument.cs new file mode 100644 index 000000000000..6f1cd4926bc9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareDocument.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported document for a CustomHealthcare project. + public partial class ExportedCustomHealthcareDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomHealthcareDocument() + { + Entities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of entity labels belonging to the document. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomHealthcareDocument(IList entities, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Entities = entities; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of entity labels belonging to the document. + public IList Entities { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs new file mode 100644 index 000000000000..5484989b5b82 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomHealthcareProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ExportedCustomHealthcareProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomHealthcareProjectAssets DeserializeExportedCustomHealthcareProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCompositeEntity.DeserializeExportedCompositeEntity(item, options)); + } + entities = 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(ExportedCustomHealthcareDocument.DeserializeExportedCustomHealthcareDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomHealthcareProjectAssets(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomHealthcareProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomHealthcareProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs new file mode 100644 index 000000000000..9556e1cea497 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the exported assets for a CustomHealthcare project. + public partial class ExportedCustomHealthcareProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomHealthcareProjectAssets() + { + ProjectKind = ProjectKind.CustomHealthcare; + Entities = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of entities belonging to the project. + /// The list of documents belonging to the project. + internal ExportedCustomHealthcareProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Entities = entities; + Documents = documents; + } + + /// The list of entities belonging to the project. + public IList Entities { get; } + /// The list of documents belonging to the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs new file mode 100644 index 000000000000..5ce98fb56034 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomMultiLabelClassificationDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Classes)) + { + writer.WritePropertyName("classes"u8); + writer.WriteStartArray(); + foreach (var item in Classes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCustomMultiLabelClassificationDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomMultiLabelClassificationDocument(document.RootElement, options); + } + + internal static ExportedCustomMultiLabelClassificationDocument DeserializeExportedCustomMultiLabelClassificationDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList classes = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentClass.DeserializeExportedDocumentClass(item, options)); + } + classes = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomMultiLabelClassificationDocument(classes ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomMultiLabelClassificationDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomMultiLabelClassificationDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomMultiLabelClassificationDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomMultiLabelClassificationDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs new file mode 100644 index 000000000000..2664fbeadd48 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported document of a custom multi-label classification project. + public partial class ExportedCustomMultiLabelClassificationDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomMultiLabelClassificationDocument() + { + Classes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The document classes. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomMultiLabelClassificationDocument(IList classes, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Classes = classes; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The document classes. + public IList Classes { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs new file mode 100644 index 000000000000..260364af2413 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomMultiLabelClassificationProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Classes)) + { + writer.WritePropertyName("classes"u8); + writer.WriteStartArray(); + foreach (var item in Classes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ExportedCustomMultiLabelClassificationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomMultiLabelClassificationProjectAssets DeserializeExportedCustomMultiLabelClassificationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList classes = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedClass.DeserializeExportedClass(item, options)); + } + classes = 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(ExportedCustomMultiLabelClassificationDocument.DeserializeExportedCustomMultiLabelClassificationDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomMultiLabelClassificationProjectAssets(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomMultiLabelClassificationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomMultiLabelClassificationProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs new file mode 100644 index 000000000000..f7e762c59a43 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the exported assets for a custom multi-label classification project. + public partial class ExportedCustomMultiLabelClassificationProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomMultiLabelClassificationProjectAssets() + { + ProjectKind = ProjectKind.CustomMultiLabelClassification; + Classes = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of classes in the project. + /// The list of documents in the project. + internal ExportedCustomMultiLabelClassificationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Classes = classes; + Documents = documents; + } + + /// The list of classes in the project. + public IList Classes { get; } + /// The list of documents in the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs new file mode 100644 index 000000000000..9619c92f350d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomSingleLabelClassificationDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Class)) + { + writer.WritePropertyName("class"u8); + writer.WriteObjectValue(Class, options); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCustomSingleLabelClassificationDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomSingleLabelClassificationDocument(document.RootElement, options); + } + + internal static ExportedCustomSingleLabelClassificationDocument DeserializeExportedCustomSingleLabelClassificationDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedDocumentClass @class = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("class"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @class = ExportedDocumentClass.DeserializeExportedDocumentClass(property.Value, options); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomSingleLabelClassificationDocument(@class, location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomSingleLabelClassificationDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomSingleLabelClassificationDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomSingleLabelClassificationDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomSingleLabelClassificationDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs new file mode 100644 index 000000000000..4e8e5bab2b58 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported document for a custom single-label classification project. + public partial class ExportedCustomSingleLabelClassificationDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomSingleLabelClassificationDocument() + { + } + + /// Initializes a new instance of . + /// The class of the documents. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomSingleLabelClassificationDocument(ExportedDocumentClass @class, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Class = @class; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class of the documents. + public ExportedDocumentClass Class { get; set; } + /// The location of the document in the storage. + public string Location { get; set; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs new file mode 100644 index 000000000000..48511313fd42 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomSingleLabelClassificationProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Classes)) + { + writer.WritePropertyName("classes"u8); + writer.WriteStartArray(); + foreach (var item in Classes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ExportedCustomSingleLabelClassificationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomSingleLabelClassificationProjectAssets DeserializeExportedCustomSingleLabelClassificationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList classes = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedClass.DeserializeExportedClass(item, options)); + } + classes = 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(ExportedCustomSingleLabelClassificationDocument.DeserializeExportedCustomSingleLabelClassificationDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomSingleLabelClassificationProjectAssets(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomSingleLabelClassificationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomSingleLabelClassificationProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs new file mode 100644 index 000000000000..ad0da5081ab2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the exported assets for a single-label classification project. + public partial class ExportedCustomSingleLabelClassificationProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomSingleLabelClassificationProjectAssets() + { + ProjectKind = ProjectKind.CustomSingleLabelClassification; + Classes = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of classes belonging to this project. + /// The list of documents belonging to this project. + internal ExportedCustomSingleLabelClassificationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Classes = classes; + Documents = documents; + } + + /// The list of classes belonging to this project. + public IList Classes { get; } + /// The list of documents belonging to this project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs new file mode 100644 index 000000000000..80ff9a84b432 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomTextSentimentDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(SentimentSpans)) + { + writer.WritePropertyName("sentimentSpans"u8); + writer.WriteStartArray(); + foreach (var item in SentimentSpans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedCustomTextSentimentDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomTextSentimentDocument(document.RootElement, options); + } + + internal static ExportedCustomTextSentimentDocument DeserializeExportedCustomTextSentimentDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList sentimentSpans = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sentimentSpans"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentSentimentLabel.DeserializeExportedDocumentSentimentLabel(item, options)); + } + sentimentSpans = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomTextSentimentDocument(sentimentSpans ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomTextSentimentDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomTextSentimentDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomTextSentimentDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomTextSentimentDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentDocument.cs new file mode 100644 index 000000000000..60ac85cb1f40 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentDocument.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported document for a custom text sentiment project. + public partial class ExportedCustomTextSentimentDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomTextSentimentDocument() + { + SentimentSpans = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomTextSentimentDocument(IList sentimentSpans, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + SentimentSpans = sentimentSpans; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the sentiment spans. + public IList SentimentSpans { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs new file mode 100644 index 000000000000..29705c0072cb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedCustomTextSentimentProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ExportedCustomTextSentimentProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomTextSentimentProjectAssets DeserializeExportedCustomTextSentimentProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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(ExportedCustomTextSentimentDocument.DeserializeExportedCustomTextSentimentDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomTextSentimentProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomTextSentimentProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomTextSentimentProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs new file mode 100644 index 000000000000..212043139c9a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the exported assets for a custom text sentiment project. + public partial class ExportedCustomTextSentimentProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomTextSentimentProjectAssets() + { + ProjectKind = ProjectKind.CustomTextSentiment; + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of documents belonging to the project. + internal ExportedCustomTextSentimentProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Documents = documents; + } + + /// The list of documents belonging to the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentClass.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentClass.Serialization.cs new file mode 100644 index 000000000000..7478efb3a6d3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentClass.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedDocumentClass : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedDocumentClass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentClass(document.RootElement, options); + } + + internal static ExportedDocumentClass DeserializeExportedDocumentClass(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentClass(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentClass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentClass(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentClass FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentClass(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentClass.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentClass.cs new file mode 100644 index 000000000000..f50670ddc89b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentClass.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a classification label for a document. + public partial class ExportedDocumentClass + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentClass() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentClass(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the category. + public string Category { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs new file mode 100644 index 000000000000..dc87c9d52c1e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedDocumentEntityLabel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (Optional.IsDefined(Offset)) + { + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset.Value); + } + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedDocumentEntityLabel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentEntityLabel(document.RootElement, options); + } + + internal static ExportedDocumentEntityLabel DeserializeExportedDocumentEntityLabel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + int? offset = default; + int? length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentEntityLabel(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentEntityLabel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentEntityLabel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentEntityLabel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentEntityLabel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityLabel.cs new file mode 100644 index 000000000000..5dafa09970d4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityLabel.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an entity label for a document. + public partial class ExportedDocumentEntityLabel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentEntityLabel() + { + } + + /// Initializes a new instance of . + /// The entity category. + /// Start position for the entity text. + /// Length for the entity text. + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentEntityLabel(string category, int? offset, int? length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The entity category. + public string Category { get; set; } + /// Start position for the entity text. + public int? Offset { get; set; } + /// Length for the entity text. + public int? Length { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs new file mode 100644 index 000000000000..5eb70951a1dd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedDocumentEntityRegion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RegionOffset)) + { + writer.WritePropertyName("regionOffset"u8); + writer.WriteNumberValue(RegionOffset.Value); + } + if (Optional.IsDefined(RegionLength)) + { + writer.WritePropertyName("regionLength"u8); + writer.WriteNumberValue(RegionLength.Value); + } + if (Optional.IsCollectionDefined(Labels)) + { + writer.WritePropertyName("labels"u8); + writer.WriteStartArray(); + foreach (var item in Labels) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedDocumentEntityRegion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentEntityRegion(document.RootElement, options); + } + + internal static ExportedDocumentEntityRegion DeserializeExportedDocumentEntityRegion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? regionOffset = default; + int? regionLength = default; + IList labels = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("regionOffset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("regionLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentEntityLabel.DeserializeExportedDocumentEntityLabel(item, options)); + } + labels = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentEntityRegion(regionOffset, regionLength, labels ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentEntityRegion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentEntityRegion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentEntityRegion FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentEntityRegion(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityRegion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityRegion.cs new file mode 100644 index 000000000000..ef1f229211c8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentEntityRegion.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a region in a document for entity labeling. + public partial class ExportedDocumentEntityRegion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentEntityRegion() + { + Labels = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Start position for the region. + /// Length for the region text. + /// The list of entity labels belonging to this region. + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentEntityRegion(int? regionOffset, int? regionLength, IList labels, IDictionary serializedAdditionalRawData) + { + RegionOffset = regionOffset; + RegionLength = regionLength; + Labels = labels; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Start position for the region. + public int? RegionOffset { get; set; } + /// Length for the region text. + public int? RegionLength { get; set; } + /// The list of entity labels belonging to this region. + public IList Labels { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs new file mode 100644 index 000000000000..f0f2a616ac1c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedDocumentSentimentLabel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (Optional.IsDefined(Offset)) + { + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset.Value); + } + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedDocumentSentimentLabel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentSentimentLabel(document.RootElement, options); + } + + internal static ExportedDocumentSentimentLabel DeserializeExportedDocumentSentimentLabel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TextAnalysisAuthoringSentiment? category = default; + int? offset = default; + int? length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new TextAnalysisAuthoringSentiment(property.Value.GetString()); + continue; + } + if (property.NameEquals("offset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentSentimentLabel(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentSentimentLabel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentSentimentLabel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentSentimentLabel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentSentimentLabel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs new file mode 100644 index 000000000000..dc1adbc74a16 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedDocumentSentimentLabel.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an entity label for a document. + public partial class ExportedDocumentSentimentLabel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentSentimentLabel() + { + } + + /// Initializes a new instance of . + /// The sentiment category. + /// Start position for the sentiment text. + /// Length for the sentiment text. + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentSentimentLabel(TextAnalysisAuthoringSentiment? category, int? offset, int? length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sentiment category. + public TextAnalysisAuthoringSentiment? Category { get; set; } + /// Start position for the sentiment text. + public int? Offset { get; set; } + /// Length for the sentiment text. + public int? Length { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.Serialization.cs new file mode 100644 index 000000000000..c5c6edab6ac1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntity(document.RootElement, options); + } + + internal static ExportedEntity DeserializeExportedEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntity(category, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.cs new file mode 100644 index 000000000000..0d94bdbb9599 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an entity in an exported project. + public partial class ExportedEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntity() + { + } + + /// Initializes a new instance of . + /// The entity category. + /// Short description for entity category. Required when enabling synthetic data generation. + /// Keeps track of any properties unknown to the library. + internal ExportedEntity(string category, string description, IDictionary serializedAdditionalRawData) + { + Category = category; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The entity category. + public string Category { get; set; } + /// Short description for entity category. Required when enabling synthetic data generation. + public string Description { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs new file mode 100644 index 000000000000..d531ecfb0b80 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedEntityList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Sublists)) + { + writer.WritePropertyName("sublists"u8); + writer.WriteStartArray(); + foreach (var item in Sublists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntityList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityList(document.RootElement, options); + } + + internal static ExportedEntityList DeserializeExportedEntityList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList sublists = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sublists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntitySublist.DeserializeExportedEntitySublist(item, options)); + } + sublists = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityList(sublists ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityList FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityList(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.cs new file mode 100644 index 000000000000..649912622cfe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityList.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a list component of an entity. + public partial class ExportedEntityList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityList() + { + Sublists = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The sub-lists of the list component. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityList(IList sublists, IDictionary serializedAdditionalRawData) + { + Sublists = sublists; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sub-lists of the list component. + public IList Sublists { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs new file mode 100644 index 000000000000..4972bb71997d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedEntityListSynonym : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"u8); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntityListSynonym IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityListSynonym(document.RootElement, options); + } + + internal static ExportedEntityListSynonym DeserializeExportedEntityListSynonym(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string language = default; + IList values = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + values = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityListSynonym(language, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityListSynonym IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityListSynonym(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityListSynonym FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityListSynonym(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs new file mode 100644 index 000000000000..d2ce805ef39d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntityListSynonym.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a list of synonyms inside a list component. + public partial class ExportedEntityListSynonym + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityListSynonym() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the language of the synonyms. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The list of synonyms. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityListSynonym(string language, IList values, IDictionary serializedAdditionalRawData) + { + Language = language; + Values = values; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Represents the language of the synonyms. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; set; } + /// The list of synonyms. + public IList Values { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs new file mode 100644 index 000000000000..a0785f2249bb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedEntitySublist : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ListKey)) + { + writer.WritePropertyName("listKey"u8); + writer.WriteStringValue(ListKey); + } + if (Optional.IsCollectionDefined(Synonyms)) + { + writer.WritePropertyName("synonyms"u8); + writer.WriteStartArray(); + foreach (var item in Synonyms) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedEntitySublist IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntitySublist(document.RootElement, options); + } + + internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string listKey = default; + IList synonyms = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("listKey"u8)) + { + listKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("synonyms"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntityListSynonym.DeserializeExportedEntityListSynonym(item, options)); + } + synonyms = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntitySublist(listKey, synonyms ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntitySublist IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntitySublist(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntitySublist FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntitySublist(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.cs new file mode 100644 index 000000000000..5ae507815c1e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedEntitySublist.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a sub-list inside a list component. + public partial class ExportedEntitySublist + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntitySublist() + { + Synonyms = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The key of the sub-list. + /// The phrases of that correspond to the sub-list. + /// Keeps track of any properties unknown to the library. + internal ExportedEntitySublist(string listKey, IList synonyms, IDictionary serializedAdditionalRawData) + { + ListKey = listKey; + Synonyms = synonyms; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The key of the sub-list. + public string ListKey { get; set; } + /// The phrases of that correspond to the sub-list. + public IList Synonyms { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs new file mode 100644 index 000000000000..762001abd73f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedModelDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("trainedModelLabel"u8); + writer.WriteStringValue(TrainedModelLabel); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedModelDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelDetails(document.RootElement, options); + } + + internal static ExportedModelDetails DeserializeExportedModelDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainedModelLabel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainedModelLabel"u8)) + { + trainedModelLabel = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelDetails(trainedModelLabel, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.cs new file mode 100644 index 000000000000..80920bc366c0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelDetails.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options for creating or replacing an exported model. + public partial class ExportedModelDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The trained model label. + /// is null. + public ExportedModelDetails(string trainedModelLabel) + { + Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); + + TrainedModelLabel = trainedModelLabel; + } + + /// Initializes a new instance of . + /// The trained model label. + /// Keeps track of any properties unknown to the library. + internal ExportedModelDetails(string trainedModelLabel, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelDetails() + { + } + + /// The trained model label. + public string TrainedModelLabel { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs new file mode 100644 index 000000000000..400ffa3c059b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedModelJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedModelJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelJobState(document.RootElement, options); + } + + internal static ExportedModelJobState DeserializeExportedModelJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.cs new file mode 100644 index 000000000000..2ab5ed9075b6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a job to create or updated an exported model. + public partial class ExportedModelJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ExportedModelJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal ExportedModelJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelManifest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelManifest.Serialization.cs new file mode 100644 index 000000000000..b37e81e6521d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelManifest.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedModelManifest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("modelFiles"u8); + writer.WriteStartArray(); + foreach (var item in ModelFiles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedModelManifest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelManifest(document.RootElement, options); + } + + internal static ExportedModelManifest DeserializeExportedModelManifest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList modelFiles = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelFiles"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ModelFile.DeserializeModelFile(item, options)); + } + modelFiles = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelManifest(modelFiles, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelManifest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelManifest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelManifest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelManifest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelManifest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelManifest.cs new file mode 100644 index 000000000000..bf9a347bff15 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedModelManifest.cs @@ -0,0 +1,76 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the properties for the exported model manifest. + public partial class ExportedModelManifest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model files belonging to this model. + /// is null. + internal ExportedModelManifest(IEnumerable modelFiles) + { + Argument.AssertNotNull(modelFiles, nameof(modelFiles)); + + ModelFiles = modelFiles.ToList(); + } + + /// Initializes a new instance of . + /// The model files belonging to this model. + /// Keeps track of any properties unknown to the library. + internal ExportedModelManifest(IReadOnlyList modelFiles, IDictionary serializedAdditionalRawData) + { + ModelFiles = modelFiles; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelManifest() + { + } + + /// The model files belonging to this model. + public IReadOnlyList ModelFiles { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..c2b8b8cc290c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedPrebuiltEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedPrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedPrebuiltEntity(document.RootElement, options); + } + + internal static ExportedPrebuiltEntity DeserializeExportedPrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedPrebuiltEntity(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedPrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedPrebuiltEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedPrebuiltEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedPrebuiltEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs new file mode 100644 index 000000000000..c758f0fed070 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedPrebuiltEntity.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported prebuilt entity component. + public partial class ExportedPrebuiltEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// is null. + public ExportedPrebuiltEntity(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// Keeps track of any properties unknown to the library. + internal ExportedPrebuiltEntity(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedPrebuiltEntity() + { + } + + /// The prebuilt entity category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.Serialization.cs new file mode 100644 index 000000000000..46e531b43506 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedProject : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectFileVersion"u8); + writer.WriteStringValue(ProjectFileVersion); + writer.WritePropertyName("stringIndexType"u8); + writer.WriteStringValue(StringIndexType.ToString()); + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata, options); + if (Optional.IsDefined(Assets)) + { + writer.WritePropertyName("assets"u8); + writer.WriteObjectValue(Assets, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedProject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProject(document.RootElement, options); + } + + internal static ExportedProject DeserializeExportedProject(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectFileVersion = default; + StringIndexType stringIndexType = default; + CreateProjectDetails metadata = default; + ExportedProjectAssets assets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectFileVersion"u8)) + { + projectFileVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("stringIndexType"u8)) + { + stringIndexType = new StringIndexType(property.Value.GetString()); + continue; + } + if (property.NameEquals("metadata"u8)) + { + metadata = CreateProjectDetails.DeserializeCreateProjectDetails(property.Value, options); + continue; + } + if (property.NameEquals("assets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assets = ExportedProjectAssets.DeserializeExportedProjectAssets(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{options.Format}' format."); + } + } + + ExportedProject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProject(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedProject FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedProject(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.cs new file mode 100644 index 000000000000..ef3a9a5db83b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProject.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported project. + public partial class ExportedProject + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// or is null. + public ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata) + { + Argument.AssertNotNull(projectFileVersion, nameof(projectFileVersion)); + Argument.AssertNotNull(metadata, nameof(metadata)); + + ProjectFileVersion = projectFileVersion; + StringIndexType = stringIndexType; + Metadata = metadata; + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// + /// Represents the project assets. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectDetails metadata, ExportedProjectAssets assets, IDictionary serializedAdditionalRawData) + { + ProjectFileVersion = projectFileVersion; + StringIndexType = stringIndexType; + Metadata = metadata; + Assets = assets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedProject() + { + } + + /// The version of the exported file. + public string ProjectFileVersion { get; } + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + public StringIndexType StringIndexType { get; } + /// Represents the project metadata. + public CreateProjectDetails Metadata { get; } + /// + /// Represents the project assets. + /// 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 ExportedProjectAssets Assets { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..19f14783dbb1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + [PersistableModelProxy(typeof(UnknownExportedProjectAssets))] + public partial class ExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + + internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CustomAbstractiveSummarization": return ExportedCustomAbstractiveSummarizationProjectAssets.DeserializeExportedCustomAbstractiveSummarizationProjectAssets(element, options); + case "CustomEntityRecognition": return ExportedCustomEntityRecognitionProjectAssets.DeserializeExportedCustomEntityRecognitionProjectAssets(element, options); + case "CustomHealthcare": return ExportedCustomHealthcareProjectAssets.DeserializeExportedCustomHealthcareProjectAssets(element, options); + case "CustomMultiLabelClassification": return ExportedCustomMultiLabelClassificationProjectAssets.DeserializeExportedCustomMultiLabelClassificationProjectAssets(element, options); + case "CustomSingleLabelClassification": return ExportedCustomSingleLabelClassificationProjectAssets.DeserializeExportedCustomSingleLabelClassificationProjectAssets(element, options); + case "CustomTextSentiment": return ExportedCustomTextSentimentProjectAssets.DeserializeExportedCustomTextSentimentProjectAssets(element, options); + } + } + return UnknownExportedProjectAssets.DeserializeUnknownExportedProjectAssets(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.cs new file mode 100644 index 000000000000..0130e7c0af22 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedProjectAssets.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// + /// Represents the assets of an exported project. + /// 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 ExportedProjectAssets + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ExportedProjectAssets() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the project kind. + internal ProjectKind ProjectKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs new file mode 100644 index 000000000000..abeb02983451 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ExportedTrainedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("exportedModelName"u8); + writer.WriteStringValue(ExportedModelName); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastExportedModelDateTime"u8); + writer.WriteStringValue(LastExportedModelDateTime, "O"); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExportedTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedTrainedModel(document.RootElement, options); + } + + internal static ExportedTrainedModel DeserializeExportedTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string exportedModelName = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastExportedModelDateTime = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportedModelName"u8)) + { + exportedModelName = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastExportedModelDateTime"u8)) + { + lastExportedModelDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{options.Format}' format."); + } + } + + ExportedTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedTrainedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedTrainedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedTrainedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.cs new file mode 100644 index 000000000000..ab451db6dc17 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ExportedTrainedModel.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents an exported trained model. + public partial class ExportedTrainedModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// or is null. + internal ExportedTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + } + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// Keeps track of any properties unknown to the library. + internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) + { + ExportedModelName = exportedModelName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedTrainedModel() + { + } + + /// The exported model name. + public string ExportedModelName { get; } + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The last exported date time of the model. + public DateTimeOffset LastExportedModelDateTime { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs new file mode 100644 index 000000000000..75db8690ed14 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ImportProjectJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportProjectJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportProjectJobState(document.RootElement, options); + } + + internal static ImportProjectJobState DeserializeImportProjectJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support writing '{options.Format}' format."); + } + } + + ImportProjectJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImportProjectJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportProjectJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ImportProjectJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeImportProjectJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.cs new file mode 100644 index 000000000000..11931f72bd16 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ImportProjectJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of an import job. + public partial class ImportProjectJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ImportProjectJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal ImportProjectJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImportProjectJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorCode.cs new file mode 100644 index 000000000000..0dbec264065a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorCode.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Human-readable error code. + public readonly partial struct InnerErrorCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InnerErrorCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidRequestValue = "InvalidRequest"; + private const string InvalidParameterValueValue = "InvalidParameterValue"; + private const string KnowledgeBaseNotFoundValue = "KnowledgeBaseNotFound"; + private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; + private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; + private const string ExtractionFailureValue = "ExtractionFailure"; + private const string InvalidRequestBodyFormatValue = "InvalidRequestBodyFormat"; + private const string EmptyRequestValue = "EmptyRequest"; + private const string MissingInputDocumentsValue = "MissingInputDocuments"; + private const string InvalidDocumentValue = "InvalidDocument"; + private const string ModelVersionIncorrectValue = "ModelVersionIncorrect"; + private const string InvalidDocumentBatchValue = "InvalidDocumentBatch"; + private const string UnsupportedLanguageCodeValue = "UnsupportedLanguageCode"; + private const string InvalidCountryHintValue = "InvalidCountryHint"; + + /// InvalidRequest. + public static InnerErrorCode InvalidRequest { get; } = new InnerErrorCode(InvalidRequestValue); + /// InvalidParameterValue. + public static InnerErrorCode InvalidParameterValue { get; } = new InnerErrorCode(InvalidParameterValueValue); + /// KnowledgeBaseNotFound. + public static InnerErrorCode KnowledgeBaseNotFound { get; } = new InnerErrorCode(KnowledgeBaseNotFoundValue); + /// AzureCognitiveSearchNotFound. + public static InnerErrorCode AzureCognitiveSearchNotFound { get; } = new InnerErrorCode(AzureCognitiveSearchNotFoundValue); + /// AzureCognitiveSearchThrottling. + public static InnerErrorCode AzureCognitiveSearchThrottling { get; } = new InnerErrorCode(AzureCognitiveSearchThrottlingValue); + /// ExtractionFailure. + public static InnerErrorCode ExtractionFailure { get; } = new InnerErrorCode(ExtractionFailureValue); + /// InvalidRequestBodyFormat. + public static InnerErrorCode InvalidRequestBodyFormat { get; } = new InnerErrorCode(InvalidRequestBodyFormatValue); + /// EmptyRequest. + public static InnerErrorCode EmptyRequest { get; } = new InnerErrorCode(EmptyRequestValue); + /// MissingInputDocuments. + public static InnerErrorCode MissingInputDocuments { get; } = new InnerErrorCode(MissingInputDocumentsValue); + /// InvalidDocument. + public static InnerErrorCode InvalidDocument { get; } = new InnerErrorCode(InvalidDocumentValue); + /// ModelVersionIncorrect. + public static InnerErrorCode ModelVersionIncorrect { get; } = new InnerErrorCode(ModelVersionIncorrectValue); + /// InvalidDocumentBatch. + public static InnerErrorCode InvalidDocumentBatch { get; } = new InnerErrorCode(InvalidDocumentBatchValue); + /// UnsupportedLanguageCode. + public static InnerErrorCode UnsupportedLanguageCode { get; } = new InnerErrorCode(UnsupportedLanguageCodeValue); + /// InvalidCountryHint. + public static InnerErrorCode InvalidCountryHint { get; } = new InnerErrorCode(InvalidCountryHintValue); + /// Determines if two values are the same. + public static bool operator ==(InnerErrorCode left, InnerErrorCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InnerErrorCode left, InnerErrorCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InnerErrorCode(string value) => new InnerErrorCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InnerErrorCode other && Equals(other); + /// + public bool Equals(InnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs new file mode 100644 index 000000000000..f461bad119e7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class InnerErrorModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartObject(); + foreach (var item in Details) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InnerErrorModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInnerErrorModel(document.RootElement, options); + } + + internal static InnerErrorModel DeserializeInnerErrorModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InnerErrorCode code = default; + string message = default; + IReadOnlyDictionary details = default; + string target = default; + InnerErrorModel innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = new InnerErrorCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"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()); + } + details = dictionary; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = DeserializeInnerErrorModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InnerErrorModel( + code, + message, + details ?? new ChangeTrackingDictionary(), + target, + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{options.Format}' format."); + } + } + + InnerErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInnerErrorModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InnerErrorModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInnerErrorModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.cs new file mode 100644 index 000000000000..8a526e0a0df3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/InnerErrorModel.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + public partial class InnerErrorModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// is null. + internal InnerErrorModel(InnerErrorCode code, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// Error details. + /// Error target. + /// An object containing more specific information than the current object about the error. + /// Keeps track of any properties unknown to the library. + internal InnerErrorModel(InnerErrorCode code, string message, IReadOnlyDictionary details, string target, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Details = details; + Target = target; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InnerErrorModel() + { + } + + /// One of a server-defined set of error codes. + public InnerErrorCode Code { get; } + /// Error message. + public string Message { get; } + /// Error details. + public IReadOnlyDictionary Details { get; } + /// Error target. + public string Target { get; } + /// An object containing more specific information than the current object about the error. + public InnerErrorModel Innererror { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/JobStatus.cs new file mode 100644 index 000000000000..7bf195744b62 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/JobStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The JobStatus. + public readonly partial struct JobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string CancelledValue = "cancelled"; + private const string CancellingValue = "cancelling"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); + /// running. + public static JobStatus Running { get; } = new JobStatus(RunningValue); + /// succeeded. + public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); + /// failed. + public static JobStatus Failed { get; } = new JobStatus(FailedValue); + /// cancelled. + public static JobStatus Cancelled { get; } = new JobStatus(CancelledValue); + /// cancelling. + public static JobStatus Cancelling { get; } = new JobStatus(CancellingValue); + /// partiallyCompleted. + public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobStatus(string value) => new JobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobStatus other && Equals(other); + /// + public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs new file mode 100644 index 000000000000..feb11863a23d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class LoadSnapshotJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LoadSnapshotJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadSnapshotJobState(document.RootElement, options); + } + + internal static LoadSnapshotJobState DeserializeLoadSnapshotJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoadSnapshotJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support writing '{options.Format}' format."); + } + } + + LoadSnapshotJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLoadSnapshotJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadSnapshotJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LoadSnapshotJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLoadSnapshotJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.cs new file mode 100644 index 000000000000..09150def111c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/LoadSnapshotJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of loading a snapshot job. + public partial class LoadSnapshotJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal LoadSnapshotJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal LoadSnapshotJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LoadSnapshotJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ModelFile.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ModelFile.Serialization.cs new file mode 100644 index 000000000000..c5ec6b2375a6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ModelFile.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ModelFile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ModelFile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("contentUri"u8); + writer.WriteStringValue(ContentUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ModelFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ModelFile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeModelFile(document.RootElement, options); + } + + internal static ModelFile DeserializeModelFile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Uri contentUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("contentUri"u8)) + { + contentUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ModelFile(name, contentUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ModelFile)} does not support writing '{options.Format}' format."); + } + } + + ModelFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeModelFile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ModelFile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ModelFile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeModelFile(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ModelFile.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ModelFile.cs new file mode 100644 index 000000000000..d12ae751d402 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ModelFile.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the properties for the model file. + public partial class ModelFile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the file. + /// The URI to retrieve the content of the file. + /// or is null. + internal ModelFile(string name, Uri contentUri) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(contentUri, nameof(contentUri)); + + Name = name; + ContentUri = contentUri; + } + + /// Initializes a new instance of . + /// The name of the file. + /// The URI to retrieve the content of the file. + /// Keeps track of any properties unknown to the library. + internal ModelFile(string name, Uri contentUri, IDictionary serializedAdditionalRawData) + { + Name = name; + ContentUri = contentUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ModelFile() + { + } + + /// The name of the file. + public string Name { get; } + /// The URI to retrieve the content of the file. + public Uri ContentUri { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..1de24d4adc2f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class MultiLabelClassEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MultiLabelClassEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMultiLabelClassEvaluationSummary(document.RootElement, options); + } + + internal static MultiLabelClassEvaluationSummary DeserializeMultiLabelClassEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MultiLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + MultiLabelClassEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMultiLabelClassEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MultiLabelClassEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMultiLabelClassEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassEvaluationSummary.cs new file mode 100644 index 000000000000..f7e281221ba1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary of a class in a multi-label classification project. + public partial class MultiLabelClassEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal MultiLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal MultiLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MultiLabelClassEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..14ba7f8385b3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class MultiLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("classes"u8); + writer.WriteStartObject(); + foreach (var item in Classes) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MultiLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static MultiLabelClassificationEvaluationSummary DeserializeMultiLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary classes = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, MultiLabelClassEvaluationSummary.DeserializeMultiLabelClassEvaluationSummary(property0.Value, options)); + } + classes = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MultiLabelClassificationEvaluationSummary( + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + MultiLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MultiLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMultiLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..b0c0a54ed86f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a multi-label classification project. + public partial class MultiLabelClassificationEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// is null. + internal MultiLabelClassificationEvaluationSummary(IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(classes, nameof(classes)); + + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal MultiLabelClassificationEvaluationSummary(IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MultiLabelClassificationEvaluationSummary() + { + } + + /// Represents the classes evaluation. + public IReadOnlyDictionary Classes { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..d10a139fae67 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class PrebuiltEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WritePropertyName("examples"u8); + writer.WriteStringValue(Examples); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrebuiltEntity(document.RootElement, options); + } + + internal static PrebuiltEntity DeserializePrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + string description = default; + string examples = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("examples"u8)) + { + examples = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{options.Format}' format."); + } + } + + PrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrebuiltEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PrebuiltEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePrebuiltEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.cs new file mode 100644 index 000000000000..f03feb9f25e0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/PrebuiltEntity.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a supported prebuilt entity. + public partial class PrebuiltEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The description. + /// English examples for the entity. + /// or is null. + internal PrebuiltEntity(string description, string examples) + { + Argument.AssertNotNull(description, nameof(description)); + Argument.AssertNotNull(examples, nameof(examples)); + + Description = description; + Examples = examples; + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// Keeps track of any properties unknown to the library. + internal PrebuiltEntity(string category, string description, string examples, IDictionary serializedAdditionalRawData) + { + Category = category; + Description = description; + Examples = examples; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrebuiltEntity() + { + } + + /// The prebuilt entity category. + public string Category { get; } + /// The description. + public string Description { get; } + /// English examples for the entity. + public string Examples { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs new file mode 100644 index 000000000000..db31db0899db --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ProjectDeletionJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectDeletionJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectDeletionJobState(document.RootElement, options); + } + + internal static ProjectDeletionJobState DeserializeProjectDeletionJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectDeletionJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support writing '{options.Format}' format."); + } + } + + ProjectDeletionJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectDeletionJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectDeletionJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectDeletionJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectDeletionJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.cs new file mode 100644 index 000000000000..fb15e24680aa --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeletionJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a project deletion job. + public partial class ProjectDeletionJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal ProjectDeletionJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal ProjectDeletionJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectDeletionJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs new file mode 100644 index 000000000000..cb308a7742e2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ProjectDeployment : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("assignedResources"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectDeployment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectDeployment(document.RootElement, options); + } + + internal static ProjectDeployment DeserializeProjectDeployment(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + string modelTrainingConfigVersion = default; + IReadOnlyList assignedResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentResource.DeserializeDeploymentResource(item, options)); + } + assignedResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{options.Format}' format."); + } + } + + ProjectDeployment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectDeployment(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectDeployment FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectDeployment(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.cs new file mode 100644 index 000000000000..80bbd68c4530 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectDeployment.cs @@ -0,0 +1,112 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents a project deployment. + public partial class ProjectDeployment + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// , or is null. + internal ProjectDeployment(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IEnumerable assignedResources) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + Argument.AssertNotNull(assignedResources, nameof(assignedResources)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources.ToList(); + } + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// Keeps track of any properties unknown to the library. + internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectDeployment() + { + } + + /// Represents deployment name. + public string DeploymentName { get; } + /// Represents deployment modelId. + public string ModelId { get; } + /// Represents deployment last trained time. + public DateTimeOffset LastTrainedDateTime { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + /// Represents model training config version. + public string ModelTrainingConfigVersion { get; } + /// Represents the metadata of the assigned Azure resources. + public IReadOnlyList AssignedResources { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectKind.cs new file mode 100644 index 000000000000..1128b63342ac --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectKind.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The ProjectKind. + public readonly partial struct ProjectKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProjectKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomSingleLabelClassificationValue = "CustomSingleLabelClassification"; + private const string CustomMultiLabelClassificationValue = "CustomMultiLabelClassification"; + private const string CustomEntityRecognitionValue = "CustomEntityRecognition"; + private const string CustomAbstractiveSummarizationValue = "CustomAbstractiveSummarization"; + private const string CustomHealthcareValue = "CustomHealthcare"; + private const string CustomTextSentimentValue = "CustomTextSentiment"; + + /// For building a classification model to classify text using your own data. Each file will have only one label. For example, file 1 is classified as A and file 2 is classified as B. + public static ProjectKind CustomSingleLabelClassification { get; } = new ProjectKind(CustomSingleLabelClassificationValue); + /// For building a classification model to classify text using your own data. Each file can have one or many labels. For example, file 1 is classified as A, B, and C and file 2 is classified as B and C. + public static ProjectKind CustomMultiLabelClassification { get; } = new ProjectKind(CustomMultiLabelClassificationValue); + /// For building an extraction model to identify your domain categories using your own data. + public static ProjectKind CustomEntityRecognition { get; } = new ProjectKind(CustomEntityRecognitionValue); + /// For building an abstractive summarization models which are able to summarize long documents. + public static ProjectKind CustomAbstractiveSummarization { get; } = new ProjectKind(CustomAbstractiveSummarizationValue); + /// For building an text analytics for health model to identify your health domain data. + public static ProjectKind CustomHealthcare { get; } = new ProjectKind(CustomHealthcareValue); + /// For building a sentiment models which are able to extract sentiment for long documents. + public static ProjectKind CustomTextSentiment { get; } = new ProjectKind(CustomTextSentimentValue); + /// Determines if two values are the same. + public static bool operator ==(ProjectKind left, ProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProjectKind left, ProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProjectKind(string value) => new ProjectKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProjectKind other && Equals(other); + /// + public bool Equals(ProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs new file mode 100644 index 000000000000..a8445499979d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ProjectMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastModifiedDateTime"u8); + writer.WriteStringValue(LastModifiedDateTime, "O"); + if (Optional.IsDefined(LastTrainedDateTime)) + { + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime.Value, "O"); + } + if (Optional.IsDefined(LastDeployedDateTime)) + { + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime.Value, "O"); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + if (options.Format != "W") + { + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + } + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectMetadata(document.RootElement, options); + } + + internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastModifiedDateTime = default; + DateTimeOffset? lastTrainedDateTime = default; + DateTimeOffset? lastDeployedDateTime = default; + ProjectKind projectKind = default; + string storageInputContainerName = default; + ProjectSettings settings = default; + string projectName = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedDateTime"u8)) + { + lastModifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{options.Format}' format."); + } + } + + ProjectMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.cs new file mode 100644 index 000000000000..3f8cb7abb7f0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectMetadata.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the metadata of a project. + public partial class ProjectMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// The project kind. + /// The storage container name. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// or is null. + internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, ProjectKind projectKind, string storageInputContainerName, string language) + { + Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); + Argument.AssertNotNull(language, nameof(language)); + + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, DateTimeOffset? lastTrainedDateTime, DateTimeOffset? lastDeployedDateTime, ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Settings = settings; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectMetadata() + { + } + + /// Represents the project creation datetime. + public DateTimeOffset CreatedDateTime { get; } + /// Represents the project last modification datetime. + public DateTimeOffset LastModifiedDateTime { get; } + /// Represents the project last training datetime. + public DateTimeOffset? LastTrainedDateTime { get; } + /// Represents the project last deployment datetime. + public DateTimeOffset? LastDeployedDateTime { get; } + /// The project kind. + public ProjectKind ProjectKind { get; } + /// The storage container name. + public string StorageInputContainerName { get; } + /// The project settings. + public ProjectSettings Settings { get; } + /// The new project name. + public string ProjectName { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; } + /// The project description. + public string Description { get; } + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs new file mode 100644 index 000000000000..87f03016db1e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ProjectSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConfidenceThreshold)) + { + writer.WritePropertyName("confidenceThreshold"u8); + writer.WriteNumberValue(ConfidenceThreshold.Value); + } + if (Optional.IsDefined(AmlProjectPath)) + { + writer.WritePropertyName("amlProjectPath"u8); + writer.WriteStringValue(AmlProjectPath); + } + if (Optional.IsDefined(IsLabelingLocked)) + { + writer.WritePropertyName("isLabelingLocked"u8); + writer.WriteBooleanValue(IsLabelingLocked.Value); + } + if (Optional.IsDefined(RunGptPredictions)) + { + writer.WritePropertyName("runGptPredictions"u8); + writer.WriteBooleanValue(RunGptPredictions.Value); + } + if (Optional.IsDefined(GptPredictiveLookahead)) + { + writer.WritePropertyName("gptPredictiveLookahead"u8); + writer.WriteNumberValue(GptPredictiveLookahead.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectSettings(document.RootElement, options); + } + + internal static ProjectSettings DeserializeProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? confidenceThreshold = default; + string amlProjectPath = default; + bool? isLabelingLocked = default; + bool? runGptPredictions = default; + int? gptPredictiveLookahead = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confidenceThreshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceThreshold = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("amlProjectPath"u8)) + { + amlProjectPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLabelingLocked"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLabelingLocked = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("runGptPredictions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runGptPredictions = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("gptPredictiveLookahead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gptPredictiveLookahead = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectSettings( + confidenceThreshold, + amlProjectPath, + isLabelingLocked, + runGptPredictions, + gptPredictiveLookahead, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{options.Format}' format."); + } + } + + ProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectSettings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectSettings(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.cs new file mode 100644 index 000000000000..201efeaf3dbd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectSettings.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the settings used to define the project behavior. + public partial class ProjectSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ProjectSettings() + { + } + + /// Initializes a new instance of . + /// The threshold of the class with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. + /// The path to the AML connected project. + /// Indicates whether the labeling experience can be modified or not. + /// Indicates whether to run GPT predictions or not. + /// The predictive lookahead for GPT predictions that is specified by the user. + /// Keeps track of any properties unknown to the library. + internal ProjectSettings(float? confidenceThreshold, string amlProjectPath, bool? isLabelingLocked, bool? runGptPredictions, int? gptPredictiveLookahead, IDictionary serializedAdditionalRawData) + { + ConfidenceThreshold = confidenceThreshold; + AmlProjectPath = amlProjectPath; + IsLabelingLocked = isLabelingLocked; + RunGptPredictions = runGptPredictions; + GptPredictiveLookahead = gptPredictiveLookahead; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The threshold of the class with the highest confidence, at which the prediction will automatically be changed to "None". The value of the threshold should be between 0 and 1 inclusive. + public float? ConfidenceThreshold { get; set; } + /// The path to the AML connected project. + public string AmlProjectPath { get; set; } + /// Indicates whether the labeling experience can be modified or not. + public bool? IsLabelingLocked { get; set; } + /// Indicates whether to run GPT predictions or not. + public bool? RunGptPredictions { get; set; } + /// The predictive lookahead for GPT predictions that is specified by the user. + public int? GptPredictiveLookahead { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs new file mode 100644 index 000000000000..85ce49210c58 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ProjectTrainedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastTrainingDurationInSeconds"u8); + writer.WriteNumberValue(LastTrainingDurationInSeconds); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("hasSnapshot"u8); + writer.WriteBooleanValue(HasSnapshot); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectTrainedModel(document.RootElement, options); + } + + internal static ProjectTrainedModel DeserializeProjectTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string label = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + int lastTrainingDurationInSeconds = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + bool hasSnapshot = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainingDurationInSeconds"u8)) + { + lastTrainingDurationInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hasSnapshot"u8)) + { + hasSnapshot = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectTrainedModel( + label, + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{options.Format}' format."); + } + } + + ProjectTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectTrainedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectTrainedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectTrainedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.cs new file mode 100644 index 000000000000..18f8ba677a75 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ProjectTrainedModel.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a trained model. + public partial class ProjectTrainedModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// or is null. + internal ProjectTrainedModel(string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + } + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// Keeps track of any properties unknown to the library. + internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) + { + Label = label; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectTrainedModel() + { + } + + /// The trained model label. + public string Label { get; } + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The duration of the model's last training request in seconds. + public int LastTrainingDurationInSeconds { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + /// The flag to indicate if the trained model has a snapshot ready. + public bool HasSnapshot { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs new file mode 100644 index 000000000000..1baccdd06335 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class ResourceMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + writer.WritePropertyName("customDomain"u8); + writer.WriteStringValue(CustomDomain); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceMetadata(document.RootElement, options); + } + + internal static ResourceMetadata DeserializeResourceMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + string customDomain = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customDomain"u8)) + { + customDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceMetadata(azureResourceId, customDomain, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{options.Format}' format."); + } + } + + ResourceMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResourceMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResourceMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.cs new file mode 100644 index 000000000000..b7c65fd38a96 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/ResourceMetadata.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents metadata for the Azure resource.. + public partial class ResourceMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the Azure resource ID. + /// Represents the Azure resource custom domain. + /// Represents the Azure resource region. + /// , or is null. + public ResourceMetadata(string azureResourceId, string customDomain, string region) + { + Argument.AssertNotNull(azureResourceId, nameof(azureResourceId)); + Argument.AssertNotNull(customDomain, nameof(customDomain)); + Argument.AssertNotNull(region, nameof(region)); + + AzureResourceId = azureResourceId; + CustomDomain = customDomain; + Region = region; + } + + /// Initializes a new instance of . + /// Represents the Azure resource ID. + /// Represents the Azure resource custom domain. + /// Represents the Azure resource region. + /// Keeps track of any properties unknown to the library. + internal ResourceMetadata(string azureResourceId, string customDomain, string region, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + CustomDomain = customDomain; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResourceMetadata() + { + } + + /// Represents the Azure resource ID. + public string AzureResourceId { get; } + /// Represents the Azure resource custom domain. + public string CustomDomain { get; } + /// Represents the Azure resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..76bafc3c7a2d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSentimentEvaluationSummary(document.RootElement, options); + } + + internal static SentimentEvaluationSummary DeserializeSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SentimentEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SentimentEvaluationSummary.cs new file mode 100644 index 000000000000..02a73f988602 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SentimentEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a sentiment in a custom sentiment project. + public partial class SentimentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal SentimentEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal SentimentEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SentimentEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..a51b799bec80 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SingleLabelClassEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SingleLabelClassEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleLabelClassEvaluationSummary(document.RootElement, options); + } + + internal static SingleLabelClassEvaluationSummary DeserializeSingleLabelClassEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SingleLabelClassEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleLabelClassEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SingleLabelClassEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSingleLabelClassEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassEvaluationSummary.cs new file mode 100644 index 000000000000..2a2e041f9d7a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a class in a single-label classification project. + public partial class SingleLabelClassEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal SingleLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal SingleLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SingleLabelClassEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..c917409f2951 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SingleLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("classes"u8); + writer.WriteStartObject(); + foreach (var item in Classes) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SingleLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static SingleLabelClassificationEvaluationSummary DeserializeSingleLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary classes = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("classes"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, SingleLabelClassEvaluationSummary.DeserializeSingleLabelClassEvaluationSummary(property0.Value, options)); + } + classes = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleLabelClassificationEvaluationSummary( + confusionMatrix, + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SingleLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SingleLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSingleLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..3a735be43129 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom single-label classification project. + public partial class SingleLabelClassificationEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the confusion matrix between two classes (the two classes can be the same). The matrix is between the class that was labelled and the class that was predicted. + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// or is null. + internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(classes, nameof(classes)); + + ConfusionMatrix = confusionMatrix; + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two classes (the two classes can be the same). The matrix is between the class that was labelled and the class that was predicted. + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SingleLabelClassificationEvaluationSummary() + { + } + + /// Represents the confusion matrix between two classes (the two classes can be the same). The matrix is between the class that was labelled and the class that was predicted. + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the classes evaluation. + public IReadOnlyDictionary Classes { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..8d1f2520c7be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SpanSentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("sentiments"u8); + writer.WriteStartObject(); + foreach (var item in Sentiments) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SpanSentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpanSentimentEvaluationSummary(document.RootElement, options); + } + + internal static SpanSentimentEvaluationSummary DeserializeSpanSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary sentiments = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("sentiments"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, SentimentEvaluationSummary.DeserializeSentimentEvaluationSummary(property0.Value, options)); + } + sentiments = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpanSentimentEvaluationSummary( + confusionMatrix, + sentiments, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SpanSentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpanSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SpanSentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSpanSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs new file mode 100644 index 000000000000..7bb8d1d8d726 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SpanSentimentEvaluationSummary.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom sentiment project. + public partial class SpanSentimentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the confusion matrix between two sentiments (the two sentiments can be the same). The matrix is between the sentiment that was labelled and the sentiment that was predicted. + /// Represents the sentiment evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// or is null. + internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(sentiments, nameof(sentiments)); + + ConfusionMatrix = confusionMatrix; + Sentiments = sentiments; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two sentiments (the two sentiments can be the same). The matrix is between the sentiment that was labelled and the sentiment that was predicted. + /// Represents the sentiment evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Sentiments = sentiments; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SpanSentimentEvaluationSummary() + { + } + + /// Represents the confusion matrix between two sentiments (the two sentiments can be the same). The matrix is between the sentiment that was labelled and the sentiment that was predicted. + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the sentiment evaluation. + public IReadOnlyDictionary Sentiments { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/StringIndexType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/StringIndexType.cs new file mode 100644 index 000000000000..fefd32f82ab1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/StringIndexType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The StringIndexType. + 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 Utf16CodeUnitValue = "Utf16CodeUnit"; + + /// The offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript. + 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs new file mode 100644 index 000000000000..692f5394699a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SubTrainingJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete); + if (Optional.IsDefined(StartDateTime)) + { + writer.WritePropertyName("startDateTime"u8); + writer.WriteStringValue(StartDateTime.Value, "O"); + } + if (Optional.IsDefined(EndDateTime)) + { + writer.WritePropertyName("endDateTime"u8); + writer.WriteStringValue(EndDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SubTrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubTrainingJobState(document.RootElement, options); + } + + internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int percentComplete = default; + DateTimeOffset? startDateTime = default; + DateTimeOffset? endDateTime = default; + JobStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("percentComplete"u8)) + { + percentComplete = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{options.Format}' format."); + } + } + + SubTrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSubTrainingJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SubTrainingJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSubTrainingJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.cs new file mode 100644 index 000000000000..da27123aa226 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SubTrainingJobState.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the detailed state of a training sub-operation. + public partial class SubTrainingJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the status of the sub-operation. + internal SubTrainingJobState(int percentComplete, JobStatus status) + { + PercentComplete = percentComplete; + Status = status; + } + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the start date time. + /// Represents the end date time. + /// Represents the status of the sub-operation. + /// Keeps track of any properties unknown to the library. + internal SubTrainingJobState(int percentComplete, DateTimeOffset? startDateTime, DateTimeOffset? endDateTime, JobStatus status, IDictionary serializedAdditionalRawData) + { + PercentComplete = percentComplete; + StartDateTime = startDateTime; + EndDateTime = endDateTime; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SubTrainingJobState() + { + } + + /// Represents progress percentage. + public int PercentComplete { get; } + /// Represents the start date time. + public DateTimeOffset? StartDateTime { get; } + /// Represents the end date time. + public DateTimeOffset? EndDateTime { get; } + /// Represents the status of the sub-operation. + public JobStatus Status { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs new file mode 100644 index 000000000000..4b9ed7f539a1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SupportedLanguage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("languageName"u8); + writer.WriteStringValue(LanguageName); + } + writer.WritePropertyName("languageCode"u8); + writer.WriteStringValue(LanguageCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SupportedLanguage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSupportedLanguage(document.RootElement, options); + } + + internal static SupportedLanguage DeserializeSupportedLanguage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string languageName = default; + string languageCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("languageName"u8)) + { + languageName = property.Value.GetString(); + continue; + } + if (property.NameEquals("languageCode"u8)) + { + languageCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{options.Format}' format."); + } + } + + SupportedLanguage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSupportedLanguage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SupportedLanguage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSupportedLanguage(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.cs new file mode 100644 index 000000000000..ca301a1aafee --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SupportedLanguage.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a supported language. + public partial class SupportedLanguage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// is null. + internal SupportedLanguage(string languageCode) + { + Argument.AssertNotNull(languageCode, nameof(languageCode)); + + LanguageCode = languageCode; + } + + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal SupportedLanguage(string languageName, string languageCode, IDictionary serializedAdditionalRawData) + { + LanguageName = languageName; + LanguageCode = languageCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SupportedLanguage() + { + } + + /// The language name. + public string LanguageName { get; } + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + public string LanguageCode { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs new file mode 100644 index 000000000000..9f6daa985967 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SwapDeploymentsDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("firstDeploymentName"u8); + writer.WriteStringValue(FirstDeploymentName); + writer.WritePropertyName("secondDeploymentName"u8); + writer.WriteStringValue(SecondDeploymentName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwapDeploymentsDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsDetails(document.RootElement, options); + } + + internal static SwapDeploymentsDetails DeserializeSwapDeploymentsDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string firstDeploymentName = default; + string secondDeploymentName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("firstDeploymentName"u8)) + { + firstDeploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondDeploymentName"u8)) + { + secondDeploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwapDeploymentsDetails(firstDeploymentName, secondDeploymentName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSwapDeploymentsDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SwapDeploymentsDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs new file mode 100644 index 000000000000..7c9948cf6222 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options for swapping two deployments together. + public partial class SwapDeploymentsDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the first deployment name. + /// Represents the second deployment name. + /// or is null. + public SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName) + { + Argument.AssertNotNull(firstDeploymentName, nameof(firstDeploymentName)); + Argument.AssertNotNull(secondDeploymentName, nameof(secondDeploymentName)); + + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + } + + /// Initializes a new instance of . + /// Represents the first deployment name. + /// Represents the second deployment name. + /// Keeps track of any properties unknown to the library. + internal SwapDeploymentsDetails(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) + { + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsDetails() + { + } + + /// Represents the first deployment name. + public string FirstDeploymentName { get; } + /// Represents the second deployment name. + public string SecondDeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs new file mode 100644 index 000000000000..dde6e28f3bc7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class SwapDeploymentsJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwapDeploymentsJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsJobState(document.RootElement, options); + } + + internal static SwapDeploymentsJobState DeserializeSwapDeploymentsJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwapDeploymentsJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSwapDeploymentsJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SwapDeploymentsJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs new file mode 100644 index 000000000000..76a22023a980 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/SwapDeploymentsJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a deployment job. + public partial class SwapDeploymentsJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal SwapDeploymentsJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal SwapDeploymentsJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs new file mode 100644 index 000000000000..639bd57d140b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TextAnalysisAuthoringError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TextAnalysisAuthoringError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextAnalysisAuthoringError(document.RootElement, options); + } + + internal static TextAnalysisAuthoringError DeserializeTextAnalysisAuthoringError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorCode code = default; + string message = default; + string target = default; + IReadOnlyList details = default; + InnerErrorModel innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = new ErrorCode(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(DeserializeTextAnalysisAuthoringError(item, options)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = InnerErrorModel.DeserializeInnerErrorModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextAnalysisAuthoringError( + code, + message, + target, + details ?? new ChangeTrackingList(), + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support writing '{options.Format}' format."); + } + } + + TextAnalysisAuthoringError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextAnalysisAuthoringError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextAnalysisAuthoringError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextAnalysisAuthoringError(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.cs new file mode 100644 index 000000000000..15dff55f6060 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringError.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The error object. + public partial class TextAnalysisAuthoringError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// is null. + internal TextAnalysisAuthoringError(ErrorCode code, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal TextAnalysisAuthoringError(ErrorCode code, string message, string target, IReadOnlyList details, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Target = target; + Details = details; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TextAnalysisAuthoringError() + { + } + + /// One of a server-defined set of error codes. + public ErrorCode 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 InnerErrorModel Innererror { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringSentiment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringSentiment.cs new file mode 100644 index 000000000000..07d7c9165af7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringSentiment.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// The TextAnalysisAuthoringSentiment. + public readonly partial struct TextAnalysisAuthoringSentiment : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextAnalysisAuthoringSentiment(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PositiveValue = "positive"; + private const string NegativeValue = "negative"; + private const string NeutralValue = "neutral"; + + /// positive. + public static TextAnalysisAuthoringSentiment Positive { get; } = new TextAnalysisAuthoringSentiment(PositiveValue); + /// negative. + public static TextAnalysisAuthoringSentiment Negative { get; } = new TextAnalysisAuthoringSentiment(NegativeValue); + /// neutral. + public static TextAnalysisAuthoringSentiment Neutral { get; } = new TextAnalysisAuthoringSentiment(NeutralValue); + /// Determines if two values are the same. + public static bool operator ==(TextAnalysisAuthoringSentiment left, TextAnalysisAuthoringSentiment right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAnalysisAuthoringSentiment left, TextAnalysisAuthoringSentiment right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAnalysisAuthoringSentiment(string value) => new TextAnalysisAuthoringSentiment(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAnalysisAuthoringSentiment other && Equals(other); + /// + public bool Equals(TextAnalysisAuthoringSentiment other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs new file mode 100644 index 000000000000..80e627120fa3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TextAnalysisAuthoringWarning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TextAnalysisAuthoringWarning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextAnalysisAuthoringWarning(document.RootElement, options); + } + + internal static TextAnalysisAuthoringWarning DeserializeTextAnalysisAuthoringWarning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextAnalysisAuthoringWarning(code, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support writing '{options.Format}' format."); + } + } + + TextAnalysisAuthoringWarning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextAnalysisAuthoringWarning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextAnalysisAuthoringWarning FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextAnalysisAuthoringWarning(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.cs new file mode 100644 index 000000000000..cfea09f1cf4d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextAnalysisAuthoringWarning.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a warning that was encountered while executing the request. + public partial class TextAnalysisAuthoringWarning + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// or is null. + internal TextAnalysisAuthoringWarning(string code, string message) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + } + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// Keeps track of any properties unknown to the library. + internal TextAnalysisAuthoringWarning(string code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TextAnalysisAuthoringWarning() + { + } + + /// The warning code. + public string Code { get; } + /// The warning message. + public string Message { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..912d38014e63 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TextSentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("spanSentimentsEvaluation"u8); + writer.WriteObjectValue(SpanSentimentsEvaluation, options); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TextSentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextSentimentEvaluationSummary(document.RootElement, options); + } + + internal static TextSentimentEvaluationSummary DeserializeTextSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SpanSentimentEvaluationSummary spanSentimentsEvaluation = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("spanSentimentsEvaluation"u8)) + { + spanSentimentsEvaluation = SpanSentimentEvaluationSummary.DeserializeSpanSentimentEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextSentimentEvaluationSummary( + spanSentimentsEvaluation, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + TextSentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextSentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextSentimentEvaluationSummary.cs new file mode 100644 index 000000000000..b26aef8f4bcb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TextSentimentEvaluationSummary.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the evaluation summary for a custom text sentiment project. + public partial class TextSentimentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents evaluation of span level sentiments. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// is null. + internal TextSentimentEvaluationSummary(SpanSentimentEvaluationSummary spanSentimentsEvaluation, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(spanSentimentsEvaluation, nameof(spanSentimentsEvaluation)); + + SpanSentimentsEvaluation = spanSentimentsEvaluation; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents evaluation of span level sentiments. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// Keeps track of any properties unknown to the library. + internal TextSentimentEvaluationSummary(SpanSentimentEvaluationSummary spanSentimentsEvaluation, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + SpanSentimentsEvaluation = spanSentimentsEvaluation; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TextSentimentEvaluationSummary() + { + } + + /// Represents evaluation of span level sentiments. + public SpanSentimentEvaluationSummary SpanSentimentsEvaluation { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + public float MicroPrecision { get; } + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + public float MacroPrecision { get; } + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs new file mode 100644 index 000000000000..cc67acb26600 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TrainingConfigVersion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersionProperty); + } + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingConfigVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingConfigVersion(document.RootElement, options); + } + + internal static TrainingConfigVersion DeserializeTrainingConfigVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainingConfigVersion = default; + DateTimeOffset modelExpirationDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingConfigVersion(trainingConfigVersion, modelExpirationDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{options.Format}' format."); + } + } + + TrainingConfigVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingConfigVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingConfigVersion FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingConfigVersion(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.cs new file mode 100644 index 000000000000..439f9952112a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingConfigVersion.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents a training config version. + public partial class TrainingConfigVersion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the training config version expiration date. + internal TrainingConfigVersion(DateTimeOffset modelExpirationDate) + { + ModelExpirationDate = modelExpirationDate; + } + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// Keeps track of any properties unknown to the library. + internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate, IDictionary serializedAdditionalRawData) + { + TrainingConfigVersionProperty = trainingConfigVersionProperty; + ModelExpirationDate = modelExpirationDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingConfigVersion() + { + } + + /// Represents the version of the config. + public string TrainingConfigVersionProperty { get; } + /// Represents the training config version expiration date. + public DateTimeOffset ModelExpirationDate { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs new file mode 100644 index 000000000000..4b9afd2b96e2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TrainingJobDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + if (Optional.IsDefined(EvaluationOptions)) + { + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + } + if (Optional.IsDefined(DataGenerationSettings)) + { + writer.WritePropertyName("dataGenerationSettings"u8); + writer.WriteObjectValue(DataGenerationSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingJobDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobDetails(document.RootElement, options); + } + + internal static TrainingJobDetails DeserializeTrainingJobDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + EvaluationDetails evaluationOptions = default; + DataGenerationSettings dataGenerationSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (property.NameEquals("dataGenerationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataGenerationSettings = DataGenerationSettings.DeserializeDataGenerationSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.cs new file mode 100644 index 000000000000..2f80cac3f016 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobDetails.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the options for starting a new training job. + public partial class TrainingJobDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// or is null. + public TrainingJobDetails(string modelLabel, string trainingConfigVersion) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + /// Represents the settings for using data generation as part of training a custom model. + /// Keeps track of any properties unknown to the library. + internal TrainingJobDetails(string modelLabel, string trainingConfigVersion, EvaluationDetails evaluationOptions, DataGenerationSettings dataGenerationSettings, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + EvaluationOptions = evaluationOptions; + DataGenerationSettings = dataGenerationSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobDetails() + { + } + + /// Represents the output model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + public EvaluationDetails EvaluationOptions { get; set; } + /// Represents the settings for using data generation as part of training a custom model. + public DataGenerationSettings DataGenerationSettings { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs new file mode 100644 index 000000000000..d349f1b2beb4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TrainingJobResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + writer.WritePropertyName("trainingStatus"u8); + writer.WriteObjectValue(TrainingStatus, options); + if (Optional.IsDefined(EvaluationStatus)) + { + writer.WritePropertyName("evaluationStatus"u8); + writer.WriteObjectValue(EvaluationStatus, options); + } + if (Optional.IsDefined(EstimatedEndDateTime)) + { + writer.WritePropertyName("estimatedEndDateTime"u8); + writer.WriteStringValue(EstimatedEndDateTime.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobResult(document.RootElement, options); + } + + internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + SubTrainingJobState trainingStatus = default; + SubTrainingJobState evaluationStatus = default; + DateTimeOffset? estimatedEndDateTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingStatus"u8)) + { + trainingStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + continue; + } + if (property.NameEquals("evaluationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + continue; + } + if (property.NameEquals("estimatedEndDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedEndDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingStatus, + evaluationStatus, + estimatedEndDateTime, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.cs new file mode 100644 index 000000000000..189d1d1c5a27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobResult.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the output of a training job. + public partial class TrainingJobResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents model train status. + /// , or is null. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + Argument.AssertNotNull(trainingStatus, nameof(trainingStatus)); + + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingStatus = trainingStatus; + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents model train status. + /// Represents model evaluation status. + /// Represents the estimate end date time for training and evaluation. + /// Keeps track of any properties unknown to the library. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus, SubTrainingJobState evaluationStatus, DateTimeOffset? estimatedEndDateTime, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingStatus = trainingStatus; + EvaluationStatus = evaluationStatus; + EstimatedEndDateTime = estimatedEndDateTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobResult() + { + } + + /// Represents trained model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents model train status. + public SubTrainingJobState TrainingStatus { get; } + /// Represents model evaluation status. + public SubTrainingJobState EvaluationStatus { get; } + /// Represents the estimate end date time for training and evaluation. + public DateTimeOffset? EstimatedEndDateTime { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs new file mode 100644 index 000000000000..4955c000e750 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class TrainingJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobState(document.RootElement, options); + } + + internal static TrainingJobState DeserializeTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + TrainingJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = TrainingJobResult.DeserializeTrainingJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.cs new file mode 100644 index 000000000000..70273a6d0a8b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/TrainingJobState.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a training job. + public partial class TrainingJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents training tasks detailed result. + /// is null. + internal TrainingJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, TrainingJobResult result) + { + Argument.AssertNotNull(result, nameof(result)); + + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// Keeps track of any properties unknown to the library. + internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents training tasks detailed result. + public TrainingJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs new file mode 100644 index 000000000000..7af5951389dc --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class UnassignDeploymentResourcesDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UnassignDeploymentResourcesDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnassignDeploymentResourcesDetails(document.RootElement, options); + } + + internal static UnassignDeploymentResourcesDetails DeserializeUnassignDeploymentResourcesDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedResourceIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnassignDeploymentResourcesDetails(assignedResourceIds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support writing '{options.Format}' format."); + } + } + + UnassignDeploymentResourcesDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnassignDeploymentResourcesDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UnassignDeploymentResourcesDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnassignDeploymentResourcesDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs new file mode 100644 index 000000000000..d124017054e1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesDetails.cs @@ -0,0 +1,76 @@ +// 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.Language.Text.Authoring.Models +{ + /// Represents the options to unassign Azure resources from a project. + public partial class UnassignDeploymentResourcesDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the assigned resource IDs to be unassigned. + /// is null. + public UnassignDeploymentResourcesDetails(IEnumerable assignedResourceIds) + { + Argument.AssertNotNull(assignedResourceIds, nameof(assignedResourceIds)); + + AssignedResourceIds = assignedResourceIds.ToList(); + } + + /// Initializes a new instance of . + /// Represents the assigned resource IDs to be unassigned. + /// Keeps track of any properties unknown to the library. + internal UnassignDeploymentResourcesDetails(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UnassignDeploymentResourcesDetails() + { + } + + /// Represents the assigned resource IDs to be unassigned. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.Serialization.cs new file mode 100644 index 000000000000..ec140802f56a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.Serialization.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + public partial class UnassignDeploymentResourcesJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + } + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UnassignDeploymentResourcesJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnassignDeploymentResourcesJobState(document.RootElement, options); + } + + internal static UnassignDeploymentResourcesJobState DeserializeUnassignDeploymentResourcesJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + 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("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnassignDeploymentResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support writing '{options.Format}' format."); + } + } + + UnassignDeploymentResourcesJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnassignDeploymentResourcesJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UnassignDeploymentResourcesJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnassignDeploymentResourcesJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.cs new file mode 100644 index 000000000000..b37cfe90d944 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnassignDeploymentResourcesJobState.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Represents the state of a unassign deployment resources job. + public partial class UnassignDeploymentResourcesJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal UnassignDeploymentResourcesJobState(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal UnassignDeploymentResourcesJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UnassignDeploymentResourcesJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..4d412ce70bd5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + internal partial class UnknownDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + + internal static UnknownDocumentEvaluationResult DeserializeUnknownDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.cs new file mode 100644 index 000000000000..8b2d8e34dd8e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownDocumentEvaluationResult.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Unknown version of DocumentEvaluationResult. + internal partial class UnknownDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Keeps track of any properties unknown to the library. + internal UnknownDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) : base(projectKind, location, language, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDocumentEvaluationResult() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..d8bec44da2be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + internal partial class UnknownEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationSummary(document.RootElement, options); + } + + internal static UnknownEvaluationSummary DeserializeUnknownEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + EvaluationDetails evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationDetails.DeserializeEvaluationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.cs new file mode 100644 index 000000000000..11bd4629143a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownEvaluationSummary.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Unknown version of EvaluationSummary. + internal partial class UnknownEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + internal UnknownEvaluationSummary(ProjectKind projectKind, EvaluationDetails evaluationOptions, IDictionary serializedAdditionalRawData) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownEvaluationSummary() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..90a43b0d5610 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + internal partial class UnknownExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + + internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownExportedProjectAssets(projectKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs new file mode 100644 index 000000000000..590bfa73caf5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/Models/UnknownExportedProjectAssets.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Text.Authoring.Models +{ + /// Unknown version of ExportedProjectAssets. + internal partial class UnknownExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal UnknownExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownExportedProjectAssets() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs new file mode 100644 index 000000000000..9a10c2fd530f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAnalysisAuthoring.cs @@ -0,0 +1,6705 @@ +// 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; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Text.Authoring +{ + // Data plane generated sub-client. + /// The TextAnalysisAuthoring sub-client. + public partial class TextAnalysisAuthoring + { + 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 TextAnalysisAuthoring for mocking. + protected TextAnalysisAuthoring() + { + } + + /// Initializes a new instance of TextAnalysisAuthoring. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// The API version to use for this operation. + internal TextAnalysisAuthoring(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); + return Response.FromValue(ProjectMetadata.FromResponse(response), response); + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProject(projectName, context); + return Response.FromValue(ProjectMetadata.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// 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 new project 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 GetProjectAsync(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// 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 new project 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 GetProject(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] The most basic operation that applies to a resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project 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 response returned from the service. + /// + public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] The most basic operation that applies to a resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project 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 response returned from the service. + /// + public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CopyProjectAuthorizationAsync(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CopyProjectAuthorizationAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(CopyProjectDetails.FromResponse(response), response); + } + + /// Generates a copy project operation authorization to the current target Azure resource. + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// Whether to allow an existing project to be overwritten using the resulting copy authorization. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CopyProjectAuthorization(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CopyProjectAuthorization(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); + return Response.FromValue(CopyProjectDetails.FromResponse(response), response); + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure 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 new project 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 response returned from the service. + /// + public virtual async Task CopyProjectAuthorizationAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProjectAuthorization"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure 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 new project 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 response returned from the service. + /// + public virtual Response CopyProjectAuthorization(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProjectAuthorization"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(CopyProjectJobState.FromResponse(response), response); + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetCopyProjectStatus(projectName, jobId, context); + return Response.FromValue(CopyProjectJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetCopyProjectStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); + return Response.FromValue(ProjectDeployment.FromResponse(response), response); + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeployment(projectName, deploymentName, context); + return Response.FromValue(ProjectDeployment.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetDeployment(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(DeploymentDeleteFromResourcesJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(DeploymentJobState.FromResponse(response), response); + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(DeploymentJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// 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 new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSwapDeploymentsStatus(projectName, jobId, context); + return Response.FromValue(SwapDeploymentsJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ExportProjectJobState.FromResponse(response), response); + } + + /// Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportStatus(projectName, jobId, context); + return Response.FromValue(ExportProjectJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project metadata, and assets. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModel(projectName, exportedModelName, context); + return Response.FromValue(ExportedTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportedModel(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ExportedModelJobState.FromResponse(response), response); + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); + return Response.FromValue(ExportedModelJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported 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. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details and URL needed to download the exported model. + /// The name of the project to use. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelManifestAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelManifestAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(ExportedModelManifest.FromResponse(response), response); + } + + /// Gets the details and URL needed to download the exported model. + /// The name of the project to use. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelManifest(projectName, exportedModelName, context); + return Response.FromValue(ExportedModelManifest.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details and URL needed to download the exported 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. + /// + /// + /// + /// + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportedModelManifestAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelManifest"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details and URL needed to download the exported 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. + /// + /// + /// + /// + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetExportedModelManifest(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelManifest"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(ImportProjectJobState.FromResponse(response), response); + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetImportStatus(projectName, jobId, context); + return Response.FromValue(ImportProjectJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetImportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetImportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainedModel(projectName, trainedModelLabel, context); + return Response.FromValue(ProjectTrainedModel.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a trained 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. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a trained 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. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, 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 an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, 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 an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(EvaluationJobState.FromResponse(response), response); + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(EvaluationJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(LoadSnapshotJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or 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 GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(AssignDeploymentResourcesJobState.FromResponse(response), response); + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(AssignDeploymentResourcesJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing unassign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(UnassignDeploymentResourcesJobState.FromResponse(response), response); + } + + /// Gets the status of an existing unassign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(UnassignDeploymentResourcesJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(TrainingJobState.FromResponse(response), response); + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingStatus(projectName, jobId, context); + return Response.FromValue(TrainingJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// 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 new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetTrainingStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); + return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProjectDeletionStatus(jobId, context); + return Response.FromValue(ProjectDeletionJobState.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// 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 job ID. + /// 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 GetProjectDeletionStatusAsync(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// 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 job ID. + /// 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 GetProjectDeletionStatus(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// 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 number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// 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 number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DocumentEvaluationResult.DeserializeDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// The new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DocumentEvaluationResult.DeserializeDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// 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 GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// 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 new project name. + /// The trained model label. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// 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 GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// 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 new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 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 GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetAssignedResourceDeployments(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// 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 number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't return deployments belonging to projects owned by this resource. It only returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// 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 number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// Lists the supported languages. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetSupportedLanguagesAsync(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// Lists the supported languages. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetSupportedLanguages(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported languages. + /// + /// + /// + /// 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 project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetSupportedLanguagesAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported languages. + /// + /// + /// + /// 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 project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetSupportedLanguages(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// Lists the supported prebuilt entities that can be used while creating composed entities. + /// The cancellation token to use. + /// + public virtual Pageable GetSupportedPrebuiltEntities(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// 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 GetSupportedPrebuiltEntitiesAsync(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed entities. + /// + /// + /// + /// 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 GetSupportedPrebuiltEntities(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// Lists the support training config version for a given project type. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetTrainingConfigVersionsAsync(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + /// Lists the support training config version for a given project type. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetTrainingConfigVersions(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// 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 project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetTrainingConfigVersionsAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// 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 project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// 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 GetTrainingConfigVersions(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).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 a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Copies an existing project to another Azure resource. + /// 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 name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Copies an existing project to another Azure resource. + /// 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 name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, CopyProjectDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CopyProject(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Copies an existing project to another Azure 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. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Copies an existing project to another Azure 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. + /// + /// + /// + /// + /// 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 name of the project to use. + /// 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 CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to export a project's data. + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); + } + + /// Triggers a job to export a project's data. + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return Export(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context); + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// 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 ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// 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 name of the project to use. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit". + /// Kind of asset to export. + /// Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy. + /// 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 Export(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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 name of the project to use. + /// The project data to import. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, ExportedProject body, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportAsync(waitUntil, projectName, content, format, context).ConfigureAwait(false); + } + + /// Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// 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 name of the project to use. + /// The project data to import. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Import(WaitUntil waitUntil, string projectName, ExportedProject body, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return Import(waitUntil, projectName, content, format, context); + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// 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 name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// 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 ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already exists, the data of that project is replaced. + /// + /// + /// + /// 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 name of the project to use. + /// The content to send as the body of the request. + /// The format of the project to import. The currently supported formats are json and aml formats. If not provided, the default is set to json. + /// 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 Import(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a training job for a project. + /// 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 name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.Train"); + } + + /// Triggers a training job for a project. + /// 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 name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Train(WaitUntil waitUntil, string projectName, TrainingJobDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = Train(waitUntil, projectName, content, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.Train"); + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// 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 name of the project to use. + /// 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> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// 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 name of the project to use. + /// 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 Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new deployment or replaces an existing one. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Creates a new deployment or replaces an existing one. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeployProject(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + 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 a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).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 a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Deletes a project deployment from the specified assigned resources. + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// 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 name of the project to use. + /// The name of the specific deployment of the project to use. + /// 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. + /// or 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 DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Swaps two existing deployments with each other. + /// 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 name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Swaps two existing deployments with each other. + /// 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 name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, SwapDeploymentsDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return SwapDeployments(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// 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 name of the project to use. + /// 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 SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// 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 name of the project to use. + /// 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 SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new exported model or replaces an existing one. + /// 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 name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); + } + + /// Creates a new exported model or replaces an existing one. + /// 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 name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The exported 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. + /// or 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 CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// 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 name of the project to use. + /// The exported 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. + /// or 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 CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + 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 an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).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 an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers evaluation operation on a trained 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel"); + } + + /// Triggers evaluation operation on a trained 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. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel"); + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained 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 name of the project to use. + /// The trained model label. + /// 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. + /// or 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> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained 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 name of the project to use. + /// The trained model label. + /// 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. + /// or 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 EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + 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] Long-running operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).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] Long-running operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// 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 name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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 name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory. + /// 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 name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return AssignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// 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 name of the project to use. + /// 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 AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to them. This API is available only via AAD authentication and not supported via subscription key authentication. For more details about AAD authentication, check here: https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// 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 name of the project to use. + /// 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 AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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 name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// 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 name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesDetails body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return UnassignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// 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 name of the project to use. + /// 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 UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// 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 name of the project to use. + /// 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 UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a cancellation for a running training job. + /// 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 name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob"); + } + + /// Triggers a cancellation for a running training job. + /// 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 name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob"); + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// 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 name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// 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 name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCopyProjectAuthorizationRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:authorize-copy", 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 CreateCopyProjectRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:copy", 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 CreateExportRequest(string projectName, string stringIndexType, string assetKind, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + if (trainedModelLabel != null) + { + uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string format, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (format != null) + { + request.Headers.Add("format", format); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateTrainRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:train", 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 CreateGetCopyProjectStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/copy/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentRequest(string projectName, string deploymentName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + 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 CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/:delete-from-resources", 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 CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/delete-from-resources/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSwapDeploymentsRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/:swap", 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 CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/swap/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/export/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + 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 CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelManifestRequest(string projectName, string exportedModelName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/manifest", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/import/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:evaluate", 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 CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:load-snapshot", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluate/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/result", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/summary-result", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/load-snapshot/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:assign", 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 CreateUnassignDeploymentResourcesRequest(string projectName, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:unassign", 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 CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/assign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/unassign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/:cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/deletion-jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/deployments/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/languages", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (projectKind != null) + { + uri.AppendQuery("projectKind", projectKind, true); + } + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/prebuilt-entities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/training-config-versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (projectKind != null) + { + uri.AppendQuery("projectKind", projectKind, true); + } + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, 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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(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("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, 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("/language", 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 _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + + private TrainingJobResult FetchTrainingJobResultFromTrainingJobState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TrainingJobResult.DeserializeTrainingJobResult(resultJsonElement); + } + + private EvaluationJobResult FetchEvaluationJobResultFromEvaluationJobState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return EvaluationJobResult.DeserializeEvaluationJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringClientBuilderExtensions.cs new file mode 100644 index 000000000000..85f27fd9c059 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringClientBuilderExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; + +namespace Azure.AI.Language.Text.Authoring +{ + /// Extension methods to add to client builder. + public static partial class TextAuthoringClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new AuthoringClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// Supported Cognitive Services endpoint e.g., https://<resource-name>.api.cognitiveservices.azure.com. + public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new AuthoringClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs new file mode 100644 index 000000000000..c23161239b66 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/Generated/TextAuthoringModelFactory.cs @@ -0,0 +1,1142 @@ +// 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.AI.Language.Text.Authoring.Models; + +namespace Azure.AI.Language.Text.Authoring +{ + /// Model factory for models. + public static partial class TextAuthoringModelFactory + { + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static ProjectMetadata ProjectMetadata(DateTimeOffset createdDateTime = default, DateTimeOffset lastModifiedDateTime = default, DateTimeOffset? lastTrainedDateTime = null, DateTimeOffset? lastDeployedDateTime = null, ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 TextAnalysisAuthoringError TextAnalysisAuthoringError(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) + { + details ??= new List(); + + return new TextAnalysisAuthoringError( + code, + message, + target, + details?.ToList(), + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// Error details. + /// Error target. + /// An object containing more specific information than the current object about the error. + /// A new instance for mocking. + public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, string message = null, IReadOnlyDictionary details = null, string target = null, InnerErrorModel innererror = null) + { + details ??= new Dictionary(); + + return new InnerErrorModel( + code, + message, + details, + target, + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// The project language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static CreateProjectDetails CreateProjectDetails(ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new CreateProjectDetails( + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ProjectDeletionJobState ProjectDeletionJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ProjectDeletionJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// A new instance for mocking. + public static TextAnalysisAuthoringWarning TextAnalysisAuthoringWarning(string code = null, string message = null) + { + return new TextAnalysisAuthoringWarning(code, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static CopyProjectJobState CopyProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new CopyProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// A new instance for mocking. + public static ExportProjectJobState ExportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUrl = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ExportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + resultUrl, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// Specifies the method used to interpret string offsets. For additional information see https://aka.ms/text-analytics-offsets. + /// Represents the project metadata. + /// + /// Represents the project assets. + /// 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 . + /// + /// A new instance for mocking. + public static ExportedProject ExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, CreateProjectDetails metadata = null, ExportedProjectAssets assets = null) + { + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the summary file location in the blob store container associated with the project. + /// The location of the document in the storage. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static ExportedCustomAbstractiveSummarizationDocument ExportedCustomAbstractiveSummarizationDocument(string summaryLocation = null, string location = null, string language = null, string dataset = null) + { + return new ExportedCustomAbstractiveSummarizationDocument(summaryLocation, location, language, dataset, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ImportProjectJobState ImportProjectJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ImportProjectJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20. + /// Represents the settings for using data generation as part of training a custom model. + /// A new instance for mocking. + public static TrainingJobDetails TrainingJobDetails(string modelLabel = null, string trainingConfigVersion = null, EvaluationDetails evaluationOptions = null, DataGenerationSettings dataGenerationSettings = null) + { + return new TrainingJobDetails(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// A new instance for mocking. + public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) + { + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents model train status. + /// Represents model evaluation status. + /// Represents the estimate end date time for training and evaluation. + /// A new instance for mocking. + public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, SubTrainingJobState trainingStatus = null, SubTrainingJobState evaluationStatus = null, DateTimeOffset? estimatedEndDateTime = null) + { + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingStatus, + evaluationStatus, + estimatedEndDateTime, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the start date time. + /// Represents the end date time. + /// Represents the status of the sub-operation. + /// A new instance for mocking. + public static SubTrainingJobState SubTrainingJobState(int percentComplete = default, DateTimeOffset? startDateTime = null, DateTimeOffset? endDateTime = null, JobStatus status = default) + { + return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// A new instance for mocking. + public static TrainingJobState TrainingJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new TrainingJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// A new instance for mocking. + public static ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) + { + assignedResources ??= new List(); + + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// A new instance for mocking. + public static DeploymentResource DeploymentResource(string resourceId = null, string region = null) + { + return new DeploymentResource(resourceId, region, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the trained model label. + /// Represents the resource IDs to be assigned to the deployment. If provided, the deployment will be rolled out to the resources provided here as well as the original resource in which the project is created. + /// A new instance for mocking. + public static CreateDeploymentDetails CreateDeploymentDetails(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + { + assignedResourceIds ??= new List(); + + return new CreateDeploymentDetails(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentJobState DeploymentJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static DeploymentDeleteFromResourcesJobState DeploymentDeleteFromResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new DeploymentDeleteFromResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static SwapDeploymentsJobState SwapDeploymentsJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new SwapDeploymentsJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// A new instance for mocking. + public static ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastExportedModelDateTime = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null) + { + return new ExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static ExportedModelJobState ExportedModelJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new ExportedModelJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The model files belonging to this model. + /// A new instance for mocking. + public static ExportedModelManifest ExportedModelManifest(IEnumerable modelFiles = null) + { + modelFiles ??= new List(); + + return new ExportedModelManifest(modelFiles?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the file. + /// The URI to retrieve the content of the file. + /// A new instance for mocking. + public static ModelFile ModelFile(string name = null, Uri contentUri = null) + { + return new ModelFile(name, contentUri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// A new instance for mocking. + public static ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) + { + return new ProjectTrainedModel( + label, + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// A new instance for mocking. + public static EvaluationJobResult EvaluationJobResult(EvaluationDetails evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) + { + return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents evaluation task detailed result. + /// A new instance for mocking. + public static EvaluationJobState EvaluationJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, EvaluationJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new EvaluationJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static LoadSnapshotJobState LoadSnapshotJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new LoadSnapshotJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static DocumentEvaluationResult DocumentEvaluationResult(string projectKind = null, string location = null, string language = null) + { + return new UnknownDocumentEvaluationResult(projectKind == null ? default : new ProjectKind(projectKind), location, language, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for entity recognition. + /// A new instance for mocking. + public static CustomEntityRecognitionDocumentEvaluationResult CustomEntityRecognitionDocumentEvaluationResult(string location = null, string language = null, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = null) + { + return new CustomEntityRecognitionDocumentEvaluationResult(ProjectKind.CustomEntityRecognition, location, language, serializedAdditionalRawData: null, customEntityRecognitionResult); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// A new instance for mocking. + public static DocumentEntityRecognitionEvaluationResult DocumentEntityRecognitionEvaluationResult(IEnumerable entities = null) + { + entities ??= new List(); + + return new DocumentEntityRecognitionEvaluationResult(entities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the region's expected entity labels. + /// Represents the region's predicted entity labels. + /// Represents the region offset. + /// Represents the region length. + /// A new instance for mocking. + public static DocumentEntityRegionEvaluationResult DocumentEntityRegionEvaluationResult(IEnumerable expectedEntities = null, IEnumerable predictedEntities = null, int regionOffset = default, int regionLength = default) + { + expectedEntities ??= new List(); + predictedEntities ??= new List(); + + return new DocumentEntityRegionEvaluationResult(expectedEntities?.ToList(), predictedEntities?.ToList(), regionOffset, regionLength, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// A new instance for mocking. + public static DocumentEntityLabelEvaluationResult DocumentEntityLabelEvaluationResult(string category = null, int offset = default, int length = default) + { + return new DocumentEntityLabelEvaluationResult(category, offset, length, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for entity recognition. + /// A new instance for mocking. + public static CustomHealthcareDocumentEvaluationResult CustomHealthcareDocumentEvaluationResult(string location = null, string language = null, DocumentHealthcareEvaluationResult customHealthcareResult = null) + { + return new CustomHealthcareDocumentEvaluationResult(ProjectKind.CustomHealthcare, location, language, serializedAdditionalRawData: null, customHealthcareResult); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// A new instance for mocking. + public static DocumentHealthcareEvaluationResult DocumentHealthcareEvaluationResult(IEnumerable entities = null) + { + entities ??= new List(); + + return new DocumentHealthcareEvaluationResult(entities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for multi label classification. + /// A new instance for mocking. + public static CustomMultiLabelClassificationDocumentEvaluationResult CustomMultiLabelClassificationDocumentEvaluationResult(string location = null, string language = null, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = null) + { + return new CustomMultiLabelClassificationDocumentEvaluationResult(ProjectKind.CustomMultiLabelClassification, location, language, serializedAdditionalRawData: null, customMultiLabelClassificationResult); + } + + /// Initializes a new instance of . + /// Represents the document's expected classes. + /// Represents the document's predicted classes. + /// A new instance for mocking. + public static DocumentMultiLabelClassificationEvaluationResult DocumentMultiLabelClassificationEvaluationResult(IEnumerable expectedClasses = null, IEnumerable predictedClasses = null) + { + expectedClasses ??= new List(); + predictedClasses ??= new List(); + + return new DocumentMultiLabelClassificationEvaluationResult(expectedClasses?.ToList(), predictedClasses?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for single label classification. + /// A new instance for mocking. + public static CustomSingleLabelClassificationDocumentEvaluationResult CustomSingleLabelClassificationDocumentEvaluationResult(string location = null, string language = null, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = null) + { + return new CustomSingleLabelClassificationDocumentEvaluationResult(ProjectKind.CustomSingleLabelClassification, location, language, serializedAdditionalRawData: null, customSingleLabelClassificationResult); + } + + /// Initializes a new instance of . + /// Represents the document's expected class. + /// Represents the document's predicted class. + /// A new instance for mocking. + public static DocumentSingleLabelClassificationEvaluationResult DocumentSingleLabelClassificationEvaluationResult(string expectedClass = null, string predictedClass = null) + { + return new DocumentSingleLabelClassificationEvaluationResult(expectedClass, predictedClass, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// Represents the document language. This is BCP-47 representation of a language. For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// Represents the evaluation prediction for text sentiment. + /// A new instance for mocking. + public static CustomTextSentimentDocumentEvaluationResult CustomTextSentimentDocumentEvaluationResult(string location = null, string language = null, DocumentTextSentimentEvaluationResult customTextSentimentResult = null) + { + return new CustomTextSentimentDocumentEvaluationResult(ProjectKind.CustomTextSentiment, location, language, serializedAdditionalRawData: null, customTextSentimentResult); + } + + /// Initializes a new instance of . + /// Represents the document's expected sentiment labels. + /// Represents the document's predicted sentiment labels. + /// A new instance for mocking. + public static DocumentTextSentimentEvaluationResult DocumentTextSentimentEvaluationResult(IEnumerable expectedSentimentSpans = null, IEnumerable predictedSentimentSpans = null) + { + expectedSentimentSpans ??= new List(); + predictedSentimentSpans ??= new List(); + + return new DocumentTextSentimentEvaluationResult(expectedSentimentSpans?.ToList(), predictedSentimentSpans?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the sentiment category. + /// Represents the sentiment offset index relative to the original text. + /// Represents the sentiment length. + /// A new instance for mocking. + public static DocumentSentimentLabelEvaluationResult DocumentSentimentLabelEvaluationResult(TextAnalysisAuthoringSentiment category = default, int offset = default, int length = default) + { + return new DocumentSentimentLabelEvaluationResult(category, offset, length, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// A new instance for mocking. + public static EvaluationSummary EvaluationSummary(string projectKind = null, EvaluationDetails evaluationOptions = null) + { + return new UnknownEvaluationSummary(projectKind == null ? default : new ProjectKind(projectKind), evaluationOptions, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to extraction evaluation. + /// A new instance for mocking. + public static CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluationSummary(EvaluationDetails evaluationOptions = null, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null) + { + return new CustomEntityRecognitionEvaluationSummary(ProjectKind.CustomEntityRecognition, evaluationOptions, serializedAdditionalRawData: null, customEntityRecognitionEvaluation); + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two entities (the two entities can be the same). The matrix is between the entity that was labelled and the entity that was predicted. + /// Represents the entities evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + entities ??= new Dictionary(); + + return new EntityRecognitionEvaluationSummary( + confusionMatrix, + entities, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static ConfusionMatrix ConfusionMatrix(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new ConfusionMatrix(additionalProperties); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static ConfusionMatrixRow ConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new ConfusionMatrixRow(additionalProperties); + } + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + /// A new instance for mocking. + public static ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = default, float rawValue = default) + { + return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static EntityEvaluationSummary EntityEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new EntityEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to health care evaluation. + /// A new instance for mocking. + public static CustomHealthcareEvaluationSummary CustomHealthcareEvaluationSummary(EvaluationDetails evaluationOptions = null, EntityRecognitionEvaluationSummary customHealthcareEvaluation = null) + { + return new CustomHealthcareEvaluationSummary(ProjectKind.CustomHealthcare, evaluationOptions, serializedAdditionalRawData: null, customHealthcareEvaluation); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to multi label classification evaluation. + /// A new instance for mocking. + public static CustomMultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions = null, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = null) + { + return new CustomMultiLabelClassificationEvaluationSummary(ProjectKind.CustomMultiLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customMultiLabelClassificationEvaluation); + } + + /// Initializes a new instance of . + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static MultiLabelClassificationEvaluationSummary MultiLabelClassificationEvaluationSummary(IReadOnlyDictionary classes = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + classes ??= new Dictionary(); + + return new MultiLabelClassificationEvaluationSummary( + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static MultiLabelClassEvaluationSummary MultiLabelClassEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new MultiLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to single label classification evaluation. + /// A new instance for mocking. + public static CustomSingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluationSummary(EvaluationDetails evaluationOptions = null, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = null) + { + return new CustomSingleLabelClassificationEvaluationSummary(ProjectKind.CustomSingleLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customSingleLabelClassificationEvaluation); + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two classes (the two classes can be the same). The matrix is between the class that was labelled and the class that was predicted. + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static SingleLabelClassificationEvaluationSummary SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary classes = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + classes ??= new Dictionary(); + + return new SingleLabelClassificationEvaluationSummary( + confusionMatrix, + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static SingleLabelClassEvaluationSummary SingleLabelClassEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new SingleLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to custom sentiment evaluation. + /// A new instance for mocking. + public static CustomTextSentimentEvaluationSummary CustomTextSentimentEvaluationSummary(EvaluationDetails evaluationOptions = null, TextSentimentEvaluationSummary customTextSentimentEvaluation = null) + { + return new CustomTextSentimentEvaluationSummary(ProjectKind.CustomTextSentiment, evaluationOptions, serializedAdditionalRawData: null, customTextSentimentEvaluation); + } + + /// Initializes a new instance of . + /// Represents evaluation of span level sentiments. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static TextSentimentEvaluationSummary TextSentimentEvaluationSummary(SpanSentimentEvaluationSummary spanSentimentsEvaluation = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + return new TextSentimentEvaluationSummary( + spanSentimentsEvaluation, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the confusion matrix between two sentiments (the two sentiments can be the same). The matrix is between the sentiment that was labelled and the sentiment that was predicted. + /// Represents the sentiment evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the micro recall. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro precision. Expected value is a float between 0 and 1 inclusive. + /// Represents the macro recall. Expected value is a float between 0 and 1 inclusive. + /// A new instance for mocking. + public static SpanSentimentEvaluationSummary SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary sentiments = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + sentiments ??= new Dictionary(); + + return new SpanSentimentEvaluationSummary( + confusionMatrix, + sentiments, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static SentimentEvaluationSummary SentimentEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new SentimentEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// A new instance for mocking. + public static AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) + { + return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static AssignDeploymentResourcesJobState AssignDeploymentResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new AssignDeploymentResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static UnassignDeploymentResourcesJobState UnassignDeploymentResourcesJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new UnassignDeploymentResourcesJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// A new instance for mocking. + public static AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) + { + deploymentsMetadata ??= new List(); + + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// A new instance for mocking. + public static AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default) + { + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The language name. + /// The language code. This is BCP-47 representation of a language. For example, "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// A new instance for mocking. + public static SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) + { + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// A new instance for mocking. + public static PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) + { + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// A new instance for mocking. + public static TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, DateTimeOffset modelExpirationDate = default) + { + return new TrainingConfigVersion(trainingConfigVersionProperty, modelExpirationDate, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringAudience.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringAudience.cs new file mode 100644 index 000000000000..90be4e9d7ad2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringAudience.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Text.Authoring +{ + /// Cloud audiences available for Text Authoring. + internal readonly partial struct TextAuthoringAudience : IEquatable + { + private readonly string _value; + + /// + /// Initializes a new instance of the object. + /// + /// The Azure Active Directory audience to use when forming authorization scopes. For the Text Authoring service, this value corresponds to a URL that identifies the Azure cloud where the resource is located. For more information: . + /// is null. + /// Please use one of the constant members over creating a custom value unless you have special needs for doing so. + public TextAuthoringAudience(string value) + { + Argument.AssertNotNullOrEmpty(value, nameof(value)); + _value = value; + } + + private const string AzureChinaValue = "https://cognitiveservices.azure.cn"; + private const string AzureGovernmentValue = "https://cognitiveservices.azure.us"; + private const string AzurePublicCloudValue = "https://cognitiveservices.azure.com"; + + /// Azure China. + public static TextAuthoringAudience AzureChina { get; } = new TextAuthoringAudience(AzureChinaValue); + + /// Azure Government. + public static TextAuthoringAudience AzureGovernment { get; } = new TextAuthoringAudience(AzureGovernmentValue); + + /// Azure Public Cloud. + public static TextAuthoringAudience AzurePublicCloud { get; } = new TextAuthoringAudience(AzurePublicCloudValue); + + /// Determines if two values are the same. + public static bool operator ==(TextAuthoringAudience left, TextAuthoringAudience right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAuthoringAudience left, TextAuthoringAudience right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TextAuthoringAudience(string value) => new TextAuthoringAudience(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAuthoringAudience other && Equals(other); + /// + public bool Equals(TextAuthoringAudience 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/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringClientBuilderExtensions.cs new file mode 100644 index 000000000000..3c7a07649a09 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringClientBuilderExtensions.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + /// Extension methods to add to client builder. + [CodeGenModel("AILanguageTextAuthoringClientBuilderExtensions")] + public static partial class TextAuthoringClientBuilderExtensions + { + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringModelFactory.cs new file mode 100644 index 000000000000..313152eeaa77 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/TextAuthoringModelFactory.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.AI.Language.Text.Authoring +{ + /// Model factory for Text Authoring models. + [CodeGenModel("AILanguageTextAuthoringModelFactory")] + public static partial class TextAuthoringModelFactory + { + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/properties/AssemblyInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..ab14f9f3ef72 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/src/properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +// Replace with test project/test project public key and uncomment to make internal members visible to +// your test project. If not needed, this can be deleted. +// [assembly: InternalsVisibleTo("Azure.AI.Language.Text.Authoring.Generated.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Cognitivelanguage")] diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/AuthoringClientTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/AuthoringClientTest.cs new file mode 100644 index 000000000000..cc9afdd748b1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/AuthoringClientTest.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests +{ + public class AuthoringClientTest: RecordedTestBase + { + public AuthoringClientTest(bool isAsync) : base(isAsync) + { + } + + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/TemplateClientLiveTests.cs to write tests. */ + + [RecordedTest] + public void TestOperation() + { + Assert.IsTrue(true); + } + + #region Helpers + + private static BinaryData GetContentFromResponse(Response r) + { + // Workaround azure/azure-sdk-for-net#21048, which prevents .Content from working when dealing with responses + // from the playback system. + + MemoryStream ms = new MemoryStream(); + r.ContentStream.CopyTo(ms); + return new BinaryData(ms.ToArray()); + } + #endregion + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Azure.AI.Language.Text.Authoring.Tests.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Azure.AI.Language.Text.Authoring.Tests.csproj new file mode 100644 index 000000000000..4ce6438d0bdb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Azure.AI.Language.Text.Authoring.Tests.csproj @@ -0,0 +1,21 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs new file mode 100644 index 000000000000..8dec7c7ae587 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs @@ -0,0 +1,6356 @@ +// 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.AI.Language.Text.Authoring.Models; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Samples +{ + public partial class Samples_TextAnalysisAuthoring + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }); + Response response = client.CreateProject("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }); + Response response = await client.CreateProjectAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_CreateProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }); + Response response = client.CreateProject("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_CreateProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }); + Response response = await client.CreateProjectAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + }); + Response response = client.CopyProjectAuthorization("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + }); + Response response = await client.CopyProjectAuthorizationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, + }); + Response response = client.CopyProjectAuthorization("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, + }); + Response response = await client.CopyProjectAuthorizationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("resultUrl").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("resultUrl").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetProjects(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetAssignedResourceDeployments(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetAssignedResourceDeployments(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedLanguages(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedLanguagesAsync(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (SupportedLanguage item in client.GetSupportedLanguages()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedLanguages("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedLanguagesAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (SupportedLanguage item in client.GetSupportedLanguages(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingConfigVersions(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingConfigVersions("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = client.CopyProject(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = client.CopyProject(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = client.CopyProject(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = client.CopyProject(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectDetails body = new CopyProjectDetails( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); + Operation operation = client.Import(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "")); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { +new +{ +summaryLocation = "", +location = "", +language = "", +dataset = "", +} + }, + projectKind = "CustomAbstractiveSummarization", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { +new +{ +summaryLocation = "", +location = "", +language = "", +dataset = "", +} + }, + projectKind = "CustomAbstractiveSummarization", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") + { + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", + }) + { + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") +{ +Location = "", +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = client.Import(WaitUntil.Completed, "", body, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectDetails(ProjectKind.CustomSingleLabelClassification, "", "", "") + { + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", + }) + { + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") +{ +Location = "", +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + }); + Operation operation = client.Train(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + }); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", ""); + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", ""); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, + }); + Operation operation = client.Train(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, + }); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", "") + { + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), + }; + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobDetails body = new TrainingJobDetails("", "") + { + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), + }; + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails(""); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails(""); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentDetails body = new CreateDeploymentDetails("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails(); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails(); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentDetails body = new DeleteDeploymentDetails + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsDetails body = new SwapDeploymentsDetails("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelDetails body = new ExportedModelDetails(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails(); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails(); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }; + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationDetails body = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }; + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_LoadSnapshot_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_LoadSnapshot_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_LoadSnapshot_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_LoadSnapshot_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesDetails body = new AssignDeploymentResourcesDetails(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesDetails body = new UnassignDeploymentResourcesDetails(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new AuthoringClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/AuthoringClientTestEnvironment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/AuthoringClientTestEnvironment.cs new file mode 100644 index 000000000000..5c9144cbb70d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/AuthoringClientTestEnvironment.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.TestFramework; + +namespace Azure.AI.Language.Text.Authoring.Tests +{ + public class AuthoringClientTestEnvironment : TestEnvironment + { + public Uri Endpoint => new(GetRecordedVariable("AZURE_TEXT_AUTHORING_ENDPOINT")); + + public string ApiKey => GetRecordedVariable("AZURE_TEXT_AUTHORING_KEY", options => options.IsSecret()); + + public string CTProjectName => GetRecordedVariable("AZURE_TEXT_AUTHORING_CUSTOM_PROJECT"); + + public string CTDeploymentName => GetRecordedVariable("AZURE_TEXT_AUTHORING_CUSTOM_DEPLOYMENT"); + + public string CSCProjectName => GetRecordedVariable("AZURE_TEXT_AUTHORING_SINGLE_CLASSIFICATION_PROJECT"); + + public string CSCDeploymentName => GetRecordedVariable("AZURE_TEXT_AUTHORING_SINGLE_CLASSIFICATION_DEPLOYMENT"); + + public string CMCProjectName => GetRecordedVariable("AZURE_TEXT_AUTHORING_MULTI_CLASSIFICATION_PROJECT"); + + public string CMCDeploymentName => GetRecordedVariable("AZURE_TEXT_AUTHORING_MULTI_CLASSIFICATION_DEPLOYMENT"); + + public string ProjectDescription => GetRecordedVariable("AZURE_TEXT_AUTHORING_PROJECT_DESCRIPTION"); + + public string ProjectLanguage => GetRecordedVariable("AZURE_TEXT_AUTHORING_PROJECT_LANGUAGE"); + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs new file mode 100644 index 000000000000..a0e5affe3340 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Infrastructure/TextAuthoringTestBase.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; + +namespace Azure.AI.Language.Text.Authoring.Tests +{ + /// + /// Base class for live client tests using different service versions for Text Authoring. + /// + /// The type of client being tested. + [ClientTestFixture( + AuthoringClientOptions.ServiceVersion.V2023_04_01, + AuthoringClientOptions.ServiceVersion.V2023_04_15_Preview, + AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview + )] + [IgnoreServiceError(429, "429")] + public abstract class TextAuthoringTestBase : RecordedTestBase + { + protected TextAuthoringTestBase(bool isAsync, AuthoringClientOptions.ServiceVersion serviceVersion, RecordedTestMode? mode) + : base(isAsync, mode) + { + CompareBodies = false; + + SanitizedHeaders.Add("Ocp-Apim-Subscription-Key"); + ServiceVersion = serviceVersion; + } + + /// + /// Gets an instrumented client of type . + /// + protected TextAnalysisAuthoring client { get; private set; } + + /// + /// Gets the service version used for this instance of the test fixture. + /// + protected AuthoringClientOptions.ServiceVersion ServiceVersion { get; } + + /// + /// Creates the once tests begin. + /// + public override async Task StartTestRecordingAsync() + { + await base.StartTestRecordingAsync(); + + AuthoringClientOptions options = new(ServiceVersion); + var authoringClient = CreateClient( + TestEnvironment.Endpoint, + new AzureKeyCredential(TestEnvironment.ApiKey), + InstrumentClientOptions(options)); + client = authoringClient.GetTextAnalysisAuthoringClient(); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs new file mode 100644 index 000000000000..e5af485ce221 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/CreateClient.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core.TestFramework; +using NUnit.Framework; +#region Snippet:TextAuthoring_Identity_Namespace +using Azure.Identity; +using Azure.Core; +#endregion + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class CreateClient : SamplesBase + { + [Test] + public void CreateAuthoringClientForSpecificApiVersion() + { + #region Snippet:CreateTextAuthoringClientForSpecificApiVersion + Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); + AzureKeyCredential credential = new("your apikey"); +#if !SNIPPET + endpoint = TestEnvironment.Endpoint; + credential = new(TestEnvironment.ApiKey); +#endif + AuthoringClientOptions options = new AuthoringClientOptions(AuthoringClientOptions.ServiceVersion.V2024_11_15_Preview); + AuthoringClient client = new AuthoringClient(endpoint, credential, options); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + #endregion + } + + [Test] + public void AuthoringClient_CreateWithDefaultAzureCredential() + { + #region Snippet:TextAnalysisAuthoring_CreateWithDefaultAzureCredential + Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +#if !SNIPPET + endpoint = TestEnvironment.Endpoint; +#endif + DefaultAzureCredential credential = new DefaultAzureCredential(); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + #endregion + } + + [Test] + public void BadArgument() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:TextAuthoringClient_BadRequest + try + { + string invalidProjectName = "InvalidProject"; + + var projectData = new + { + projectName = invalidProjectName, + language = "invalid-lang", // Invalid language code + projectKind = "Text", + description = "This is a test for invalid configuration." + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = authoringClient.CreateProject(invalidProjectName, content); + } + catch (RequestFailedException ex) + { + Console.WriteLine(ex.ToString()); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/README.md new file mode 100644 index 000000000000..767798c5f248 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/README.md @@ -0,0 +1,3 @@ +Source files in this directory are written as tests from which samples are extracted. +They are not intended to be viewed directly and help ensure our samples compile and work correctly. +See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/samples) for more explanation about how to use this client library. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProject.cs new file mode 100644 index 000000000000..d87c7d11f14f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProject.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample10_TextAuthoring_DeployProject : SamplesBase + { + [Test] + [SyncOnly] + public void DeployProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample10_TextAuthoring_DeployProject + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + var deploymentDetails = new CreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = authoringClient.DeployProject( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName, + body: deploymentDetails + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProjectAsync.cs new file mode 100644 index 000000000000..a44a4e8fbe39 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample10_TextAuthoring_DeployProjectAsync.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample10_TextAuthoring_DeployProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeployProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample10_TextAuthoring_DeployProjectAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentName"; + var deploymentConfig = new CreateDeploymentDetails(trainedModelLabel: "29886710a2ae49259d62cffca977db66"); + + Operation operation = await authoringClient.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName, + body: deploymentConfig + ); + + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeployments.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeployments.cs new file mode 100644 index 000000000000..fc0c0ee8aac8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeployments.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample11_TextAuthoring_SwapDeployments : SamplesBase + { + [Test] + [SyncOnly] + public void SwapDeployments() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample11_TextAuthoring_SwapDeployments + string projectName = "LoanAgreements"; + var swapDetails = new SwapDeploymentsDetails( + firstDeploymentName: "DeploymentA", + secondDeploymentName: "DeploymentB" + ); + + Operation operation = authoringClient.SwapDeployments( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails + ); + + Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful swap."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeploymentsAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeploymentsAsync.cs new file mode 100644 index 000000000000..64fb8eb9d454 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample11_TextAuthoring_SwapDeploymentsAsync.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample11_TextAuthoring_SwapDeploymentsAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task SwapDeploymentsAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample11_TextAuthoring_SwapDeploymentsAsync + string projectName = "LoanAgreements"; + var swapDetails = new SwapDeploymentsDetails + ( + firstDeploymentName: "DeploymentA", + secondDeploymentName: "DeploymentB" + ); + + Operation operation = await authoringClient.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails + ); + + Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful swap."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeployment.cs new file mode 100644 index 000000000000..874f80ecdb58 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeployment.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample12_TextAuthoring_DeleteDeployment : SamplesBase + { + [Test] + [SyncOnly] + public void DeleteDeployment() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample12_TextAuthoring_DeleteDeployment + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentA"; + + Operation operation = authoringClient.DeleteDeployment( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName + ); + + Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate successful deletion."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeploymentAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeploymentAsync.cs new file mode 100644 index 000000000000..989f00d116a8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample12_TextAuthoring_DeleteDeploymentAsync.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample12_TextAuthoring_DeleteDeploymentAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeleteDeploymentAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample12_TextAuthoring_DeleteDeploymentAsync + string projectName = "LoanAgreements"; + string deploymentName = "DeploymentA"; + + Operation operation = await authoringClient.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName + ); + + Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate successful deletion."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProject.cs new file mode 100644 index 000000000000..47f14fa6c5a2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProject.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample1_TextAuthoring_GetProject : SamplesBase + { + [Test] + [SyncOnly] + public void GetProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample1_TextAuthoring_GetProject + string projectName = "MyTextProject"; + + Response response = authoringClient.GetProject(projectName); + ProjectMetadata projectMetadata = response.Value; + + Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); + Console.WriteLine($"Language: {projectMetadata.Language}"); + Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); + Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); + Console.WriteLine($"Description: {projectMetadata.Description}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProjectAsync.cs new file mode 100644 index 000000000000..8a17915d1cf6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample1_TextAuthoring_GetProjectAsync.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample1_TextAuthoring_GetProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task GetProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample1_TextAuthoring_GetProjectAsync + string projectName = "MyTextProjectAsync"; + + Response response = await authoringClient.GetProjectAsync(projectName); + ProjectMetadata projectMetadata = response.Value; + + Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); + Console.WriteLine($"Language: {projectMetadata.Language}"); + Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); + Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); + Console.WriteLine($"Description: {projectMetadata.Description}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs new file mode 100644 index 000000000000..1a926e7fe167 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_Import.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Reflection.Emit; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample2_TextAuthoring_Import : SamplesBase + { + [Test] + [SyncOnly] + public void Import() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample2_TextAuthoring_Import + string projectName = "LoanAgreements"; + + var projectMetadata = new CreateProjectDetails( + projectKind: "CustomEntityRecognition", + storageInputContainerName: "loanagreements", + projectName: projectName, + language: "en" + ) + { + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false, + Settings = new ProjectSettings() + }; + + var projectAssets = new ExportedCustomEntityRecognitionProjectAssets + { + Entities = + { + new ExportedEntity + { + Category = "Date" + }, + new ExportedEntity + { + Category = "LenderName" + }, + new ExportedEntity + { + Category = "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } + }; + + var exportedProject = new ExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata + ) + { + Assets = projectAssets + }; + + Operation operation = authoringClient.Import( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs new file mode 100644 index 000000000000..1139b3946aae --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample2_TextAuthoring_ImportAsync.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample2_TextAuthoring_ImportAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task ImportAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample2_TextAuthoring_ImportAsync + string projectName = "LoanAgreements"; + + var projectMetadata = new CreateProjectDetails( + projectKind: "CustomEntityRecognition", + storageInputContainerName: "loanagreements", + projectName: projectName, + language: "en" + ) + { + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false, + Settings = new ProjectSettings() + }; + + var projectAssets = new ExportedCustomEntityRecognitionProjectAssets + { + Entities = + { + new ExportedEntity + { + Category= "Date" + }, + new ExportedEntity + { + Category= "LenderName" + }, + new ExportedEntity + { + Category= "LenderAddress" + } + }, + Documents = + { + new ExportedCustomEntityRecognitionDocument + { + Location = "01.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1793, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 9 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 273, + Length = 14 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 314, + Length = 15 + } + } + } + } + }, + new ExportedCustomEntityRecognitionDocument + { + Location = "02.txt", + Language = "en-us", + Dataset = "Train", + Entities = + { + new ExportedDocumentEntityRegion + { + RegionOffset = 0, + RegionLength = 1804, + Labels = + { + new ExportedDocumentEntityLabel + { + Category = "Date", + Offset = 5, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderName", + Offset = 284, + Length = 10 + }, + new ExportedDocumentEntityLabel + { + Category = "LenderAddress", + Offset = 321, + Length = 20 + } + } + } + } + } + } + }; + + var exportedProject = new ExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata) + { + Assets = projectAssets + }; + + Operation operation = await authoringClient.ImportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProject.cs new file mode 100644 index 000000000000..fd53c5e11a9b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProject.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample3_TextAuthoring_CreateProject : SamplesBase + { + [Test] + [SyncOnly] + public void CreateProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample3_TextAuthoring_CreateProject + string projectName = "MyNewProject"; + var projectData = new + { + projectName = projectName, + language = "en", + projectKind = "CustomEntityRecognition", + description = "Project description for a Custom Entity Recognition project", + multilingual = true + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = authoringClient.CreateProject(projectName, content); + + Console.WriteLine($"Project created with status: {response.Status}"); + #endregion + + Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProjectAsync.cs new file mode 100644 index 000000000000..51f14d07abc9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample3_TextAuthoring_CreateProjectAsync.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample3_TextAuthoring_CreateProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task CreateProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample3_TextAuthoring_CreateProjectAsync + string projectName = "MyNewProjectAsync"; + var projectData = new + { + projectName = projectName, + language = "en", + projectKind = "CustomEntityRecognition", + description = "Project description for a Custom Entity Recognition project", + multilingual = true + }; + + using RequestContent content = RequestContent.Create(projectData); + Response response = await authoringClient.CreateProjectAsync(projectName, content); + + Console.WriteLine($"Project created with status: {response.Status}"); + #endregion + + Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProject.cs new file mode 100644 index 000000000000..0d392aaa0b84 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProject.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample4_TextAuthoring_DeleteProject : SamplesBase + { + [Test] + [SyncOnly] + public void DeleteProject() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample4_TextAuthoring_DeleteProject + string projectName = "ProjectToDelete"; + + Operation operation = authoringClient.DeleteProject( + waitUntil: WaitUntil.Completed, + projectName: projectName + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate project deletion success."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProjectAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProjectAsync.cs new file mode 100644 index 000000000000..d0748ddf55c6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample4_TextAuthoring_DeleteProjectAsync.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample4_TextAuthoring_DeleteProjectAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeleteProjectAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample4_TextAuthoring_DeleteProjectAsync + string projectName = "ProjectToDelete"; + + Operation operation = await authoringClient.DeleteProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(204, operation.GetRawResponse().Status, "Expected the status to indicate project deletion success."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_Train.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_Train.cs new file mode 100644 index 000000000000..85b76c1afc63 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_Train.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample5_TextAuthoring_Train : SamplesBase + { + [Test] + [SyncOnly] + public void Train() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample5_TextAuthoring_Train + string projectName = "LoanAgreements"; + + var trainingJobDetails = new TrainingJobDetails( + modelLabel: "model1", + trainingConfigVersion: "latest" + ) + { + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + Operation operation = authoringClient.Train( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobDetails + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful training."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_TrainAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_TrainAsync.cs new file mode 100644 index 000000000000..b8c9d6d83f17 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample5_TextAuthoring_TrainAsync.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample5_TextAuthoring_TrainAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task TrainAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample5_TextAuthoring_TrainAsync + string projectName = "LoanAgreements"; + + var trainingJobConfig = new TrainingJobDetails( + modelLabel: "model1", + trainingConfigVersion: "latest" + ) + { + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + Operation operation = await authoringClient.TrainAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: trainingJobConfig + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful training."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJob.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJob.cs new file mode 100644 index 000000000000..d55c2a88cb13 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJob.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample6_TextAuthoring_CancelTrainingJob : SamplesBase + { + [Test] + [SyncOnly] + public void CancelTrainingJob() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample6_TextAuthoring_CancelTrainingJob + string projectName = "LoanAgreements"; + string jobId = "training-job-id"; // Replace with an actual job ID. + + Operation operation = authoringClient.CancelTrainingJob( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful cancellation."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJobAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJobAsync.cs new file mode 100644 index 000000000000..66ccbf8831de --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample6_TextAuthoring_CancelTrainingJobAsync.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample6_TextAuthoring_CancelTrainingJobAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task CancelTrainingJobAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample6_TextAuthoring_CancelTrainingJobAsync + string projectName = "LoanAgreements"; + string jobId = "training-job-id"; // Replace with an actual job ID. + + Operation operation = await authoringClient.CancelTrainingJobAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + jobId: jobId + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful cancellation."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummary.cs new file mode 100644 index 000000000000..2761e6bc6776 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummary.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample7_TextAuthoring_GetModelEvaluationSummary : SamplesBase + { + [Test] + [SyncOnly] + public void GetModelEvaluationSummary() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummary + + string projectName = "LoanAgreements"; + string trainedModelLabel = "model2"; + + // Get the evaluation summary for the trained model + Response evaluationSummaryResponse = authoringClient.GetModelEvaluationSummary(projectName, trainedModelLabel); + + EvaluationSummary evaluationSummary = evaluationSummaryResponse.Value; + + // Cast to the specific evaluation summary type for custom single label classification + if (evaluationSummary is CustomSingleLabelClassificationEvaluationSummary singleLabelSummary) + { + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix.AdditionalProperties) + { + Console.WriteLine($"Row: {row.Key}"); + var columnData = row.Value.ToObjectFromJson>(); + foreach (var col in columnData) + { + var values = col.Value.ToObjectFromJson>(); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {values["normalizedValue"]}, Raw Value: {values["rawValue"]}"); + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } + } + else + { + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs new file mode 100644 index 000000000000..e4ef8f4e7a02 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample7_TextAuthoring_GetModelEvaluationSummaryAsync.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample7_TextAuthoring_GetModelEvaluationSummaryAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task GetModelEvaluationSummaryAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample7_TextAuthoring_GetSingleLabelClassificationEvaluationSummaryAsync + + string projectName = "LoanAgreements"; + string trainedModelLabel = "model2"; + + // Get the evaluation summary for the trained model + Response evaluationSummaryResponse = await authoringClient.GetModelEvaluationSummaryAsync(projectName, trainedModelLabel); + + EvaluationSummary evaluationSummary = evaluationSummaryResponse.Value; + + // Cast to the specific evaluation summary type for custom single label classification + if (evaluationSummary is CustomSingleLabelClassificationEvaluationSummary singleLabelSummary) + { + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix.AdditionalProperties) + { + Console.WriteLine($"Row: {row.Key}"); + var columnData = row.Value.ToObjectFromJson>(); + foreach (var col in columnData) + { + var values = col.Value.ToObjectFromJson>(); + Console.WriteLine($" Column: {col.Key}, Normalized Value: {values["normalizedValue"]}, Raw Value: {values["rawValue"]}"); + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } + } + else + { + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + } + #endregion + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshot.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshot.cs new file mode 100644 index 000000000000..5572144b611e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshot.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample8_TextAuthoring_LoadSnapshot : SamplesBase + { + [Test] + [SyncOnly] + public void LoadSnapshot() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample8_TextAuthoring_LoadSnapshot + string projectName = "LoanAgreements"; + string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. + + Operation operation = authoringClient.LoadSnapshot( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful snapshot loading."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshotAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshotAsync.cs new file mode 100644 index 000000000000..e7c2c89a2d38 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample8_TextAuthoring_LoadSnapshotAsync.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample8_TextAuthoring_LoadSnapshotAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task LoadSnapshotAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample8_TextAuthoring_LoadSnapshotAsync + string projectName = "LoanAgreements"; + string trainedModelLabel = "ModelLabel"; // Replace with your actual model label. + + Operation operation = await authoringClient.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); + #endregion + + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful snapshot loading."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModel.cs new file mode 100644 index 000000000000..23d6f126b9e7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModel.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample9_TextAuthoring_DeleteTrainedModel : SamplesBase + { + [Test] + [SyncOnly] + public void DeleteTrainedModel() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample9_TextAuthoring_DeleteTrainedModel + string projectName = "LoanAgreements"; + string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. + + Response response = authoringClient.DeleteTrainedModel( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); + #endregion + + Assert.AreEqual(204, response.Status, "Expected the status to indicate successful deletion."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.cs new file mode 100644 index 000000000000..674df36b2725 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/Samples/Sample9_TextAuthoring_DeleteTrainedModelAsync.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Language.Text.Authoring.Tests.Samples +{ + public partial class Sample9_TextAuthoring_DeleteTrainedModelAsync : SamplesBase + { + [Test] + [AsyncOnly] + public async Task DeleteTrainedModelAsync() + { + Uri endpoint = TestEnvironment.Endpoint; + AzureKeyCredential credential = new(TestEnvironment.ApiKey); + AuthoringClient client = new AuthoringClient(endpoint, credential); + TextAnalysisAuthoring authoringClient = client.GetTextAnalysisAuthoringClient(); + + #region Snippet:Sample9_TextAuthoring_DeleteTrainedModelAsync + string projectName = "LoanAgreements"; + string trainedModelLabel = "ModelLabel"; // Replace with the actual model label. + + Response response = await authoringClient.DeleteTrainedModelAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); + #endregion + + Assert.AreEqual(204, response.Status, "Expected the status to indicate successful deletion."); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json new file mode 100644 index 000000000000..e91b23d0785d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsync.json @@ -0,0 +1,2689 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000/:cancel?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a8e9ff17-5634-4c25-8d7d-6a73b5ba7cb5", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:02:47 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "request-id": "a8e9ff17-5634-4c25-8d7d-6a73b5ba7cb5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "65", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ebc218f8-b93b-4374-96a8-10ec12600653", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:47 GMT", + "request-id": "ebc218f8-b93b-4374-96a8-10ec12600653", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "42", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f6df49f6-8826-4e25-a8b8-cbad75a8a20a", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:48 GMT", + "request-id": "f6df49f6-8826-4e25-a8b8-cbad75a8a20a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2dda72a1-2eec-4f12-ae49-57d60f089d88", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:49 GMT", + "request-id": "2dda72a1-2eec-4f12-ae49-57d60f089d88", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1bdf4932-4735-4d31-b0f2-bfa95610e035", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:50 GMT", + "request-id": "1bdf4932-4735-4d31-b0f2-bfa95610e035", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a9ddf2e8-3ae9-4881-9d50-6354e1dc1caa", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:52 GMT", + "request-id": "a9ddf2e8-3ae9-4881-9d50-6354e1dc1caa", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "75", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "adbb7250-b1fa-4de6-8300-3f43ec76758b", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:53 GMT", + "request-id": "adbb7250-b1fa-4de6-8300-3f43ec76758b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6b73fbfd-46fb-4648-94d7-4d313c1fc554", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:54 GMT", + "request-id": "6b73fbfd-46fb-4648-94d7-4d313c1fc554", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1ad4c0e6-7ca6-4b65-b283-42f1593f3437", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:55 GMT", + "request-id": "1ad4c0e6-7ca6-4b65-b283-42f1593f3437", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "edb65920-b301-4983-a4db-91709749eda1", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:56 GMT", + "request-id": "edb65920-b301-4983-a4db-91709749eda1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e8e53fb9-b0da-4b17-9669-52ecefe102e3", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:57 GMT", + "request-id": "e8e53fb9-b0da-4b17-9669-52ecefe102e3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f46bd884-6fa8-4469-81ba-f9ddc8937d75", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:58 GMT", + "request-id": "f46bd884-6fa8-4469-81ba-f9ddc8937d75", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6089a9b3-0e70-49a3-ac99-eeb30342289a", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:59 GMT", + "request-id": "6089a9b3-0e70-49a3-ac99-eeb30342289a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5f37af2f-feda-4d40-bb7e-869b11fbd7cf", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:01 GMT", + "request-id": "5f37af2f-feda-4d40-bb7e-869b11fbd7cf", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "acc4fbf0-d27f-4b29-a6b8-bbf0c31c25ed", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:02 GMT", + "request-id": "acc4fbf0-d27f-4b29-a6b8-bbf0c31c25ed", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b2b088aa-bbbe-4dc1-990b-1631227c1c57", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:03 GMT", + "request-id": "b2b088aa-bbbe-4dc1-990b-1631227c1c57", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "086161ae-b9b0-4113-8e3d-12c507c09621", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:04 GMT", + "request-id": "086161ae-b9b0-4113-8e3d-12c507c09621", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3be702f9-f7df-434f-a757-a2128c5300e6", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:05 GMT", + "request-id": "3be702f9-f7df-434f-a757-a2128c5300e6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "77dc0f27-fa6c-493c-91c4-2437a20d6337", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:06 GMT", + "request-id": "77dc0f27-fa6c-493c-91c4-2437a20d6337", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c7a7b57a-3565-4d94-8f3a-973ea545a1ca", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:07 GMT", + "request-id": "c7a7b57a-3565-4d94-8f3a-973ea545a1ca", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5afe9f27-5531-46c4-a52a-1de104c6936d", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:09 GMT", + "request-id": "5afe9f27-5531-46c4-a52a-1de104c6936d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a49be1fe-d10c-43a4-9725-374283ffe83e", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:10 GMT", + "request-id": "a49be1fe-d10c-43a4-9725-374283ffe83e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "35", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0b729894-ce25-4fe2-9181-18e761901c81", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:11 GMT", + "request-id": "0b729894-ce25-4fe2-9181-18e761901c81", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9700cdb4-ddad-4913-af7d-36189b3223ed", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:12 GMT", + "request-id": "9700cdb4-ddad-4913-af7d-36189b3223ed", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c2698da3-5570-45e9-a521-b27fe8ad320a", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:13 GMT", + "request-id": "c2698da3-5570-45e9-a521-b27fe8ad320a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "32359b04-9fca-4154-b3d3-8a6ade36aee9", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:14 GMT", + "request-id": "32359b04-9fca-4154-b3d3-8a6ade36aee9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3d18b3bd-6d95-4ef3-9d4c-eeb3b070cfe2", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:15 GMT", + "request-id": "3d18b3bd-6d95-4ef3-9d4c-eeb3b070cfe2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "11d1a6d4-3191-4d38-b29b-dd2841204de4", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:17 GMT", + "request-id": "11d1a6d4-3191-4d38-b29b-dd2841204de4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ae75b38a-cf22-4fa9-920a-0d7b9bb98979", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:18 GMT", + "request-id": "ae75b38a-cf22-4fa9-920a-0d7b9bb98979", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6938f354-76e5-421f-bf65-b3a39d2ab1f4", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:19 GMT", + "request-id": "6938f354-76e5-421f-bf65-b3a39d2ab1f4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "19df0e64-674a-4d0e-a021-30050131776e", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:20 GMT", + "request-id": "19df0e64-674a-4d0e-a021-30050131776e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "189", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4e6aecad-6830-48e4-b9a2-017f62631099", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:21 GMT", + "request-id": "4e6aecad-6830-48e4-b9a2-017f62631099", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6dea1d7d-5690-488b-bd81-0820dc58e9d9", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:23 GMT", + "request-id": "6dea1d7d-5690-488b-bd81-0820dc58e9d9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2ff5b879-7235-459f-861d-7d2e2beac254", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:24 GMT", + "request-id": "2ff5b879-7235-459f-861d-7d2e2beac254", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1ef1e0a7-65d9-4462-96d8-d061d7f7666e", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:25 GMT", + "request-id": "1ef1e0a7-65d9-4462-96d8-d061d7f7666e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f94b8074-2253-45d4-a204-2368ddbfab38", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:26 GMT", + "request-id": "f94b8074-2253-45d4-a204-2368ddbfab38", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "437124ee-609b-4749-92e9-6aeef6e86e32", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:27 GMT", + "request-id": "437124ee-609b-4749-92e9-6aeef6e86e32", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e0b5b7cb-e6b6-43e6-9eb8-9de684790dbb", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:28 GMT", + "request-id": "e0b5b7cb-e6b6-43e6-9eb8-9de684790dbb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5fd5883a-9249-4d1b-bf42-7c304e9430d0", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:29 GMT", + "request-id": "5fd5883a-9249-4d1b-bf42-7c304e9430d0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "361d4569-e98c-464d-8a6e-bc2918bb8a51", + "Content-Length": "1430", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:31 GMT", + "request-id": "361d4569-e98c-464d-8a6e-bc2918bb8a51", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:30.8350618Z", + "endDateTime": "2024-12-02T04:02:44.0179512Z", + "status": "succeeded" + } + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:03:31Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "succeeded", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1279360563" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json new file mode 100644 index 000000000000..e91b23d0785d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CancelTrainingJobAsyncAsync.json @@ -0,0 +1,2689 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000/:cancel?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a8e9ff17-5634-4c25-8d7d-6a73b5ba7cb5", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:02:47 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "request-id": "a8e9ff17-5634-4c25-8d7d-6a73b5ba7cb5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "65", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ebc218f8-b93b-4374-96a8-10ec12600653", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:47 GMT", + "request-id": "ebc218f8-b93b-4374-96a8-10ec12600653", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "42", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f6df49f6-8826-4e25-a8b8-cbad75a8a20a", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:48 GMT", + "request-id": "f6df49f6-8826-4e25-a8b8-cbad75a8a20a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2dda72a1-2eec-4f12-ae49-57d60f089d88", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:49 GMT", + "request-id": "2dda72a1-2eec-4f12-ae49-57d60f089d88", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1bdf4932-4735-4d31-b0f2-bfa95610e035", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:50 GMT", + "request-id": "1bdf4932-4735-4d31-b0f2-bfa95610e035", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a9ddf2e8-3ae9-4881-9d50-6354e1dc1caa", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:52 GMT", + "request-id": "a9ddf2e8-3ae9-4881-9d50-6354e1dc1caa", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "75", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "adbb7250-b1fa-4de6-8300-3f43ec76758b", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:53 GMT", + "request-id": "adbb7250-b1fa-4de6-8300-3f43ec76758b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6b73fbfd-46fb-4648-94d7-4d313c1fc554", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:54 GMT", + "request-id": "6b73fbfd-46fb-4648-94d7-4d313c1fc554", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1ad4c0e6-7ca6-4b65-b283-42f1593f3437", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:55 GMT", + "request-id": "1ad4c0e6-7ca6-4b65-b283-42f1593f3437", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "edb65920-b301-4983-a4db-91709749eda1", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:56 GMT", + "request-id": "edb65920-b301-4983-a4db-91709749eda1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e8e53fb9-b0da-4b17-9669-52ecefe102e3", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:57 GMT", + "request-id": "e8e53fb9-b0da-4b17-9669-52ecefe102e3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f46bd884-6fa8-4469-81ba-f9ddc8937d75", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:58 GMT", + "request-id": "f46bd884-6fa8-4469-81ba-f9ddc8937d75", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6089a9b3-0e70-49a3-ac99-eeb30342289a", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:02:59 GMT", + "request-id": "6089a9b3-0e70-49a3-ac99-eeb30342289a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5f37af2f-feda-4d40-bb7e-869b11fbd7cf", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:01 GMT", + "request-id": "5f37af2f-feda-4d40-bb7e-869b11fbd7cf", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "acc4fbf0-d27f-4b29-a6b8-bbf0c31c25ed", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:02 GMT", + "request-id": "acc4fbf0-d27f-4b29-a6b8-bbf0c31c25ed", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b2b088aa-bbbe-4dc1-990b-1631227c1c57", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:03 GMT", + "request-id": "b2b088aa-bbbe-4dc1-990b-1631227c1c57", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "086161ae-b9b0-4113-8e3d-12c507c09621", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:04 GMT", + "request-id": "086161ae-b9b0-4113-8e3d-12c507c09621", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3be702f9-f7df-434f-a757-a2128c5300e6", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:05 GMT", + "request-id": "3be702f9-f7df-434f-a757-a2128c5300e6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "77dc0f27-fa6c-493c-91c4-2437a20d6337", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:06 GMT", + "request-id": "77dc0f27-fa6c-493c-91c4-2437a20d6337", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c7a7b57a-3565-4d94-8f3a-973ea545a1ca", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:07 GMT", + "request-id": "c7a7b57a-3565-4d94-8f3a-973ea545a1ca", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5afe9f27-5531-46c4-a52a-1de104c6936d", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:09 GMT", + "request-id": "5afe9f27-5531-46c4-a52a-1de104c6936d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a49be1fe-d10c-43a4-9725-374283ffe83e", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:10 GMT", + "request-id": "a49be1fe-d10c-43a4-9725-374283ffe83e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "35", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0b729894-ce25-4fe2-9181-18e761901c81", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:11 GMT", + "request-id": "0b729894-ce25-4fe2-9181-18e761901c81", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9700cdb4-ddad-4913-af7d-36189b3223ed", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:12 GMT", + "request-id": "9700cdb4-ddad-4913-af7d-36189b3223ed", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c2698da3-5570-45e9-a521-b27fe8ad320a", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:13 GMT", + "request-id": "c2698da3-5570-45e9-a521-b27fe8ad320a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "32359b04-9fca-4154-b3d3-8a6ade36aee9", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:14 GMT", + "request-id": "32359b04-9fca-4154-b3d3-8a6ade36aee9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3d18b3bd-6d95-4ef3-9d4c-eeb3b070cfe2", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:15 GMT", + "request-id": "3d18b3bd-6d95-4ef3-9d4c-eeb3b070cfe2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "11d1a6d4-3191-4d38-b29b-dd2841204de4", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:17 GMT", + "request-id": "11d1a6d4-3191-4d38-b29b-dd2841204de4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ae75b38a-cf22-4fa9-920a-0d7b9bb98979", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:18 GMT", + "request-id": "ae75b38a-cf22-4fa9-920a-0d7b9bb98979", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6938f354-76e5-421f-bf65-b3a39d2ab1f4", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:19 GMT", + "request-id": "6938f354-76e5-421f-bf65-b3a39d2ab1f4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "19df0e64-674a-4d0e-a021-30050131776e", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:20 GMT", + "request-id": "19df0e64-674a-4d0e-a021-30050131776e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "189", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4e6aecad-6830-48e4-b9a2-017f62631099", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:21 GMT", + "request-id": "4e6aecad-6830-48e4-b9a2-017f62631099", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6dea1d7d-5690-488b-bd81-0820dc58e9d9", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:23 GMT", + "request-id": "6dea1d7d-5690-488b-bd81-0820dc58e9d9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2ff5b879-7235-459f-861d-7d2e2beac254", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:24 GMT", + "request-id": "2ff5b879-7235-459f-861d-7d2e2beac254", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1ef1e0a7-65d9-4462-96d8-d061d7f7666e", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:25 GMT", + "request-id": "1ef1e0a7-65d9-4462-96d8-d061d7f7666e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f94b8074-2253-45d4-a204-2368ddbfab38", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:26 GMT", + "request-id": "f94b8074-2253-45d4-a204-2368ddbfab38", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "437124ee-609b-4749-92e9-6aeef6e86e32", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:27 GMT", + "request-id": "437124ee-609b-4749-92e9-6aeef6e86e32", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e0b5b7cb-e6b6-43e6-9eb8-9de684790dbb", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:28 GMT", + "request-id": "e0b5b7cb-e6b6-43e6-9eb8-9de684790dbb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5fd5883a-9249-4d1b-bf42-7c304e9430d0", + "Content-Length": "1389", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:29 GMT", + "request-id": "5fd5883a-9249-4d1b-bf42-7c304e9430d0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T04:02:27.1410725Z" + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:02:48Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "cancelling", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "361d4569-e98c-464d-8a6e-bc2918bb8a51", + "Content-Length": "1430", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:03:31 GMT", + "request-id": "361d4569-e98c-464d-8a6e-bc2918bb8a51", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:22.1410725Z", + "endDateTime": "2024-12-02T04:02:27.4467181Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T04:02:30.8350618Z", + "endDateTime": "2024-12-02T04:02:44.0179512Z", + "status": "succeeded" + } + }, + "jobId": "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000", + "createdDateTime": "2024-12-02T04:02:20Z", + "lastUpdatedDateTime": "2024-12-02T04:03:31Z", + "expirationDateTime": "2024-12-09T04:02:20Z", + "status": "succeeded", + "warnings": [ + { + "code": "Warning", + "message": "Class `Computer_science` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Electrical_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Mechanical_engineering` is tagged in `5` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Civil_engineering` is tagged in `1` training dataset examples, it is recommended to have `10` tags for better model quality." + }, + { + "code": "Warning", + "message": "Class `Biochemistry` is tagged in `2` training dataset examples, it is recommended to have `10` tags for better model quality." + } + ] + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1279360563" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json new file mode 100644 index 000000000000..7a9ba37699a5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsync.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "234", + "Content-Type": "application/merge-patch+json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectName": "MyTextProject", + "language": "en", + "projectKind": "customMultiLabelClassification", + "description": "Project description for a Custom Entity Recognition project", + "multilingual": true, + "storageInputContainerName": "e2e0test0data" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "41a71e78-5adc-44ee-93e1-7c4bb833bc26", + "Content-Length": "321", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 01 Dec 2024 19:19:43 GMT", + "Location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/MyTextProject", + "request-id": "41a71e78-5adc-44ee-93e1-7c4bb833bc26", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "319", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-12-01T19:19:43Z", + "lastModifiedDateTime": "2024-12-01T19:19:43Z", + "projectKind": "CustomMultiLabelClassification", + "storageInputContainerName": "e2e0test0data", + "projectName": "MyTextProject", + "multilingual": true, + "description": "Project description for a Custom Entity Recognition project", + "language": "en" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "871251045" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json new file mode 100644 index 000000000000..7a9ba37699a5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/CreateProjectAsyncAsync.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "234", + "Content-Type": "application/merge-patch+json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectName": "MyTextProject", + "language": "en", + "projectKind": "customMultiLabelClassification", + "description": "Project description for a Custom Entity Recognition project", + "multilingual": true, + "storageInputContainerName": "e2e0test0data" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "41a71e78-5adc-44ee-93e1-7c4bb833bc26", + "Content-Length": "321", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 01 Dec 2024 19:19:43 GMT", + "Location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/MyTextProject", + "request-id": "41a71e78-5adc-44ee-93e1-7c4bb833bc26", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "319", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-12-01T19:19:43Z", + "lastModifiedDateTime": "2024-12-01T19:19:43Z", + "projectKind": "CustomMultiLabelClassification", + "storageInputContainerName": "e2e0test0data", + "projectName": "MyTextProject", + "multilingual": true, + "description": "Project description for a Custom Entity Recognition project", + "language": "en" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "871251045" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json new file mode 100644 index 000000000000..901fb016c724 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsync.json @@ -0,0 +1,128 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:27:27 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "86", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "39087ed9-542d-4f4e-b0b0-b916ad47f5ad", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:27:27 GMT", + "request-id": "39087ed9-542d-4f4e-b0b0-b916ad47f5ad", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", + "createdDateTime": "2024-12-02T04:27:27Z", + "lastUpdatedDateTime": "2024-12-02T04:27:28Z", + "expirationDateTime": "2024-12-09T04:27:27Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "59d589c8-3e30-4b93-82e3-87cc00ae9a36", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:27:28 GMT", + "request-id": "59d589c8-3e30-4b93-82e3-87cc00ae9a36", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", + "createdDateTime": "2024-12-02T04:27:27Z", + "lastUpdatedDateTime": "2024-12-02T04:27:28Z", + "expirationDateTime": "2024-12-09T04:27:27Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b128ba78-4c0b-4d56-a6fa-8a100fb0616b", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:27:30 GMT", + "request-id": "b128ba78-4c0b-4d56-a6fa-8a100fb0616b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "47", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", + "createdDateTime": "2024-12-02T04:27:27Z", + "lastUpdatedDateTime": "2024-12-02T04:27:30Z", + "expirationDateTime": "2024-12-09T04:27:27Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "61017863" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json new file mode 100644 index 000000000000..901fb016c724 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteDeploymentAsyncAsync.json @@ -0,0 +1,128 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:27:27 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "request-id": "638b7754-5530-431c-ba47-263bf827ec35", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "86", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "39087ed9-542d-4f4e-b0b0-b916ad47f5ad", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:27:27 GMT", + "request-id": "39087ed9-542d-4f4e-b0b0-b916ad47f5ad", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", + "createdDateTime": "2024-12-02T04:27:27Z", + "lastUpdatedDateTime": "2024-12-02T04:27:28Z", + "expirationDateTime": "2024-12-09T04:27:27Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "59d589c8-3e30-4b93-82e3-87cc00ae9a36", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:27:28 GMT", + "request-id": "59d589c8-3e30-4b93-82e3-87cc00ae9a36", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", + "createdDateTime": "2024-12-02T04:27:27Z", + "lastUpdatedDateTime": "2024-12-02T04:27:28Z", + "expirationDateTime": "2024-12-09T04:27:27Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment2/jobs/b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b128ba78-4c0b-4d56-a6fa-8a100fb0616b", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:27:30 GMT", + "request-id": "b128ba78-4c0b-4d56-a6fa-8a100fb0616b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "47", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "b0f66c8d-ea3e-4018-8416-ea6d496f51a3_638686944000000000", + "createdDateTime": "2024-12-02T04:27:27Z", + "lastUpdatedDateTime": "2024-12-02T04:27:30Z", + "expirationDateTime": "2024-12-09T04:27:27Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "61017863" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json new file mode 100644 index 000000000000..a002510cab51 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsync.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a6ca67da-2dc1-4ade-a677-4124bf19bcd5", + "Content-Length": "0", + "Date": "Sun, 01 Dec 2024 19:32:50 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/9b56818b-3fc2-459b-a6de-1194e9fd70eb_638686080000000000?api-version=2024-11-15-preview", + "request-id": "a6ca67da-2dc1-4ade-a677-4124bf19bcd5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "57", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/9b56818b-3fc2-459b-a6de-1194e9fd70eb_638686080000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "241b1d9a-b8c6-4726-bc97-f25ba4a4bb6e", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 01 Dec 2024 19:32:50 GMT", + "request-id": "241b1d9a-b8c6-4726-bc97-f25ba4a4bb6e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "9b56818b-3fc2-459b-a6de-1194e9fd70eb_638686080000000000", + "createdDateTime": "2024-12-01T19:32:50Z", + "lastUpdatedDateTime": "2024-12-01T19:32:50Z", + "expirationDateTime": "2024-12-08T19:32:50Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "940714902" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json new file mode 100644 index 000000000000..a002510cab51 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteProjectAsyncAsync.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a6ca67da-2dc1-4ade-a677-4124bf19bcd5", + "Content-Length": "0", + "Date": "Sun, 01 Dec 2024 19:32:50 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/9b56818b-3fc2-459b-a6de-1194e9fd70eb_638686080000000000?api-version=2024-11-15-preview", + "request-id": "a6ca67da-2dc1-4ade-a677-4124bf19bcd5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "57", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/global/deletion-jobs/9b56818b-3fc2-459b-a6de-1194e9fd70eb_638686080000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "241b1d9a-b8c6-4726-bc97-f25ba4a4bb6e", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 01 Dec 2024 19:32:50 GMT", + "request-id": "241b1d9a-b8c6-4726-bc97-f25ba4a4bb6e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "9b56818b-3fc2-459b-a6de-1194e9fd70eb_638686080000000000", + "createdDateTime": "2024-12-01T19:32:50Z", + "lastUpdatedDateTime": "2024-12-01T19:32:50Z", + "expirationDateTime": "2024-12-08T19:32:50Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "940714902" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json new file mode 100644 index 000000000000..d4d60bdc3224 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsync.json @@ -0,0 +1,34 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2ae2677d-180c-4a5e-9db7-c7bd70b2461e", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:18:47 GMT", + "request-id": "2ae2677d-180c-4a5e-9db7-c7bd70b2461e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "289", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1981396821" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json new file mode 100644 index 000000000000..7b9148f06927 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeleteTrainedModelAsyncAsync.json @@ -0,0 +1,34 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1?api-version=2024-11-15-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ce4ff277-0aee-4b53-9423-558862a283f1", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:18:47 GMT", + "request-id": "ce4ff277-0aee-4b53-9423-558862a283f1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "62", + "x-ms-region": "East US" + }, + "ResponseBody": null + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1604671" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json new file mode 100644 index 000000000000..8a790e97112e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsync.json @@ -0,0 +1,195 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "26", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "trainedModelLabel": "m2" + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "68742a20-beec-40bb-a4f7-29ab05f47f7e", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:22:51 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", + "request-id": "68742a20-beec-40bb-a4f7-29ab05f47f7e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "132", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1ea6f14b-b77f-4461-9b54-f7fa950e793d", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:51 GMT", + "request-id": "1ea6f14b-b77f-4461-9b54-f7fa950e793d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "47", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", + "createdDateTime": "2024-12-02T04:22:51Z", + "lastUpdatedDateTime": "2024-12-02T04:22:51Z", + "expirationDateTime": "2024-12-09T04:22:51Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "857d672a-d18b-42f9-b112-56dcfbfc4c5f", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:52 GMT", + "request-id": "857d672a-d18b-42f9-b112-56dcfbfc4c5f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "52", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", + "createdDateTime": "2024-12-02T04:22:51Z", + "lastUpdatedDateTime": "2024-12-02T04:22:51Z", + "expirationDateTime": "2024-12-09T04:22:51Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "252eb04a-c423-4223-88d3-b1ef8f162f49", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:53 GMT", + "request-id": "252eb04a-c423-4223-88d3-b1ef8f162f49", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "53", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", + "createdDateTime": "2024-12-02T04:22:51Z", + "lastUpdatedDateTime": "2024-12-02T04:22:51Z", + "expirationDateTime": "2024-12-09T04:22:51Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "95b93e57-7b80-43ef-8e3e-9b2161ba11c3", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:54 GMT", + "request-id": "95b93e57-7b80-43ef-8e3e-9b2161ba11c3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "d2c5539c-d57c-41b6-b45b-60a373d599f7_638686944000000000", + "createdDateTime": "2024-12-02T04:22:51Z", + "lastUpdatedDateTime": "2024-12-02T04:22:53Z", + "expirationDateTime": "2024-12-09T04:22:51Z", + "status": "succeeded" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "976d4de3-862c-447b-9f96-29af40568216", + "Content-Length": "277", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:54 GMT", + "request-id": "976d4de3-862c-447b-9f96-29af40568216", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "42", + "x-ms-region": "East US" + }, + "ResponseBody": { + "deploymentName": "deployment1", + "modelId": "m2-20241202T035733-dff6706ab8694964b5acd63a6c2870c0", + "lastTrainedDateTime": "2024-12-02T03:57:33.8992972Z", + "lastDeployedDateTime": "2024-12-02T04:22:53Z", + "deploymentExpirationDate": "2026-10-22", + "modelTrainingConfigVersion": "2022-05-01" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1133352948" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json new file mode 100644 index 000000000000..6a7833186221 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/DeployProjectAsyncAsync.json @@ -0,0 +1,257 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "26", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "trainedModelLabel": "m2" + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8c944397-516c-4e42-a889-0a0b8e946630", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:22:55 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "request-id": "8c944397-516c-4e42-a889-0a0b8e946630", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "151", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "edc7b04f-c219-49fe-b7a4-6e4cf7923c6b", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:55 GMT", + "request-id": "edc7b04f-c219-49fe-b7a4-6e4cf7923c6b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "52", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", + "createdDateTime": "2024-12-02T04:22:55Z", + "lastUpdatedDateTime": "2024-12-02T04:22:55Z", + "expirationDateTime": "2024-12-09T04:22:55Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "298c6839-af42-413f-b79f-073aafe5cea3", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:56 GMT", + "request-id": "298c6839-af42-413f-b79f-073aafe5cea3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "54", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", + "createdDateTime": "2024-12-02T04:22:55Z", + "lastUpdatedDateTime": "2024-12-02T04:22:55Z", + "expirationDateTime": "2024-12-09T04:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8dd19f1c-8d00-4601-a9e8-02add7e96bce", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:57 GMT", + "request-id": "8dd19f1c-8d00-4601-a9e8-02add7e96bce", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "44", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", + "createdDateTime": "2024-12-02T04:22:55Z", + "lastUpdatedDateTime": "2024-12-02T04:22:55Z", + "expirationDateTime": "2024-12-09T04:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c23d6296-8efa-465f-9493-bbae709b903f", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:58 GMT", + "request-id": "c23d6296-8efa-465f-9493-bbae709b903f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "35", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", + "createdDateTime": "2024-12-02T04:22:55Z", + "lastUpdatedDateTime": "2024-12-02T04:22:55Z", + "expirationDateTime": "2024-12-09T04:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "18e0789a-f58f-4f47-a116-28439df618ba", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:22:59 GMT", + "request-id": "18e0789a-f58f-4f47-a116-28439df618ba", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", + "createdDateTime": "2024-12-02T04:22:55Z", + "lastUpdatedDateTime": "2024-12-02T04:22:55Z", + "expirationDateTime": "2024-12-09T04:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1/jobs/8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5d78d080-edd2-4b5e-a007-ca253b994a5e", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:23:01 GMT", + "request-id": "5d78d080-edd2-4b5e-a007-ca253b994a5e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "56", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "8c0ce5fb-5815-4301-8cb3-cee4ce2f4dff_638686944000000000", + "createdDateTime": "2024-12-02T04:22:55Z", + "lastUpdatedDateTime": "2024-12-02T04:23:00Z", + "expirationDateTime": "2024-12-09T04:22:55Z", + "status": "succeeded" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/deployment1?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "31ed79a7-1a52-4e53-b858-7e3e41be83b1", + "Content-Length": "277", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:23:01 GMT", + "request-id": "31ed79a7-1a52-4e53-b858-7e3e41be83b1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "44", + "x-ms-region": "East US" + }, + "ResponseBody": { + "deploymentName": "deployment1", + "modelId": "m2-20241202T035733-dff6706ab8694964b5acd63a6c2870c0", + "lastTrainedDateTime": "2024-12-02T03:57:33.8992972Z", + "lastDeployedDateTime": "2024-12-02T04:23:00Z", + "deploymentExpirationDate": "2026-10-22", + "modelTrainingConfigVersion": "2022-05-01" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "656965166" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json new file mode 100644 index 000000000000..4e8977240f0c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsync.json @@ -0,0 +1,123 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/evaluation/summary-result?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d9ebf79c-f2d5-4740-81f0-3c2a6db8e983", + "Content-Length": "1492", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:13:47 GMT", + "request-id": "d9ebf79c-f2d5-4740-81f0-3c2a6db8e983", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "67", + "x-ms-region": "East US" + }, + "ResponseBody": { + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationEvaluation": { + "confusionMatrix": { + "Computer_science": {}, + "Electrical_engineering": {}, + "Mechanical_engineering": { + "Biochemistry": { + "normalizedValue": 50.0, + "rawValue": 1.0 + }, + "Mechanical_engineering": { + "normalizedValue": 50.0, + "rawValue": 1.0 + } + }, + "Civil_engineering": {}, + "Biochemistry": {}, + "None": {} + }, + "classes": { + "Mechanical_engineering": { + "f1": 0.6666666865348816, + "precision": 1.0, + "recall": 0.5, + "truePositiveCount": 1, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 1 + }, + "Biochemistry": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 1, + "falsePositiveCount": 1, + "falseNegativeCount": 0 + }, + "Computer_science": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Electrical_engineering": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Civil_engineering": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "None": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + } + }, + "microF1": 0.5, + "microPrecision": 0.5, + "microRecall": 0.5, + "macroF1": 0.6666667, + "macroPrecision": 1.0, + "macroRecall": 0.5 + }, + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "2134765606" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json new file mode 100644 index 000000000000..28fc4d7668ec --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetModelEvaluationSummaryAsyncAsync.json @@ -0,0 +1,123 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/evaluation/summary-result?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "789ee80b-82a9-4d8b-8321-a127d9d77702", + "Content-Length": "1492", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:13:47 GMT", + "request-id": "789ee80b-82a9-4d8b-8321-a127d9d77702", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "58", + "x-ms-region": "East US" + }, + "ResponseBody": { + "projectKind": "CustomSingleLabelClassification", + "customSingleLabelClassificationEvaluation": { + "confusionMatrix": { + "Computer_science": {}, + "Electrical_engineering": {}, + "Mechanical_engineering": { + "Biochemistry": { + "normalizedValue": 50.0, + "rawValue": 1.0 + }, + "Mechanical_engineering": { + "normalizedValue": 50.0, + "rawValue": 1.0 + } + }, + "Civil_engineering": {}, + "Biochemistry": {}, + "None": {} + }, + "classes": { + "Mechanical_engineering": { + "f1": 0.6666666865348816, + "precision": 1.0, + "recall": 0.5, + "truePositiveCount": 1, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 1 + }, + "Biochemistry": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 1, + "falsePositiveCount": 1, + "falseNegativeCount": 0 + }, + "Computer_science": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Electrical_engineering": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "Civil_engineering": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + }, + "None": { + "f1": 0.0, + "precision": 0.0, + "recall": 0.0, + "truePositiveCount": 0, + "trueNegativeCount": 0, + "falsePositiveCount": 0, + "falseNegativeCount": 0 + } + }, + "microF1": 0.5, + "microPrecision": 0.5, + "microRecall": 0.5, + "macroF1": 0.6666667, + "macroPrecision": 1.0, + "macroRecall": 0.5 + }, + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "105639143" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json new file mode 100644 index 000000000000..ccb3ded1ede1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsync.json @@ -0,0 +1,44 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0b972e17-bc3b-47f0-97e5-09376ec7168d", + "Content-Length": "321", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 01 Dec 2024 19:26:47 GMT", + "request-id": "0b972e17-bc3b-47f0-97e5-09376ec7168d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-12-01T19:19:43Z", + "lastModifiedDateTime": "2024-12-01T19:20:04Z", + "projectKind": "CustomMultiLabelClassification", + "storageInputContainerName": "e2e0test0data", + "projectName": "MyTextProject", + "multilingual": true, + "description": "Project description for a Custom Entity Recognition project", + "language": "en" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "758964329" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json new file mode 100644 index 000000000000..d418db5f0f14 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/GetProjectAsyncAsync.json @@ -0,0 +1,44 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "279c8f36-a909-4b5d-adc9-7609cd21cdda", + "Content-Length": "321", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sun, 01 Dec 2024 19:26:47 GMT", + "request-id": "279c8f36-a909-4b5d-adc9-7609cd21cdda", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50", + "x-ms-region": "East US" + }, + "ResponseBody": { + "createdDateTime": "2024-12-01T19:19:43Z", + "lastModifiedDateTime": "2024-12-01T19:20:04Z", + "projectKind": "CustomMultiLabelClassification", + "storageInputContainerName": "e2e0test0data", + "projectName": "MyTextProject", + "multilingual": true, + "description": "Project description for a Custom Entity Recognition project", + "language": "en" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "304721772" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json new file mode 100644 index 000000000000..42c8bc6a7ff3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsync.json @@ -0,0 +1,141 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "791", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectFileVersion": "2022-05-01", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "test-data", + "settings": {}, + "projectName": "MyImportTextProject", + "multilingual": false, + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "language": "en" + }, + "assets": { + "classes": [ + { + "category": "Date" + }, + { + "category": "LenderName" + }, + { + "category": "LenderAddress" + } + ], + "documents": [ + { + "class": { + "category": "Date" + }, + "location": "01.txt", + "language": "en" + }, + { + "class": { + "category": "LenderName" + }, + "location": "02.txt", + "language": "en" + } + ], + "projectKind": "CustomSingleLabelClassification" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d7fb9f82-b49d-4195-be54-2fd041638378", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 06:25:21 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/32be372c-d550-4845-8840-f67a1e0e8079_638686944000000000?api-version=2024-11-15-preview", + "request-id": "d7fb9f82-b49d-4195-be54-2fd041638378", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "281", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/32be372c-d550-4845-8840-f67a1e0e8079_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5bc6c2db-61de-46ed-acd7-5aa1e1260ab9", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 06:25:21 GMT", + "request-id": "5bc6c2db-61de-46ed-acd7-5aa1e1260ab9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "42", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "32be372c-d550-4845-8840-f67a1e0e8079_638686944000000000", + "createdDateTime": "2024-12-02T06:25:21Z", + "lastUpdatedDateTime": "2024-12-02T06:25:21Z", + "expirationDateTime": "2024-12-09T06:25:21Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/32be372c-d550-4845-8840-f67a1e0e8079_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4fa81860-06b0-4540-bc61-988efe974cd3", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 06:25:22 GMT", + "request-id": "4fa81860-06b0-4540-bc61-988efe974cd3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "32be372c-d550-4845-8840-f67a1e0e8079_638686944000000000", + "createdDateTime": "2024-12-02T06:25:21Z", + "lastUpdatedDateTime": "2024-12-02T06:25:21Z", + "expirationDateTime": "2024-12-09T06:25:21Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "2109549850" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json new file mode 100644 index 000000000000..e9aa491b3f3f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/ImportAsyncAsync.json @@ -0,0 +1,141 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/:import?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "791", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "projectFileVersion": "2022-05-01", + "stringIndexType": "Utf16CodeUnit", + "metadata": { + "projectKind": "CustomSingleLabelClassification", + "storageInputContainerName": "test-data", + "settings": {}, + "projectName": "MyImportTextProject", + "multilingual": false, + "description": "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + "language": "en" + }, + "assets": { + "classes": [ + { + "category": "Date" + }, + { + "category": "LenderName" + }, + { + "category": "LenderAddress" + } + ], + "documents": [ + { + "class": { + "category": "Date" + }, + "location": "01.txt", + "language": "en" + }, + { + "class": { + "category": "LenderName" + }, + "location": "02.txt", + "language": "en" + } + ], + "projectKind": "CustomSingleLabelClassification" + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c0954d5b-6964-4851-9d9b-7f48adcc534d", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 06:25:22 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2eaca98a-6f12-464f-814c-8ed0867bb6a5_638686944000000000?api-version=2024-11-15-preview", + "request-id": "c0954d5b-6964-4851-9d9b-7f48adcc534d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "143", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2eaca98a-6f12-464f-814c-8ed0867bb6a5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "879355ed-6ac9-4d1e-ae52-8da8f20586e5", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 06:25:22 GMT", + "request-id": "879355ed-6ac9-4d1e-ae52-8da8f20586e5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "43", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "2eaca98a-6f12-464f-814c-8ed0867bb6a5_638686944000000000", + "createdDateTime": "2024-12-02T06:25:22Z", + "lastUpdatedDateTime": "2024-12-02T06:25:22Z", + "expirationDateTime": "2024-12-09T06:25:22Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyImportTextProject/import/jobs/2eaca98a-6f12-464f-814c-8ed0867bb6a5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2d6a50eb-4f95-4dc7-9e43-b0e40c51b5c6", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 06:25:23 GMT", + "request-id": "2d6a50eb-4f95-4dc7-9e43-b0e40c51b5c6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "2eaca98a-6f12-464f-814c-8ed0867bb6a5_638686944000000000", + "createdDateTime": "2024-12-02T06:25:22Z", + "lastUpdatedDateTime": "2024-12-02T06:25:23Z", + "expirationDateTime": "2024-12-09T06:25:22Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "117171020" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json new file mode 100644 index 000000000000..99dc0a7a7d33 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsync.json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/:load-snapshot?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c3e6d4d7-2cdc-432b-bd76-9709389a3bea", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:15:26 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/load-snapshot/jobs/ae7d8cb0-371e-47b7-a1ae-05dd813d8d05_638686944000000000?api-version=2024-11-15-preview", + "request-id": "c3e6d4d7-2cdc-432b-bd76-9709389a3bea", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "77", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/load-snapshot/jobs/ae7d8cb0-371e-47b7-a1ae-05dd813d8d05_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c89fc54f-25f6-42e9-8d8f-703b3e59c5c5", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:15:26 GMT", + "request-id": "c89fc54f-25f6-42e9-8d8f-703b3e59c5c5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "ae7d8cb0-371e-47b7-a1ae-05dd813d8d05_638686944000000000", + "createdDateTime": "2024-12-02T04:15:27Z", + "lastUpdatedDateTime": "2024-12-02T04:15:27Z", + "expirationDateTime": "2024-12-09T04:15:27Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/load-snapshot/jobs/ae7d8cb0-371e-47b7-a1ae-05dd813d8d05_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8baea564-ef57-4ac9-a15c-8210508194d3", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:15:28 GMT", + "request-id": "8baea564-ef57-4ac9-a15c-8210508194d3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "37", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "ae7d8cb0-371e-47b7-a1ae-05dd813d8d05_638686944000000000", + "createdDateTime": "2024-12-02T04:15:27Z", + "lastUpdatedDateTime": "2024-12-02T04:15:28Z", + "expirationDateTime": "2024-12-09T04:15:27Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "335308371" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json new file mode 100644 index 000000000000..80f9e1a93bd3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/LoadSnapshotAsyncAsync.json @@ -0,0 +1,98 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/:load-snapshot?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "0", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b52c59f7-dbb6-4c34-ad0f-97b8f2236e21", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:15:28 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/load-snapshot/jobs/42cf4dda-1804-4437-8dda-cfbc76c54986_638686944000000000?api-version=2024-11-15-preview", + "request-id": "b52c59f7-dbb6-4c34-ad0f-97b8f2236e21", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "52", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/load-snapshot/jobs/42cf4dda-1804-4437-8dda-cfbc76c54986_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c5afe25f-37a0-4721-beec-a3227c69176f", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:15:28 GMT", + "request-id": "c5afe25f-37a0-4721-beec-a3227c69176f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "42cf4dda-1804-4437-8dda-cfbc76c54986_638686944000000000", + "createdDateTime": "2024-12-02T04:15:29Z", + "lastUpdatedDateTime": "2024-12-02T04:15:29Z", + "expirationDateTime": "2024-12-09T04:15:29Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/models/model1/load-snapshot/jobs/42cf4dda-1804-4437-8dda-cfbc76c54986_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "43d54efd-baef-419f-9635-b5b303823a43", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:15:29 GMT", + "request-id": "43d54efd-baef-419f-9635-b5b303823a43", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "37", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "42cf4dda-1804-4437-8dda-cfbc76c54986_638686944000000000", + "createdDateTime": "2024-12-02T04:15:29Z", + "lastUpdatedDateTime": "2024-12-02T04:15:29Z", + "expirationDateTime": "2024-12-09T04:15:29Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1941418186" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json new file mode 100644 index 000000000000..0188ba2fbad7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsync.json @@ -0,0 +1,226 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/:swap?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "74", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "firstDeploymentName": "deployment1", + "secondDeploymentName": "deployment2" + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6119563e-3877-491f-b109-55207a4c32f9", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:24:18 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "request-id": "6119563e-3877-491f-b109-55207a4c32f9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "163", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f294ac14-0263-4e39-b25c-053af463a643", + "Content-Length": "219", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:18 GMT", + "request-id": "f294ac14-0263-4e39-b25c-053af463a643", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "45", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", + "createdDateTime": "2024-12-02T04:24:19Z", + "lastUpdatedDateTime": "2024-12-02T04:24:19Z", + "expirationDateTime": "2024-12-09T04:24:19Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b25d8a9a-0b2f-4c7e-90e6-86d8ebf0af8e", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:20 GMT", + "request-id": "b25d8a9a-0b2f-4c7e-90e6-86d8ebf0af8e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", + "createdDateTime": "2024-12-02T04:24:19Z", + "lastUpdatedDateTime": "2024-12-02T04:24:19Z", + "expirationDateTime": "2024-12-09T04:24:19Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "999cfe4b-dddb-4220-b923-cc8c47032b3c", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:21 GMT", + "request-id": "999cfe4b-dddb-4220-b923-cc8c47032b3c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "52", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", + "createdDateTime": "2024-12-02T04:24:19Z", + "lastUpdatedDateTime": "2024-12-02T04:24:19Z", + "expirationDateTime": "2024-12-09T04:24:19Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6bf73a59-2123-4c1d-afd8-0b931a869544", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:22 GMT", + "request-id": "6bf73a59-2123-4c1d-afd8-0b931a869544", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", + "createdDateTime": "2024-12-02T04:24:19Z", + "lastUpdatedDateTime": "2024-12-02T04:24:19Z", + "expirationDateTime": "2024-12-09T04:24:19Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "be78628f-1a9c-4f8a-ae9c-5944bd159f12", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:23 GMT", + "request-id": "be78628f-1a9c-4f8a-ae9c-5944bd159f12", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "50", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", + "createdDateTime": "2024-12-02T04:24:19Z", + "lastUpdatedDateTime": "2024-12-02T04:24:19Z", + "expirationDateTime": "2024-12-09T04:24:19Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5261fbc4-c221-479d-a77e-c3d055ec42cc", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:24 GMT", + "request-id": "5261fbc4-c221-479d-a77e-c3d055ec42cc", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "7caf6978-fbe2-4ff0-836c-94bd05ef5af5_638686944000000000", + "createdDateTime": "2024-12-02T04:24:19Z", + "lastUpdatedDateTime": "2024-12-02T04:24:24Z", + "expirationDateTime": "2024-12-09T04:24:19Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "20765020" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json new file mode 100644 index 000000000000..766563c859f6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/SwapDeploymentsAsyncAsync.json @@ -0,0 +1,133 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/:swap?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "74", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "firstDeploymentName": "deployment1", + "secondDeploymentName": "deployment2" + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f12f1dba-5dea-428f-b7bc-c67a4a3550da", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 04:24:24 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "request-id": "f12f1dba-5dea-428f-b7bc-c67a4a3550da", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "97", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "056cd217-a5a7-4e12-af13-ecaa26d3a075", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:25 GMT", + "request-id": "056cd217-a5a7-4e12-af13-ecaa26d3a075", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "45", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000", + "createdDateTime": "2024-12-02T04:24:25Z", + "lastUpdatedDateTime": "2024-12-02T04:24:25Z", + "expirationDateTime": "2024-12-09T04:24:25Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ee5e1529-7b92-4b03-ad24-74ee0206cb76", + "Content-Length": "216", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:26 GMT", + "request-id": "ee5e1529-7b92-4b03-ad24-74ee0206cb76", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "42", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000", + "createdDateTime": "2024-12-02T04:24:25Z", + "lastUpdatedDateTime": "2024-12-02T04:24:25Z", + "expirationDateTime": "2024-12-09T04:24:25Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/deployments/swap/jobs/1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7e9ddbc7-3781-4493-8872-cd0721a59003", + "Content-Length": "218", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 04:24:27 GMT", + "request-id": "7e9ddbc7-3781-4493-8872-cd0721a59003", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "52", + "x-ms-region": "East US" + }, + "ResponseBody": { + "jobId": "1b1be2fa-c124-4a97-87bd-022684be1afd_638686944000000000", + "createdDateTime": "2024-12-02T04:24:25Z", + "lastUpdatedDateTime": "2024-12-02T04:24:27Z", + "expirationDateTime": "2024-12-09T04:24:25Z", + "status": "succeeded" + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "429351611" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json new file mode 100644 index 000000000000..395d8793cb09 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsync.json @@ -0,0 +1,3963 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/:train?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "155", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "modelLabel": "model1", + "trainingConfigVersion": "latest", + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "365d2159-e12d-4cc0-a3e5-f63f75df88a2", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 03:21:18 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "request-id": "365d2159-e12d-4cc0-a3e5-f63f75df88a2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "168", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f9b36469-da27-413a-afc8-ed098ec372ca", + "Content-Length": "413", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:18 GMT", + "request-id": "f9b36469-da27-413a-afc8-ed098ec372ca", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:18Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "24d2dc25-3af1-4ce7-bb55-b2c40b06e83f", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:19 GMT", + "request-id": "24d2dc25-3af1-4ce7-bb55-b2c40b06e83f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "38", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:19Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "457577a0-b791-4b5e-bd11-17347c957ced", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:21 GMT", + "request-id": "457577a0-b791-4b5e-bd11-17347c957ced", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:20Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e253ab37-ebb5-4eb7-b675-25bb558b2c0d", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:22 GMT", + "request-id": "e253ab37-ebb5-4eb7-b675-25bb558b2c0d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "43", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:20Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6a25787b-ff69-4eba-85c7-acea62ab6e64", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:23 GMT", + "request-id": "6a25787b-ff69-4eba-85c7-acea62ab6e64", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:20Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9ee86516-ddbf-474d-b38d-7ec8601d6669", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:24 GMT", + "request-id": "9ee86516-ddbf-474d-b38d-7ec8601d6669", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:20Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ccb55276-b43f-4059-bf7f-c35e2838ba4a", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:25 GMT", + "request-id": "ccb55276-b43f-4059-bf7f-c35e2838ba4a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:25Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "244c23e9-4e41-4073-94ad-dff87ef04cc7", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:26 GMT", + "request-id": "244c23e9-4e41-4073-94ad-dff87ef04cc7", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:25Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e1e4f50b-1ea3-40e9-9ef7-8eb4555747cd", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:27 GMT", + "request-id": "e1e4f50b-1ea3-40e9-9ef7-8eb4555747cd", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:25Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "24552338-7a7d-4638-9e73-0e8149972c9d", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:29 GMT", + "request-id": "24552338-7a7d-4638-9e73-0e8149972c9d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "40", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:25Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "62a3a49b-d796-4771-9235-9edc08047b97", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:30 GMT", + "request-id": "62a3a49b-d796-4771-9235-9edc08047b97", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:30Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ce9dfc8c-c2a0-4227-b9fc-a2a3ce09666a", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:31 GMT", + "request-id": "ce9dfc8c-c2a0-4227-b9fc-a2a3ce09666a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:30Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5190433b-2598-45f3-bd0e-7c8ae61bedb1", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:32 GMT", + "request-id": "5190433b-2598-45f3-bd0e-7c8ae61bedb1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:30Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "10ecdcf1-ebb9-4b61-bcfa-727fde4c8700", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:33 GMT", + "request-id": "10ecdcf1-ebb9-4b61-bcfa-727fde4c8700", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:30Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "321e3a63-8229-43c8-ab68-4401264a7a1f", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:34 GMT", + "request-id": "321e3a63-8229-43c8-ab68-4401264a7a1f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:30Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "afd503f9-6d72-47eb-bd3a-a629364bee87", + "Content-Length": "508", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:35 GMT", + "request-id": "afd503f9-6d72-47eb-bd3a-a629364bee87", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:30.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:30Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4c365b64-4ee7-466c-b1c0-f9d43a45192c", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:36 GMT", + "request-id": "4c365b64-4ee7-466c-b1c0-f9d43a45192c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:36Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2fbd213d-84ee-4ef9-bc91-9727e06a45a0", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:38 GMT", + "request-id": "2fbd213d-84ee-4ef9-bc91-9727e06a45a0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:36Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "dd4d7886-a728-4844-b28f-6ea519c46969", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:39 GMT", + "request-id": "dd4d7886-a728-4844-b28f-6ea519c46969", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:36Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1edbef46-b1c1-49b5-bd63-36766625bc46", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:40 GMT", + "request-id": "1edbef46-b1c1-49b5-bd63-36766625bc46", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:40Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1193297f-8f67-4cb1-b79d-c0eef5c78982", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:41 GMT", + "request-id": "1193297f-8f67-4cb1-b79d-c0eef5c78982", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:40Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b2c47871-aec5-4ebf-9fc2-e6835ccae1c8", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:42 GMT", + "request-id": "b2c47871-aec5-4ebf-9fc2-e6835ccae1c8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:40Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0287250d-c2d5-493f-802d-ccc8ec2fc1be", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:43 GMT", + "request-id": "0287250d-c2d5-493f-802d-ccc8ec2fc1be", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 22, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:40Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ece32b08-2fe3-4a43-a0ca-447647edd498", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:44 GMT", + "request-id": "ece32b08-2fe3-4a43-a0ca-447647edd498", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:44Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2f42ce8a-a80e-4385-bb58-5e8f5d2cdaee", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:45 GMT", + "request-id": "2f42ce8a-a80e-4385-bb58-5e8f5d2cdaee", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:44Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "170145c3-2efe-433f-9786-b5129fbd26c8", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:47 GMT", + "request-id": "170145c3-2efe-433f-9786-b5129fbd26c8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:44Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "725305ca-95fe-4e6e-bc2e-88c6a1dcad6f", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:48 GMT", + "request-id": "725305ca-95fe-4e6e-bc2e-88c6a1dcad6f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:44Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f3fb20e0-08c4-46e8-bf9b-ecdc7dd2b223", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:49 GMT", + "request-id": "f3fb20e0-08c4-46e8-bf9b-ecdc7dd2b223", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "35", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:48Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "177bdcfa-23a3-4014-9539-2b4942e531bf", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:50 GMT", + "request-id": "177bdcfa-23a3-4014-9539-2b4942e531bf", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:48Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ed6aa17d-1a0a-44ed-b0d6-8575969ce514", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:51 GMT", + "request-id": "ed6aa17d-1a0a-44ed-b0d6-8575969ce514", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:48Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "972cc4cb-180a-4074-a403-eccd878b7c8a", + "Content-Length": "509", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:52 GMT", + "request-id": "972cc4cb-180a-4074-a403-eccd878b7c8a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "35", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 67, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:23:01.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:48Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9e193e58-a1d7-4d73-a16e-526635c40248", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:53 GMT", + "request-id": "9e193e58-a1d7-4d73-a16e-526635c40248", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "66c03cab-7b6b-4a66-9499-92edeb8b0554", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:54 GMT", + "request-id": "66c03cab-7b6b-4a66-9499-92edeb8b0554", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "93e1ab06-277f-4975-b465-64f8ca2d96f4", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:56 GMT", + "request-id": "93e1ab06-277f-4975-b465-64f8ca2d96f4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3d26f11d-e124-45e1-ad39-30e880fa92c7", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:57 GMT", + "request-id": "3d26f11d-e124-45e1-ad39-30e880fa92c7", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "dc472914-06a1-4737-96c3-ceb854563b26", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:58 GMT", + "request-id": "dc472914-06a1-4737-96c3-ceb854563b26", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7f76ce54-9aa7-4189-b0aa-dbcfbc455785", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:21:59 GMT", + "request-id": "7f76ce54-9aa7-4189-b0aa-dbcfbc455785", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "24d11bf4-846a-42d9-bfb3-d1d6bb34d768", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:00 GMT", + "request-id": "24d11bf4-846a-42d9-bfb3-d1d6bb34d768", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c432dca8-8a56-4384-88d4-5a056e664656", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:01 GMT", + "request-id": "c432dca8-8a56-4384-88d4-5a056e664656", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5e730421-0e5f-441e-bf33-045b34caf0e8", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:02 GMT", + "request-id": "5e730421-0e5f-441e-bf33-045b34caf0e8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "40", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8148a10e-9172-42ec-885e-6dc4de21513d", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:03 GMT", + "request-id": "8148a10e-9172-42ec-885e-6dc4de21513d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4e77b313-e964-4557-9bc5-ca285c36a723", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:05 GMT", + "request-id": "4e77b313-e964-4557-9bc5-ca285c36a723", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "fa4fd02d-945d-4cd6-92ef-b619cf925590", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:06 GMT", + "request-id": "fa4fd02d-945d-4cd6-92ef-b619cf925590", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "47c1e1ec-05d4-4076-a568-3c7b0bd5a943", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:07 GMT", + "request-id": "47c1e1ec-05d4-4076-a568-3c7b0bd5a943", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e9332e59-7050-4d49-ad97-88281f3f86c6", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:08 GMT", + "request-id": "e9332e59-7050-4d49-ad97-88281f3f86c6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b5b91315-b065-432c-97c6-2a9ffb85ebea", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:09 GMT", + "request-id": "b5b91315-b065-432c-97c6-2a9ffb85ebea", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "38", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6cfe244b-bdb6-4ee7-8cf6-c8bb3f79e05c", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:10 GMT", + "request-id": "6cfe244b-bdb6-4ee7-8cf6-c8bb3f79e05c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "113a5bab-69f8-4456-b7d7-b1842170d080", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:11 GMT", + "request-id": "113a5bab-69f8-4456-b7d7-b1842170d080", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2a17ceef-d9d0-4b99-a1b1-36a09509b0ff", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:13 GMT", + "request-id": "2a17ceef-d9d0-4b99-a1b1-36a09509b0ff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "39", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ac877a52-b8a7-449e-b95e-af0a8b6017cd", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:14 GMT", + "request-id": "ac877a52-b8a7-449e-b95e-af0a8b6017cd", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4d63cb4d-faa7-43c7-8902-acf00d81da30", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:15 GMT", + "request-id": "4d63cb4d-faa7-43c7-8902-acf00d81da30", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "9b9da2c8-21b0-4004-9c0a-f2c41fc95d79", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:16 GMT", + "request-id": "9b9da2c8-21b0-4004-9c0a-f2c41fc95d79", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f23a0aff-2cb6-44d1-9953-250b53e5810d", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:17 GMT", + "request-id": "f23a0aff-2cb6-44d1-9953-250b53e5810d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e0b27dbf-b44e-43a8-ab80-3e578663c25b", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:18 GMT", + "request-id": "e0b27dbf-b44e-43a8-ab80-3e578663c25b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "37", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "98b4fb92-6b3a-4f62-83f8-e0b6e3d0dc99", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:19 GMT", + "request-id": "98b4fb92-6b3a-4f62-83f8-e0b6e3d0dc99", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7390e795-a5c5-4537-8a52-06851acfae59", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:20 GMT", + "request-id": "7390e795-a5c5-4537-8a52-06851acfae59", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0f7d89c4-dc68-49f1-8eae-c4269d2b424b", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:22 GMT", + "request-id": "0f7d89c4-dc68-49f1-8eae-c4269d2b424b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5d545a8a-2dcf-4b3e-a7d7-fe13e3f9a851", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:23 GMT", + "request-id": "5d545a8a-2dcf-4b3e-a7d7-fe13e3f9a851", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "df78e66f-d7c0-4d67-8ba6-02711ea1f1f8", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:24 GMT", + "request-id": "df78e66f-d7c0-4d67-8ba6-02711ea1f1f8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3513e128-f7b8-42d3-8d9c-287ff7afe7bb", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:25 GMT", + "request-id": "3513e128-f7b8-42d3-8d9c-287ff7afe7bb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7fb4f35c-dfd0-41c4-8a27-0c76cd292267", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:26 GMT", + "request-id": "7fb4f35c-dfd0-41c4-8a27-0c76cd292267", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e2a183c8-fe73-4ef9-a54a-6348f109b94f", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:27 GMT", + "request-id": "e2a183c8-fe73-4ef9-a54a-6348f109b94f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "273d2855-9311-4510-806a-003109908af5", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:28 GMT", + "request-id": "273d2855-9311-4510-806a-003109908af5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "082f44c0-ac8b-4d71-80b7-0bb8d344cfdf", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:29 GMT", + "request-id": "082f44c0-ac8b-4d71-80b7-0bb8d344cfdf", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "51", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "048f9e3d-82a1-4e16-9bc5-0c8e68917d04", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:30 GMT", + "request-id": "048f9e3d-82a1-4e16-9bc5-0c8e68917d04", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "fd7528da-558a-4929-994e-05944b9b6554", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:32 GMT", + "request-id": "fd7528da-558a-4929-994e-05944b9b6554", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b10f234c-6768-4577-876a-00b46a67809e", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:33 GMT", + "request-id": "b10f234c-6768-4577-876a-00b46a67809e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1314ac88-9a60-451b-ab02-c45caa00046d", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:34 GMT", + "request-id": "1314ac88-9a60-451b-ab02-c45caa00046d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d1ffa11c-f94e-4aed-9acc-4e1ce396a3f1", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:35 GMT", + "request-id": "d1ffa11c-f94e-4aed-9acc-4e1ce396a3f1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5c7cb997-bc51-404b-bda0-981acfd42f14", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:36 GMT", + "request-id": "5c7cb997-bc51-404b-bda0-981acfd42f14", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "42b1a0e8-dfa4-46af-8c9e-319c0980aa03", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:37 GMT", + "request-id": "42b1a0e8-dfa4-46af-8c9e-319c0980aa03", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1721d1ea-a08a-48f7-a3cf-5a97022b17a5", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:38 GMT", + "request-id": "1721d1ea-a08a-48f7-a3cf-5a97022b17a5", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "781a44de-e31e-4e19-a67f-7284820732b2", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:39 GMT", + "request-id": "781a44de-e31e-4e19-a67f-7284820732b2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "33", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "25650318-6d10-4ea2-88ee-bc471db709e1", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:41 GMT", + "request-id": "25650318-6d10-4ea2-88ee-bc471db709e1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a1898175-02a7-49e2-a37a-43d6ddb614df", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:42 GMT", + "request-id": "a1898175-02a7-49e2-a37a-43d6ddb614df", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d1f66e7b-2bf4-4ace-9c07-b7b8270436d6", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:43 GMT", + "request-id": "d1f66e7b-2bf4-4ace-9c07-b7b8270436d6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0cdae5e2-f2b9-405e-a0b2-770c35d09b04", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:44 GMT", + "request-id": "0cdae5e2-f2b9-405e-a0b2-770c35d09b04", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "233ac289-97d6-4ce3-9940-109e6376acf6", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:45 GMT", + "request-id": "233ac289-97d6-4ce3-9940-109e6376acf6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "04acf946-81b6-485e-8b7d-b2a817a60c82", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:46 GMT", + "request-id": "04acf946-81b6-485e-8b7d-b2a817a60c82", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "37", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2649387c-31d7-4d6b-97c0-696a6faf9022", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:47 GMT", + "request-id": "2649387c-31d7-4d6b-97c0-696a6faf9022", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2d065992-5a2a-4f33-a952-bddc2ede8932", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:48 GMT", + "request-id": "2d065992-5a2a-4f33-a952-bddc2ede8932", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6cb643a2-134e-4932-8f7f-a6d65a79a2be", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:49 GMT", + "request-id": "6cb643a2-134e-4932-8f7f-a6d65a79a2be", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "737dba3e-07fe-4287-a403-eac13d143ac9", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:51 GMT", + "request-id": "737dba3e-07fe-4287-a403-eac13d143ac9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8bc619cb-cf1b-47f5-87ba-068a73e7a27b", + "Content-Length": "554", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:52 GMT", + "request-id": "8bc619cb-cf1b-47f5-87ba-068a73e7a27b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:21:52Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "77d5c1e4-0deb-473a-a161-fc416ee99c79", + "Content-Length": "664", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:53 GMT", + "request-id": "77d5c1e4-0deb-473a-a161-fc416ee99c79", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:52.8468205Z", + "endDateTime": "2024-12-02T03:22:23.1819551Z", + "status": "succeeded" + }, + "estimatedEndDateTime": "2024-12-02T03:21:47.8155063Z" + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:22:53Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "running", + "warnings": [] + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "369234ee-2a0f-4241-ad34-c2ebb4fa1cd6", + "Content-Length": "612", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:54 GMT", + "request-id": "369234ee-2a0f-4241-ad34-c2ebb4fa1cd6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:20.8155063Z", + "endDateTime": "2024-12-02T03:21:48.6158922Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:21:52.8468205Z", + "endDateTime": "2024-12-02T03:22:23.1819551Z", + "status": "succeeded" + } + }, + "jobId": "4fc91945-d21f-4d57-98ae-9b8781257562_638686944000000000", + "createdDateTime": "2024-12-02T03:21:18Z", + "lastUpdatedDateTime": "2024-12-02T03:22:53Z", + "expirationDateTime": "2024-12-09T03:21:18Z", + "status": "succeeded", + "warnings": [] + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "748547699" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json new file mode 100644 index 000000000000..88e58a296ddf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/SessionRecords/TextAuthoringClientLiveTest/TrainAsyncAsync.json @@ -0,0 +1,3644 @@ +{ + "Entries": [ + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/:train?api-version=2024-11-15-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "155", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "modelLabel": "model1", + "trainingConfigVersion": "latest", + "evaluationOptions": { + "kind": "percentage", + "trainingSplitPercentage": 80, + "testingSplitPercentage": 20 + } + }, + "StatusCode": 202, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1d760f7a-adcf-4b7c-8fcf-8c03589be952", + "Content-Length": "0", + "Date": "Mon, 02 Dec 2024 03:22:54 GMT", + "operation-location": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "request-id": "1d760f7a-adcf-4b7c-8fcf-8c03589be952", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "108", + "x-ms-region": "East US" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "51df1fbb-af09-4832-8ba8-e1ede0673cdb", + "Content-Length": "413", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:55 GMT", + "request-id": "51df1fbb-af09-4832-8ba8-e1ede0673cdb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:22:55Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "notStarted" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e2daa0d8-948d-4fff-8b93-bc76f700a0ca", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:56 GMT", + "request-id": "e2daa0d8-948d-4fff-8b93-bc76f700a0ca", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:22:56Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "fa8a551a-5629-4164-81c1-5c5110baa488", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:57 GMT", + "request-id": "fa8a551a-5629-4164-81c1-5c5110baa488", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:22:56Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3103253c-9a76-4761-81fc-b9a2e9b46d7a", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:58 GMT", + "request-id": "3103253c-9a76-4761-81fc-b9a2e9b46d7a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:22:56Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f6a5d30a-24bb-4deb-bc81-687255010979", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:22:59 GMT", + "request-id": "f6a5d30a-24bb-4deb-bc81-687255010979", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:22:56Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "091dbf9d-3292-4a61-98e9-e124517acc32", + "Content-Length": "410", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:00 GMT", + "request-id": "091dbf9d-3292-4a61-98e9-e124517acc32", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:22:56Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3dff539a-2b5b-4536-9ba4-26bfbaab9ac6", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:01 GMT", + "request-id": "3dff539a-2b5b-4536-9ba4-26bfbaab9ac6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:01Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b7ec904d-a17c-4dbd-86fc-3fc830660906", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:02 GMT", + "request-id": "b7ec904d-a17c-4dbd-86fc-3fc830660906", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:01Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "97cc84ec-f765-46ad-ac3a-fef7021a8287", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:04 GMT", + "request-id": "97cc84ec-f765-46ad-ac3a-fef7021a8287", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:01Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f49f5309-4d5a-41b6-a03e-cd5ab226407e", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:05 GMT", + "request-id": "f49f5309-4d5a-41b6-a03e-cd5ab226407e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:01Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6fdca2ad-22d8-43dc-89cf-e5038e795e65", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:06 GMT", + "request-id": "6fdca2ad-22d8-43dc-89cf-e5038e795e65", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:05Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "52fb0fe8-7dc2-435d-a590-e1ddf43f7d78", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:07 GMT", + "request-id": "52fb0fe8-7dc2-435d-a590-e1ddf43f7d78", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:05Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a4297385-8009-49d9-ae6e-d09a16d8d33f", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:08 GMT", + "request-id": "a4297385-8009-49d9-ae6e-d09a16d8d33f", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:05Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e3e25b5a-55fa-4c61-87dd-c239b1eb2c5c", + "Content-Length": "506", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:09 GMT", + "request-id": "e3e25b5a-55fa-4c61-87dd-c239b1eb2c5c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 0, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:25:06.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:05Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c8a4f4dc-f7b4-4016-a404-e56bbdb80850", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:10 GMT", + "request-id": "c8a4f4dc-f7b4-4016-a404-e56bbdb80850", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "170", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:10Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "dd8dd8e7-21af-45d1-9179-352ae3406fb4", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:12 GMT", + "request-id": "dd8dd8e7-21af-45d1-9179-352ae3406fb4", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "41", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:10Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "716e8563-9131-4650-895b-ccd4785eb7d3", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:13 GMT", + "request-id": "716e8563-9131-4650-895b-ccd4785eb7d3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:10Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "42905c72-49aa-4f6a-af6b-5fe68602e2d3", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:14 GMT", + "request-id": "42905c72-49aa-4f6a-af6b-5fe68602e2d3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "21", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:10Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "caa451ba-42df-4d3e-969e-550cef123fd9", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:15 GMT", + "request-id": "caa451ba-42df-4d3e-969e-550cef123fd9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:14Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1259b010-bc8a-4e44-9506-69e1ae5e816e", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:16 GMT", + "request-id": "1259b010-bc8a-4e44-9506-69e1ae5e816e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:14Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a26c8de5-c261-426c-9727-e3589f064ffa", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:17 GMT", + "request-id": "a26c8de5-c261-426c-9727-e3589f064ffa", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 26, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:14Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b495611c-c63f-480d-95b8-f8bf78bb8b57", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:18 GMT", + "request-id": "b495611c-c63f-480d-95b8-f8bf78bb8b57", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 82, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:18Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "38557b9e-0073-49a2-af62-fbe66e2cc164", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:19 GMT", + "request-id": "38557b9e-0073-49a2-af62-fbe66e2cc164", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 82, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:18Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "aec0732c-b2c0-424b-b58f-1cd0213acc63", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:21 GMT", + "request-id": "aec0732c-b2c0-424b-b58f-1cd0213acc63", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 82, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:18Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "83f92100-681d-4c23-bc2f-4beb0e562012", + "Content-Length": "507", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:22 GMT", + "request-id": "83f92100-681d-4c23-bc2f-4beb0e562012", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "34", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 82, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "status": "running" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "notStarted" + }, + "estimatedEndDateTime": "2024-12-02T03:24:37.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:18Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e0a4e587-4143-4265-b844-3e32c7886a64", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:23 GMT", + "request-id": "e0a4e587-4143-4265-b844-3e32c7886a64", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "7c74e059-0338-45c4-b43c-cd0bf2927662", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:24 GMT", + "request-id": "7c74e059-0338-45c4-b43c-cd0bf2927662", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "51551e73-cf91-4de2-96f3-3617d6980a22", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:25 GMT", + "request-id": "51551e73-cf91-4de2-96f3-3617d6980a22", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ed358aad-4ecf-491d-a84e-4bf38dd01cf0", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:26 GMT", + "request-id": "ed358aad-4ecf-491d-a84e-4bf38dd01cf0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a37e6b03-f089-4bd2-986e-d76dd2281a18", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:27 GMT", + "request-id": "a37e6b03-f089-4bd2-986e-d76dd2281a18", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a0e2acf4-14e3-4f67-98d8-30b5594a47a8", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:28 GMT", + "request-id": "a0e2acf4-14e3-4f67-98d8-30b5594a47a8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c6de9f57-ed51-4ac9-9a14-7336fd50c55c", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:29 GMT", + "request-id": "c6de9f57-ed51-4ac9-9a14-7336fd50c55c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3893af55-66ac-4c98-b978-9fc09c796550", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:31 GMT", + "request-id": "3893af55-66ac-4c98-b978-9fc09c796550", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2c89428c-7e56-4a32-bf1a-a68d0a02fab6", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:32 GMT", + "request-id": "2c89428c-7e56-4a32-bf1a-a68d0a02fab6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d22e5329-43aa-415b-a201-e6cc488c7365", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:33 GMT", + "request-id": "d22e5329-43aa-415b-a201-e6cc488c7365", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "69c4d46c-a1d1-46dc-9986-8fdf261cdeed", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:34 GMT", + "request-id": "69c4d46c-a1d1-46dc-9986-8fdf261cdeed", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b808eec9-34b3-4911-8017-3746b66d7047", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:35 GMT", + "request-id": "b808eec9-34b3-4911-8017-3746b66d7047", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "cf3b0482-75a4-4813-98c5-5def4d04c701", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:36 GMT", + "request-id": "cf3b0482-75a4-4813-98c5-5def4d04c701", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4552e07d-9a28-4d6d-87a6-4537b431c3f6", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:37 GMT", + "request-id": "4552e07d-9a28-4d6d-87a6-4537b431c3f6", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5d722661-6b31-4edb-b95e-e158a21ac94a", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:38 GMT", + "request-id": "5d722661-6b31-4edb-b95e-e158a21ac94a", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "90999d4b-32ef-4208-b2e5-ba055cd22b5b", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:40 GMT", + "request-id": "90999d4b-32ef-4208-b2e5-ba055cd22b5b", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "38f1c08d-553c-42a4-9d2c-6614187b200e", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:41 GMT", + "request-id": "38f1c08d-553c-42a4-9d2c-6614187b200e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a1025c91-7f16-4fae-8186-2524945d4cef", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:42 GMT", + "request-id": "a1025c91-7f16-4fae-8186-2524945d4cef", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "36", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "bb767a05-a403-40e7-a26b-f6a990ff2d6d", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:43 GMT", + "request-id": "bb767a05-a403-40e7-a26b-f6a990ff2d6d", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "0700c673-bef4-447d-ac31-1dbb5b3afb07", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:44 GMT", + "request-id": "0700c673-bef4-447d-ac31-1dbb5b3afb07", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "ed0e667b-0abe-475f-835d-370c3be9fdb1", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:45 GMT", + "request-id": "ed0e667b-0abe-475f-835d-370c3be9fdb1", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "c805da69-b5ff-4d02-8674-e7846b61a92e", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:46 GMT", + "request-id": "c805da69-b5ff-4d02-8674-e7846b61a92e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5e4b7bc6-dc51-423e-813a-df7b270bcaf2", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:47 GMT", + "request-id": "5e4b7bc6-dc51-423e-813a-df7b270bcaf2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "accf9a44-82d2-4b29-8e07-4f07fb9f1bdc", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:49 GMT", + "request-id": "accf9a44-82d2-4b29-8e07-4f07fb9f1bdc", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "32", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f352ce2c-ad26-4249-8737-e077621bac44", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:50 GMT", + "request-id": "f352ce2c-ad26-4249-8737-e077621bac44", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "e6613f85-dfc3-4f10-a481-f19622212552", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:51 GMT", + "request-id": "e6613f85-dfc3-4f10-a481-f19622212552", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "115b47b4-71f7-400e-b2dd-688da653b821", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:52 GMT", + "request-id": "115b47b4-71f7-400e-b2dd-688da653b821", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f32f1395-2f74-4c08-8faa-2ec291cc9f13", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:53 GMT", + "request-id": "f32f1395-2f74-4c08-8faa-2ec291cc9f13", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "5447d61a-ff2f-4c9e-8a5c-797c0879df87", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:54 GMT", + "request-id": "5447d61a-ff2f-4c9e-8a5c-797c0879df87", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "25", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3987bd66-9da2-4577-bdca-125f38d1811c", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:55 GMT", + "request-id": "3987bd66-9da2-4577-bdca-125f38d1811c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "46a7d1a8-1986-482c-a5d1-dc414747c466", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:56 GMT", + "request-id": "46a7d1a8-1986-482c-a5d1-dc414747c466", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4eb4383a-3ddb-4d97-a4ab-ebe04d59a57c", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:58 GMT", + "request-id": "4eb4383a-3ddb-4d97-a4ab-ebe04d59a57c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "1b54d2d1-d64a-4007-92db-90d78a3955f3", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:23:59 GMT", + "request-id": "1b54d2d1-d64a-4007-92db-90d78a3955f3", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "2c7ae224-3ebc-4c36-9dfa-744994ccdfd2", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:00 GMT", + "request-id": "2c7ae224-3ebc-4c36-9dfa-744994ccdfd2", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d24368bc-e0b4-4b84-b12e-b83259a3e390", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:01 GMT", + "request-id": "d24368bc-e0b4-4b84-b12e-b83259a3e390", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "06fee7dd-9b1d-4683-b3b3-50e5bb7f0593", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:02 GMT", + "request-id": "06fee7dd-9b1d-4683-b3b3-50e5bb7f0593", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "30", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "57129cff-ed4d-4ea3-8dfa-af7a2ac1b6e9", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:03 GMT", + "request-id": "57129cff-ed4d-4ea3-8dfa-af7a2ac1b6e9", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "6f4a1ae1-116c-4572-ac53-244fc7da61fe", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:04 GMT", + "request-id": "6f4a1ae1-116c-4572-ac53-244fc7da61fe", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "fba0eb06-a059-4c7e-afef-6d9dd21bb223", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:06 GMT", + "request-id": "fba0eb06-a059-4c7e-afef-6d9dd21bb223", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "b23ee019-5793-4094-acb0-c8c9a5cb3d29", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:07 GMT", + "request-id": "b23ee019-5793-4094-acb0-c8c9a5cb3d29", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "a9fd119e-153e-47bd-9b8d-d944e3864c5e", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:08 GMT", + "request-id": "a9fd119e-153e-47bd-9b8d-d944e3864c5e", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "cc45ac80-af7c-4001-857c-66b6a0a1d811", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:09 GMT", + "request-id": "cc45ac80-af7c-4001-857c-66b6a0a1d811", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "31", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "d0e04296-5f4d-4b25-a0ee-aed178089982", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:10 GMT", + "request-id": "d0e04296-5f4d-4b25-a0ee-aed178089982", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "27", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "380f0df4-1a20-4430-8335-b5bc88705517", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:11 GMT", + "request-id": "380f0df4-1a20-4430-8335-b5bc88705517", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "06816886-c47f-482f-9704-2092508191b8", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:12 GMT", + "request-id": "06816886-c47f-482f-9704-2092508191b8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "bd94d737-0d53-43cf-92d1-041ccdc23824", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:13 GMT", + "request-id": "bd94d737-0d53-43cf-92d1-041ccdc23824", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "26", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "8891db82-1c90-4da9-9b6d-3051c306efcb", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:15 GMT", + "request-id": "8891db82-1c90-4da9-9b6d-3051c306efcb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "77b6a99c-1090-42df-ba64-624edd2f2024", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:16 GMT", + "request-id": "77b6a99c-1090-42df-ba64-624edd2f2024", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "352f7487-870f-4b03-8639-bd87e6f24acb", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:17 GMT", + "request-id": "352f7487-870f-4b03-8639-bd87e6f24acb", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "24", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "4368aee1-b01d-4e29-86a8-c75800512f63", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:18 GMT", + "request-id": "4368aee1-b01d-4e29-86a8-c75800512f63", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "23", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "f3fb87e0-e4e0-4dcb-beff-053b5998b431", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:19 GMT", + "request-id": "f3fb87e0-e4e0-4dcb-beff-053b5998b431", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "29", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "da8c5eda-7fd2-4d51-b0dc-4e94e4d7f972", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:20 GMT", + "request-id": "da8c5eda-7fd2-4d51-b0dc-4e94e4d7f972", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "26a8647b-b1cf-48e2-8250-eec8a123761c", + "Content-Length": "552", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:21 GMT", + "request-id": "26a8647b-b1cf-48e2-8250-eec8a123761c", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "22", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 0, + "status": "running" + }, + "estimatedEndDateTime": "2024-12-02T03:23:20.765571Z" + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:23:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "running" + } + }, + { + "RequestUri": "https://gokulk-test.cognitiveservices.azure.com/language/authoring/analyze-text/projects/MyTextProject/train/jobs/90671826-a1f5-480a-9005-f98df819a0de_638686944000000000?api-version=2024-11-15-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": "Sanitized", + "User-Agent": "azsdk-net-AI.Language.Text.Authoring/1.0.0-alpha.20241201.1 (.NET 8.0.11; Microsoft Windows 10.0.26100)", + "x-ms-client-request-id": "Sanitized", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": "*", + "apim-request-id": "3b3b028e-8e10-49ef-b7b7-5df0503ddf32", + "Content-Length": "611", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 02 Dec 2024 03:24:22 GMT", + "request-id": "3b3b028e-8e10-49ef-b7b7-5df0503ddf32", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", + "X-Content-Type-Options": "nosniff", + "x-envoy-upstream-service-time": "28", + "x-ms-region": "East US" + }, + "ResponseBody": { + "result": { + "modelLabel": "model1", + "trainingConfigVersion": "2022-05-01", + "trainingStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:22:56.765571Z", + "endDateTime": "2024-12-02T03:23:21.2056038Z", + "status": "succeeded" + }, + "evaluationStatus": { + "percentComplete": 100, + "startDateTime": "2024-12-02T03:23:22.4794541Z", + "endDateTime": "2024-12-02T03:23:49.1856326Z", + "status": "succeeded" + } + }, + "jobId": "90671826-a1f5-480a-9005-f98df819a0de_638686944000000000", + "createdDateTime": "2024-12-02T03:22:55Z", + "lastUpdatedDateTime": "2024-12-02T03:24:22Z", + "expirationDateTime": "2024-12-09T03:22:55Z", + "status": "succeeded", + "warnings": [] + } + } + ], + "Variables": { + "AZURE_TEXT_AUTHORING_ENDPOINT": "https://gokulk-test.cognitiveservices.azure.com", + "AZURE_TEXT_AUTHORING_KEY": "Sanitized", + "RandomSeed": "1742728415" + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs new file mode 100644 index 000000000000..f10cbc07d658 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tests/TextAuthoringClientLiveTest.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.Text.Authoring; +using Azure.AI.Language.Text.Authoring.Models; +using Azure.AI.Language.Text.Authoring.Tests; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; +using System.Text.Json; +using System.Security.Claims; + +namespace Azure.AI.Language.Text.Authoring.Tests +{ + public class TextAuthoringClientLiveTest : TextAuthoringTestBase + { + public TextAuthoringClientLiveTest(bool isAsync, AuthoringClientOptions.ServiceVersion serviceVersion) + : base(isAsync, serviceVersion, null /* RecordedTestMode.Record /* to record */) + { + } + + [RecordedTest] + public async Task GetProjectAsync() + { + // Arrange + string projectName = "MyTextProject"; + + // Act + Response response = await client.GetProjectAsync(projectName); + ProjectMetadata projectMetadata = response.Value; + + // Assert + Assert.IsNotNull(projectMetadata); + Assert.AreEqual(projectName, projectMetadata.ProjectName); + Assert.IsNotNull(projectMetadata.Language); + Assert.IsNotNull(projectMetadata.CreatedDateTime); + Assert.IsNotNull(projectMetadata.LastModifiedDateTime); + + Console.WriteLine($"Project Name: {projectMetadata.ProjectName}"); + Console.WriteLine($"Language: {projectMetadata.Language}"); + Console.WriteLine($"Created DateTime: {projectMetadata.CreatedDateTime}"); + Console.WriteLine($"Last Modified DateTime: {projectMetadata.LastModifiedDateTime}"); + Console.WriteLine($"Description: {projectMetadata.Description}"); + } + + [RecordedTest] + public async Task ImportAsync() + { + // Arrange + string projectName = "MyImportTextProject"; + + var projectMetadata = new CreateProjectDetails( + projectKind: "CustomSingleLabelClassification", + storageInputContainerName: "test-data", + projectName: projectName, + language: "en" + ) + { + Description = "This is a sample dataset provided by the Azure Language service team to help users get started with Custom named entity recognition. The provided sample dataset contains 20 loan agreements drawn up between two entities.", + Multilingual = false, + Settings = new ProjectSettings() + }; + + var projectAssets = new ExportedCustomSingleLabelClassificationProjectAssets + { + Classes = + { + new ExportedClass { Category = "Date" }, + new ExportedClass { Category = "LenderName" }, + new ExportedClass { Category = "LenderAddress" } + }, + Documents = + { + new ExportedCustomSingleLabelClassificationDocument + { + Class= new ExportedDocumentClass{ Category = "Date" }, + Location = "01.txt", + Language = "en" + }, + new ExportedCustomSingleLabelClassificationDocument + { + Class= new ExportedDocumentClass{ Category = "LenderName" }, + Location = "02.txt", + Language = "en" + } + } + }; + + var exportedProject = new ExportedProject( + projectFileVersion: "2022-05-01", + stringIndexType: StringIndexType.Utf16CodeUnit, + metadata: projectMetadata) + { + Assets = projectAssets + }; + + // Act + Operation operation = await client.ImportAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: exportedProject + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status); + + // Logging for additional context + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Import completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task CreateProjectAsync() + { + // Arrange + string projectName = "MyTextProject"; + var projectData = new + { + projectName = projectName, + language = "en", + projectKind = "customMultiLabelClassification", + description = "Project description for a Custom Entity Recognition project", + multilingual = true, + storageInputContainerName = "e2e0test0data" + }; + + using RequestContent content = RequestContent.Create(projectData); + + // Act + Response response = await client.CreateProjectAsync(projectName, content); + + // Assert + Assert.IsNotNull(response); + Assert.AreEqual(201, response.Status, "Expected the status to indicate project creation success."); + + // Logging for additional context + Console.WriteLine($"Project created with status: {response.Status}"); + } + + [RecordedTest] + public async Task DeleteProjectAsync() + { + // Arrange + string projectName = "MyTextProject"; + + // Act + Operation operation = await client.DeleteProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate project deletion success."); + + // Logging for additional context + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Project deletion completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task TrainAsync() + { + // Arrange + string projectName = "MyTextProject"; + + var trainingJobDetails = new TrainingJobDetails( + modelLabel: "model1", + trainingConfigVersion: "2022-05-01" + ) + { + EvaluationOptions = new EvaluationDetails + { + Kind = EvaluationKind.Percentage, + TestingSplitPercentage = 20, + TrainingSplitPercentage = 80 + } + }; + + // Act + Operation operation = await client.TrainAsync( + waitUntil: WaitUntil.Started, + projectName: projectName, + body: trainingJobDetails + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(202, operation.GetRawResponse().Status, "Expected the status to indicate successful training."); + + // Logging for additional context + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task CancelTrainingJobAsync() + { + // Arrange + string projectName = "MyTextProject"; + string jobId = "4e993615-bfe2-44bb-926b-fbe12dc17097_638686944000000000"; // Replace with an actual job ID. + + // Act + Operation operation = await client.CancelTrainingJobAsync( + waitUntil: WaitUntil.Started, + projectName: projectName, + jobId: jobId + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(202, operation.GetRawResponse().Status, "Expected the status to indicate successful cancellation."); + + // Logging for additional context + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Training job cancellation completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task GetModelEvaluationSummaryAsync() + { + // Arrange + string projectName = "MyTextProject"; + string trainedModelLabel = "model1"; + + // Act + Response evaluationSummaryResponse = await client.GetModelEvaluationSummaryAsync(projectName, trainedModelLabel); + + EvaluationSummary evaluationSummary = evaluationSummaryResponse.Value; + + // Assert + Assert.IsNotNull(evaluationSummary, "Evaluation summary should not be null."); + + // Specific type assertion for single-label classification + if (evaluationSummary is CustomSingleLabelClassificationEvaluationSummary singleLabelSummary) + { + Assert.IsNotNull(singleLabelSummary.EvaluationOptions, "Evaluation options should not be null."); + Assert.IsNotNull(singleLabelSummary.CustomSingleLabelClassificationEvaluation, "Evaluation metrics should not be null."); + Assert.IsNotEmpty(singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes, "Class-specific metrics should not be empty."); + + Console.WriteLine($"Project Kind: CustomSingleLabelClassification"); + Console.WriteLine($"Evaluation Options: "); + Console.WriteLine($" Kind: {singleLabelSummary.EvaluationOptions.Kind}"); + Console.WriteLine($" Training Split Percentage: {singleLabelSummary.EvaluationOptions.TrainingSplitPercentage}"); + Console.WriteLine($" Testing Split Percentage: {singleLabelSummary.EvaluationOptions.TestingSplitPercentage}"); + + Console.WriteLine($"Micro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroF1}"); + Console.WriteLine($"Micro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroPrecision}"); + Console.WriteLine($"Micro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MicroRecall}"); + Console.WriteLine($"Macro F1: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroF1}"); + Console.WriteLine($"Macro Precision: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroPrecision}"); + Console.WriteLine($"Macro Recall: {singleLabelSummary.CustomSingleLabelClassificationEvaluation.MacroRecall}"); + + // Print confusion matrix + Console.WriteLine("Confusion Matrix:"); + foreach (var row in singleLabelSummary.CustomSingleLabelClassificationEvaluation.ConfusionMatrix.AdditionalProperties) + { + Console.WriteLine($"Row: {row.Key}"); + // Convert BinaryData to JSON string + var json = row.Value.ToString(); + // Deserialize JSON string to dictionary + var columnData = JsonSerializer.Deserialize>>(json); + + foreach (var col in columnData) + { + Console.WriteLine($" Column: {col.Key}, Normalized Value: {col.Value["normalizedValue"]}, Raw Value: {col.Value["rawValue"]}"); + } + } + + // Print class-specific metrics + Console.WriteLine("Class-Specific Metrics:"); + foreach (var kvp in singleLabelSummary.CustomSingleLabelClassificationEvaluation.Classes) + { + Console.WriteLine($"Class: {kvp.Key}"); + Console.WriteLine($" F1: {kvp.Value.F1}"); + Console.WriteLine($" Precision: {kvp.Value.Precision}"); + Console.WriteLine($" Recall: {kvp.Value.Recall}"); + Console.WriteLine($" True Positives: {kvp.Value.TruePositiveCount}"); + Console.WriteLine($" True Negatives: {kvp.Value.TrueNegativeCount}"); + Console.WriteLine($" False Positives: {kvp.Value.FalsePositiveCount}"); + Console.WriteLine($" False Negatives: {kvp.Value.FalseNegativeCount}"); + } + } + else + { + Console.WriteLine("The returned evaluation summary is not for a single-label classification project."); + Assert.Fail("Unexpected evaluation summary type."); + } + } + + [RecordedTest] + public async Task LoadSnapshotAsync() + { + // Arrange + string projectName = "MyTextProject"; + string trainedModelLabel = "model1"; // Replace with your actual model label. + + // Act + Operation operation = await client.LoadSnapshotAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful snapshot loading."); + + // Logging for additional context + string operationLocation = operation.GetRawResponse().Headers.TryGetValue("operation-location", out var location) ? location : null; + Console.WriteLine($"Operation Location: {operationLocation}"); + Console.WriteLine($"Snapshot loading completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task DeleteTrainedModelAsync() + { + // Arrange + string projectName = "MyTextProject"; + string trainedModelLabel = "model1"; // Replace with the actual model label. + + // Act + Response response = await client.DeleteTrainedModelAsync( + projectName: projectName, + trainedModelLabel: trainedModelLabel + ); + + // Assert + Assert.IsNotNull(response); + Assert.AreEqual(204, response.Status, "Expected the status to indicate successful deletion."); + + // Logging for additional context + Console.WriteLine($"Trained model deleted. Response status: {response.Status}"); + } + + [RecordedTest] + public async Task DeployProjectAsync() + { + // Arrange + string projectName = "MyTextProject"; + string deploymentName = "deployment1"; + var deploymentDetails = new CreateDeploymentDetails(trainedModelLabel: "m2"); + + // Act + Operation operation = await client.DeployProjectAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName, + body: deploymentDetails + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deployment."); + + // Logging for additional context + Console.WriteLine($"Deployment operation status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task SwapDeploymentsAsync() + { + // Arrange + string projectName = "MyTextProject"; + var swapDetails = new SwapDeploymentsDetails( + firstDeploymentName: "deployment1", + secondDeploymentName: "deployment2" + ); + + // Act + Operation operation = await client.SwapDeploymentsAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + body: swapDetails + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful swap."); + + // Logging for additional context + Console.WriteLine($"Swap operation completed with status: {operation.GetRawResponse().Status}"); + } + + [RecordedTest] + public async Task DeleteDeploymentAsync() + { + // Arrange + string projectName = "MyTextProject"; + string deploymentName = "deployment2"; + + // Act + Operation operation = await client.DeleteDeploymentAsync( + waitUntil: WaitUntil.Completed, + projectName: projectName, + deploymentName: deploymentName + ); + + // Assert + Assert.IsNotNull(operation); + Assert.AreEqual(200, operation.GetRawResponse().Status, "Expected the status to indicate successful deletion."); + + // Logging for additional context + Console.WriteLine($"Deployment deletion completed with status: {operation.GetRawResponse().Status}"); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml new file mode 100644 index 000000000000..1c0e1d21fd59 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text.Authoring/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeText-authoring +commit: 1bbb8f628f6e3083b73a2190e15bb0f5911571a3 +repo: Azure/azure-rest-api-specs + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md index b6748a7752b2..c084254633cf 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text/README.md @@ -261,17 +261,17 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md [azure_identity_install]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#install-the-package -[custom_domain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[custom_domain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [source_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Text/samples [source_migration]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text/MigrationGuide.md [source_root]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text/src [package]: https://www.nuget.org/packages/ [text_refdocs]: https://learn.microsoft.com/dotnet/ -[text_docs]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/ +[text_docs]: https://learn.microsoft.com/azure/cognitive-services/text-analytics/ [azure_sub]: https://azure.microsoft.com/free/dotnet/ [textanalysisclient_class]: https://github.com/azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Text/src/TextAnalysisClient.cs -[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication/ -[azure_cli]: https://docs.microsoft.com/cli/azure +[cognitive_auth]: https://learn.microsoft.com/azure/cognitive-services/authentication/ +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Text/README.png) diff --git a/sdk/cognitivelanguage/ci.yml b/sdk/cognitivelanguage/ci.yml index c390871367d5..94833d4263e6 100644 --- a/sdk/cognitivelanguage/ci.yml +++ b/sdk/cognitivelanguage/ci.yml @@ -26,6 +26,10 @@ extends: ServiceDirectory: cognitivelanguage ArtifactName: packages Artifacts: + - name: Azure.AI.Language.Text.Authoring + safeName: AzureAILanguageTextAuthoring + - name: Azure.AI.Language.Conversations.Authoring + safeName: AzureAILanguageConversationsAuthoring - name: Azure.AI.Language.Text safeName: AzureAILanguageText - name: Azure.AI.Language.Conversations diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/CHANGELOG.md b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/CHANGELOG.md index 489aea9a8239..053880f12548 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/CHANGELOG.md +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/CHANGELOG.md @@ -109,8 +109,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -141,4 +141,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md index dde1f262a716..8f25489e581f 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/communication/Azure.Communication.AlphaIds/README.md b/sdk/communication/Azure.Communication.AlphaIds/README.md index e62662928a5c..8775fba6bdb3 100644 --- a/sdk/communication/Azure.Communication.AlphaIds/README.md +++ b/sdk/communication/Azure.Communication.AlphaIds/README.md @@ -73,8 +73,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net [nuget]: https://www.nuget.org/ diff --git a/sdk/communication/Azure.Communication.CallAutomation/CHANGELOG.md b/sdk/communication/Azure.Communication.CallAutomation/CHANGELOG.md index bbcb85fb77a1..8f626279745c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.CallAutomation/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.4.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,54 @@ ### Other Changes +## 1.4.0-beta.1 (2024-11-22) + +### Features Added + +- Added support for ConnectAPI to enable streaming and real-time transcription +- Enhanced media streaming with bidirectional capabilities, enabling support for audio formats in both directions. Currently, it supports sample rates of 24kHz and 16kHz + +### Other Changes + +- Introduced audio streaming and transcription data parsing capabilities. + +## 1.3.0 (2024-11-22) + +### Features Added + +- Support multiple play sources for Play and Recognize +- Support for PlayStarted event in Play/Recognize +- Hold and Unhold the participant +- CallDisconnected now includes more information on why the call has ended +- Support to manage the rooms/servercall/group call using connect API +- Expose original PSTN number target from incoming call event in call connection properties +- Support for VoIP to PSTN transfer scenario + +### Other Changes + +- Added CreateCallFailed event to signify when create call API fails to establish a call +- Added AnswerFailed event to signify when answer call API fails to answer a call + +## 1.3.0-beta.2 (2024-10-28) + +### Features Added + +- Added CreateCallFailed event to signify when create call API fails to establish a call + +## 1.3.0-beta.1 (2024-08-02) + +### Features Added + +- Support multiple play sources for Play and Recognize +- Support for PlayStarted event in Play/Recognize +- Support for the real time transcription +- Monetization for real-time transcription and audio streaming +- Hold and Unhold the participant +- Support to manage the rooms/servercall/group call using connect API +- Support for the audio streaming +- Expose original PSTN number target from incoming call event in call connection properties +- Support for VoIP to PSTN transfer scenario + ## 1.2.0 (2024-04-15) ### Features Added diff --git a/sdk/communication/Azure.Communication.CallAutomation/README.md b/sdk/communication/Azure.Communication.CallAutomation/README.md index 6241f53cb1f2..dbd12535fbb6 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/README.md +++ b/sdk/communication/Azure.Communication.CallAutomation/README.md @@ -195,11 +195,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [nuget]: https://www.nuget.org/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.CallAutomation/src [overview]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation diff --git a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.net8.0.cs b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.net8.0.cs index 1aee4414a994..934d76ce72cc 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.net8.0.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.net8.0.cs @@ -69,26 +69,45 @@ public partial class AnswerFailed : Azure.Communication.CallAutomation.CallAutom internal AnswerFailed() { } public static Azure.Communication.CallAutomation.AnswerFailed Deserialize(string content) { throw null; } } + [System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public enum AudioChannel + { + Unknown = 0, + Mono = 1, + } public partial class AudioData : Azure.Communication.CallAutomation.StreamingData { - internal AudioData() { } - public string Data { get { throw null; } } + public AudioData(byte[] data) { } + public byte[] Data { get { throw null; } } public bool IsSilent { get { throw null; } } public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } } - public System.DateTime Timestamp { get { throw null; } } + public System.DateTimeOffset Timestamp { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AudioFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AudioFormat(string value) { throw null; } + public static Azure.Communication.CallAutomation.AudioFormat Pcm16KMono { get { throw null; } } + public static Azure.Communication.CallAutomation.AudioFormat Pcm24KMono { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.AudioFormat 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.Communication.CallAutomation.AudioFormat left, Azure.Communication.CallAutomation.AudioFormat right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.AudioFormat (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.AudioFormat left, Azure.Communication.CallAutomation.AudioFormat right) { throw null; } + public override string ToString() { throw null; } } public partial class AudioMetadata : Azure.Communication.CallAutomation.StreamingData { - public AudioMetadata() { } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("channels")] - public int Channels { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("encoding")] + internal AudioMetadata() { } + public Azure.Communication.CallAutomation.AudioChannel Channels { get { throw null; } set { } } public string Encoding { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("length")] public int Length { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("subscriptionId")] public string MediaSubscriptionId { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("sampleRate")] public int SampleRate { get { throw null; } set { } } } public partial class AzureOpenAIDialog : Azure.Communication.CallAutomation.BaseDialog @@ -112,12 +131,15 @@ public CallAutomationClient(string connectionString, Azure.Communication.CallAut public CallAutomationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { } public CallAutomationClient(System.Uri pmaEndpoint, string connectionString, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { } public CallAutomationClient(System.Uri pmaEndpoint, System.Uri acsEndpoint, Azure.Core.TokenCredential credential, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { } - public Azure.Communication.MicrosoftTeamsAppIdentifier OPSSource { get { throw null; } } public Azure.Communication.CommunicationUserIdentifier Source { get { throw null; } } public virtual Azure.Response AnswerCall(Azure.Communication.CallAutomation.AnswerCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response AnswerCall(string incomingCallContext, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AnswerCallAsync(Azure.Communication.CallAutomation.AnswerCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AnswerCallAsync(string incomingCallContext, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ConnectCall(Azure.Communication.CallAutomation.CallLocator callLocator, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ConnectCall(Azure.Communication.CallAutomation.ConnectCallOptions connectCallOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ConnectCallAsync(Azure.Communication.CallAutomation.CallLocator callLocator, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ConnectCallAsync(Azure.Communication.CallAutomation.ConnectCallOptions connectCallOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateCall(Azure.Communication.CallAutomation.CallInvite callInvite, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateCall(Azure.Communication.CallAutomation.CreateCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateCallAsync(Azure.Communication.CallAutomation.CallInvite callInvite, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -138,8 +160,7 @@ public CallAutomationClient(System.Uri pmaEndpoint, System.Uri acsEndpoint, Azur } public partial class CallAutomationClientOptions : Azure.Core.ClientOptions { - public CallAutomationClientOptions(Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion version = Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion.V2023_10_03_Preview) { } - public Azure.Communication.MicrosoftTeamsAppIdentifier OPSSource { get { throw null; } set { } } + public CallAutomationClientOptions(Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion version = Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion.V2024_09_01_Preview) { } public Azure.Communication.CommunicationUserIdentifier Source { get { throw null; } set { } } public enum ServiceVersion { @@ -147,6 +168,7 @@ public enum ServiceVersion V2023_06_15_Preview = 2, V2023_10_15 = 3, V2023_10_03_Preview = 4, + V2024_09_01_Preview = 5, } } public abstract partial class CallAutomationEventBase @@ -185,17 +207,16 @@ public static partial class CallAutomationModelFactory public static Azure.Communication.CallAutomation.AddParticipantSucceeded AddParticipantSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CommunicationIdentifier participant = null) { throw null; } public static Azure.Communication.CallAutomation.AnswerCallResult AnswerCallResult(Azure.Communication.CallAutomation.CallConnection callConnection = null, Azure.Communication.CallAutomation.CallConnectionProperties callConnectionProperties = null) { throw null; } public static Azure.Communication.CallAutomation.AnswerFailed AnswerFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties(string callConnectionId = null, string serverCallId = null, System.Collections.Generic.IEnumerable targets = null, Azure.Communication.CallAutomation.CallConnectionState callConnectionState = default(Azure.Communication.CallAutomation.CallConnectionState), System.Uri callbackUri = null, Azure.Communication.CommunicationIdentifier sourceIdentity = null, Azure.Communication.PhoneNumberIdentifier sourceCallerIdNumber = null, string sourceDisplayName = null, Azure.Communication.CommunicationUserIdentifier answeredBy = null, string mediaSubscriptionId = null, string dataSubscriptionId = null) { throw null; } - public static Azure.Communication.CallAutomation.CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } + public static Azure.Communication.CallAutomation.CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties(string callConnectionId = null, string serverCallId = null, System.Collections.Generic.IEnumerable targets = null, Azure.Communication.CallAutomation.CallConnectionState callConnectionState = default(Azure.Communication.CallAutomation.CallConnectionState), System.Uri callbackUri = null, Azure.Communication.CommunicationIdentifier sourceIdentity = null, Azure.Communication.PhoneNumberIdentifier sourceCallerIdNumber = null, string sourceDisplayName = null, Azure.Communication.CommunicationUserIdentifier answeredBy = null, Azure.Communication.CallAutomation.MediaStreamingSubscription mediaStreamingSubscription = null, Azure.Communication.CallAutomation.TranscriptionSubscription transcriptionSubscription = null, Azure.Communication.PhoneNumberIdentifier answeredFor = null) { throw null; } + public static Azure.Communication.CallAutomation.CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.CallParticipant CallParticipant(Azure.Communication.CommunicationIdentifier identifier = null, bool isMuted = false, bool isOnHold = false) { throw null; } public static Azure.Communication.CallAutomation.CallTransferAccepted CallTransferAccepted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CommunicationIdentifier transferee = null, Azure.Communication.CommunicationIdentifier transferTarget = null) { throw null; } public static Azure.Communication.CallAutomation.CallTransferFailed CallTransferFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.CancelAddParticipantFailed CancelAddParticipantFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string invitationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.CancelAddParticipantOperationResult CancelAddParticipantResult(string invitationId = null, string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.CancelAddParticipantSucceeded CancelAddParticipantSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string invitationId = null, Azure.Communication.CommunicationIdentifier participant = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.CancelAddParticipantSucceeded CancelAddParticipantSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string invitationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.ChoiceResult ChoiceResult(string label = null, string recognizedPhrase = null) { throw null; } - public static Azure.Communication.CallAutomation.CollectTonesResult CollectTonesResult(System.Collections.Generic.IEnumerable tones = null) { throw null; } public static Azure.Communication.CallAutomation.ContinuousDtmfRecognitionStopped ContinuousDtmfRecognitionStopped(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.ContinuousDtmfRecognitionToneFailed ContinuousDtmfRecognitionToneFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.ContinuousDtmfRecognitionToneReceived ContinuousDtmfRecognitionToneReceived(int? sequenceId = default(int?), Azure.Communication.CallAutomation.DtmfTone? tone = default(Azure.Communication.CallAutomation.DtmfTone?), string callConnectionId = null, string serverCallId = null, string correlationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } @@ -203,21 +224,19 @@ public static partial class CallAutomationModelFactory public static Azure.Communication.CallAutomation.CreateCallResult CreateCallResult(Azure.Communication.CallAutomation.CallConnection callConnection = null, Azure.Communication.CallAutomation.CallConnectionProperties callConnectionProperties = null) { throw null; } public static Azure.Communication.CallAutomation.DtmfResult DtmfResult(System.Collections.Generic.IEnumerable tones = null) { throw null; } public static Azure.Communication.CallAutomation.HoldFailed HoldFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.MediaStreamingFailed MediaStreamingFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.MediaStreamingStarted MediaStreamingStarted(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.MediaStreamingStopped MediaStreamingStopped(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingFailed MediaStreamingFailed(Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingStarted MediaStreamingStarted(Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingStopped MediaStreamingStopped(Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.MediaStreamingUpdate MediaStreamingUpdate(string contentType = null, Azure.Communication.CallAutomation.MediaStreamingStatus? mediaStreamingStatus = default(Azure.Communication.CallAutomation.MediaStreamingStatus?), Azure.Communication.CallAutomation.MediaStreamingStatusDetails? mediaStreamingStatusDetails = default(Azure.Communication.CallAutomation.MediaStreamingStatusDetails?)) { throw null; } public static Azure.Communication.CallAutomation.MuteParticipantResult MuteParticipantResult(string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.ParticipantsUpdated ParticipantsUpdated(string callConnectionId = null, string serverCallId = null, string correlationId = null, System.Collections.Generic.IEnumerable participants = null, int sequenceNumber = 0) { throw null; } - public static Azure.Communication.CallAutomation.PlayCanceled PlayCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } + public static Azure.Communication.CallAutomation.ParticipantsUpdated ParticipantsUpdated(string callConnectionId = null, string serverCallId = null, string correlationId = null, System.Collections.Generic.IEnumerable participants = null, int sequenceNumber = 0, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.PlayCanceled PlayCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.PlayCompleted PlayCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.PlayFailed PlayFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?), string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.PlayFailed PlayFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.RecognizeCanceled RecognizeCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } + public static Azure.Communication.CallAutomation.PlayFailed PlayFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?)) { throw null; } + public static Azure.Communication.CallAutomation.RecognizeCanceled RecognizeCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.RecognizeCompleted RecognizeCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.CallMediaRecognitionType recognitionType = default(Azure.Communication.CallAutomation.CallMediaRecognitionType), Azure.Communication.CallAutomation.RecognizeResult recognizeResult = null) { throw null; } - public static Azure.Communication.CallAutomation.RecognizeFailed RecognizeFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?), string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.RecognizeFailed RecognizeFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.RecordingStateChanged RecordingStateChanged(string callConnectionId = null, string serverCallId = null, string correlationId = null, string recordingId = null, Azure.Communication.CallAutomation.RecordingState state = default(Azure.Communication.CallAutomation.RecordingState), System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), Azure.Communication.CallAutomation.RecordingKind? recordingKind = default(Azure.Communication.CallAutomation.RecordingKind?)) { throw null; } + public static Azure.Communication.CallAutomation.RecognizeFailed RecognizeFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?)) { throw null; } + public static Azure.Communication.CallAutomation.RecordingStateChanged RecordingStateChanged(string callConnectionId = null, string serverCallId = null, string correlationId = null, string recordingId = null, Azure.Communication.CallAutomation.RecordingState state = default(Azure.Communication.CallAutomation.RecordingState), System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), Azure.Communication.CallAutomation.RecordingKind? recordingKind = default(Azure.Communication.CallAutomation.RecordingKind?), Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.RecordingStateResult RecordingStateResult(string recordingId = null, Azure.Communication.CallAutomation.RecordingState? recordingState = default(Azure.Communication.CallAutomation.RecordingState?), Azure.Communication.CallAutomation.RecordingKind? recordingKind = default(Azure.Communication.CallAutomation.RecordingKind?)) { throw null; } public static Azure.Communication.CallAutomation.RemoveParticipantFailed RemoveParticipantFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CommunicationIdentifier participant = null) { throw null; } public static Azure.Communication.CallAutomation.RemoveParticipantResult RemoveParticipantResult(string operationContext = null) { throw null; } @@ -227,11 +246,11 @@ public static partial class CallAutomationModelFactory public static Azure.Communication.CallAutomation.SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionStopped TranscriptionStopped(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionStopped TranscriptionStopped(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.TranscriptionUpdate TranscriptionUpdate(Azure.Communication.CallAutomation.TranscriptionStatus? transcriptionStatus = default(Azure.Communication.CallAutomation.TranscriptionStatus?), Azure.Communication.CallAutomation.TranscriptionStatusDetails? transcriptionStatusDetails = default(Azure.Communication.CallAutomation.TranscriptionStatusDetails?)) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionUpdated TranscriptionUpdated(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionUpdated TranscriptionUpdated(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.TransferCallToParticipantResult TransferCallToParticipantResult(string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.UnmuteParticipantResult UnmuteParticipantResult(string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.UserConsent UserConsent(int? recording = default(int?)) { throw null; } @@ -284,17 +303,18 @@ public partial class CallConnectionProperties { internal CallConnectionProperties() { } public Azure.Communication.CommunicationUserIdentifier AnsweredBy { get { throw null; } } + public Azure.Communication.PhoneNumberIdentifier AnsweredFor { get { throw null; } } public System.Uri CallbackUri { get { throw null; } } public string CallConnectionId { get { throw null; } } public Azure.Communication.CallAutomation.CallConnectionState CallConnectionState { get { throw null; } } public string CorrelationId { get { throw null; } } - public string DataSubscriptionId { get { throw null; } } - public string MediaSubscriptionId { get { throw null; } } + public Azure.Communication.CallAutomation.MediaStreamingSubscription MediaStreamingSubscription { get { throw null; } } public string ServerCallId { get { throw null; } } public Azure.Communication.CommunicationIdentifier Source { get { throw null; } } public Azure.Communication.PhoneNumberIdentifier SourceCallerIdNumber { get { throw null; } } public string SourceDisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public Azure.Communication.CallAutomation.TranscriptionSubscription TranscriptionSubscription { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CallConnectionState : System.IEquatable @@ -366,15 +386,23 @@ protected CallMedia() { } public virtual Azure.Response CancelAllMediaOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CancelAllMediaOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Hold(Azure.Communication.CallAutomation.HoldOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Hold(Azure.Communication.CommunicationIdentifier targetParticipant, Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Hold(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task HoldAsync(Azure.Communication.CallAutomation.HoldOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task HoldAsync(Azure.Communication.CommunicationIdentifier targetParticipant, Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task HoldAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Play(Azure.Communication.CallAutomation.PlayOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Play(Azure.Communication.CallAutomation.PlaySource playSource, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Play(System.Collections.Generic.IEnumerable playSources, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayAsync(Azure.Communication.CallAutomation.PlayOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayAsync(Azure.Communication.CallAutomation.PlaySource playSource, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlayAsync(System.Collections.Generic.IEnumerable playSources, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response PlayToAll(Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response PlayToAll(Azure.Communication.CallAutomation.PlayToAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PlayToAll(System.Collections.Generic.IEnumerable playSources, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayToAllAsync(Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayToAllAsync(Azure.Communication.CallAutomation.PlayToAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlayToAllAsync(System.Collections.Generic.IEnumerable playSources, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SendDtmfTones(Azure.Communication.CallAutomation.SendDtmfTonesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SendDtmfTones(System.Collections.Generic.IEnumerable tones, Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SendDtmfTonesAsync(Azure.Communication.CallAutomation.SendDtmfTonesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -383,10 +411,8 @@ protected CallMedia() { } public virtual Azure.Response StartContinuousDtmfRecognition(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartContinuousDtmfRecognitionAsync(Azure.Communication.CallAutomation.ContinuousDtmfRecognitionOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartContinuousDtmfRecognitionAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us Hold instead.")] - public virtual Azure.Response StartHoldMusic(Azure.Communication.CallAutomation.StartHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us HoldAsync instead.")] - public virtual System.Threading.Tasks.Task StartHoldMusicAsync(Azure.Communication.CallAutomation.StartHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response StartMediaStreaming(Azure.Communication.CallAutomation.StartMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartMediaStreamingAsync(Azure.Communication.CallAutomation.StartMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StartRecognizing(Azure.Communication.CallAutomation.CallMediaRecognizeOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StartRecognizingAsync(Azure.Communication.CallAutomation.CallMediaRecognizeOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StartTranscription(Azure.Communication.CallAutomation.StartTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -395,15 +421,17 @@ protected CallMedia() { } public virtual Azure.Response StopContinuousDtmfRecognition(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopContinuousDtmfRecognitionAsync(Azure.Communication.CallAutomation.ContinuousDtmfRecognitionOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopContinuousDtmfRecognitionAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us Unhold instead.")] - public virtual Azure.Response StopHoldMusic(Azure.Communication.CallAutomation.StopHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us UnholdAsync instead.")] - public virtual System.Threading.Tasks.Task StopHoldMusicAsync(Azure.Communication.CallAutomation.StopHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response StopMediaStreaming(Azure.Communication.CallAutomation.StopMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StopMediaStreamingAsync(Azure.Communication.CallAutomation.StopMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StopTranscription(Azure.Communication.CallAutomation.StopTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopTranscriptionAsync(Azure.Communication.CallAutomation.StopTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Unhold(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Unhold(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UnholdAsync(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnholdAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateTranscription(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateTranscriptionAsync(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateTranscriptionAsync(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -446,6 +474,7 @@ protected CallMediaRecognizeOptions(Azure.Communication.CallAutomation.Recognize public bool InterruptPrompt { get { throw null; } set { } } public System.Uri OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public System.Collections.Generic.IList PlayPrompts { get { throw null; } set { } } public Azure.Communication.CallAutomation.PlaySource Prompt { get { throw null; } set { } } public string SpeechLanguage { get { throw null; } set { } } public string SpeechModelEndpointId { get { throw null; } set { } } @@ -586,12 +615,35 @@ internal ChoiceResult() { } public string RecognizedPhrase { get { throw null; } } public override Azure.Communication.CallAutomation.RecognizeResultType ResultType { get { throw null; } } } - public partial class CollectTonesResult : Azure.Communication.CallAutomation.RecognizeResult + public partial class ConnectCallEventResult { - internal CollectTonesResult() { } - public override Azure.Communication.CallAutomation.RecognizeResultType ResultType { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Tones { get { throw null; } } - public string ConvertToString() { throw null; } + internal ConnectCallEventResult() { } + public Azure.Communication.CallAutomation.ConnectFailed FailureResult { get { throw null; } } + public bool IsSuccess { get { throw null; } } + public Azure.Communication.CallAutomation.CallConnected SuccessResult { get { throw null; } } + } + public partial class ConnectCallOptions + { + public ConnectCallOptions(Azure.Communication.CallAutomation.CallLocator callLocator, System.Uri callbackUri) { } + public System.Uri CallbackUri { get { throw null; } } + public Azure.Communication.CallAutomation.CallIntelligenceOptions CallIntelligenceOptions { get { throw null; } set { } } + public Azure.Communication.CallAutomation.CallLocator CallLocator { get { throw null; } } + public Azure.Communication.CallAutomation.MediaStreamingOptions MediaStreamingOptions { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + public Azure.Communication.CallAutomation.TranscriptionOptions TranscriptionOptions { get { throw null; } set { } } + } + public partial class ConnectCallResult + { + internal ConnectCallResult() { } + public Azure.Communication.CallAutomation.CallConnection CallConnection { get { throw null; } } + public Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties { get { throw null; } } + public Azure.Communication.CallAutomation.ConnectCallEventResult WaitForEventProcessor(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.Task WaitForEventProcessorAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConnectFailed : Azure.Communication.CallAutomation.CallAutomationEventBase + { + internal ConnectFailed() { } + public static Azure.Communication.CallAutomation.ConnectFailed Deserialize(string content) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct ContentTransferOptions : System.IEquatable @@ -655,6 +707,7 @@ public CreateCallOptions(Azure.Communication.CallAutomation.CallInvite callInvit public Azure.Communication.CallAutomation.CallInvite CallInvite { get { throw null; } } public Azure.Communication.CallAutomation.MediaStreamingOptions MediaStreamingOptions { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public Azure.Communication.MicrosoftTeamsAppIdentifier TeamsAppSource { get { throw null; } set { } } public Azure.Communication.CallAutomation.TranscriptionOptions TranscriptionOptions { get { throw null; } set { } } } public partial class CreateCallResult @@ -676,6 +729,7 @@ public CreateGroupCallOptions(System.Collections.Generic.IEnumerable Targets { get { throw null; } } + public Azure.Communication.MicrosoftTeamsAppIdentifier TeamsAppSource { get { throw null; } set { } } public Azure.Communication.CallAutomation.TranscriptionOptions TranscriptionOptions { get { throw null; } set { } } } public partial class CustomCallingContext @@ -857,6 +911,12 @@ public GroupCallLocator(string id) { } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } + public partial class HoldEventResult + { + internal HoldEventResult() { } + public Azure.Communication.CallAutomation.HoldFailed FailureResult { get { throw null; } } + public bool IsSuccess { get { throw null; } } + } public partial class HoldFailed : Azure.Communication.CallAutomation.CallAutomationEventBase { internal HoldFailed() { } @@ -868,9 +928,26 @@ public partial class HoldOptions public HoldOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { } public System.Uri OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } - public Azure.Communication.CallAutomation.PlaySource PlaySourceInfo { get { throw null; } set { } } + public Azure.Communication.CallAutomation.PlaySource PlaySource { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } } + public partial class HoldResult + { + internal HoldResult() { } + public Azure.Communication.CallAutomation.HoldEventResult WaitForEventProcessor(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.Task WaitForEventProcessorAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IncomingCall : Azure.Communication.CallAutomation.CallAutomationEventBase + { + internal IncomingCall() { } + public string CallerDisplayName { get { throw null; } } + public Azure.Communication.CallAutomation.CustomCallingContext CustomContext { get { throw null; } } + public Azure.Communication.CommunicationIdentifier From { get { throw null; } } + public string IncomingCallContext { get { throw null; } } + public Azure.Communication.CommunicationIdentifier OnBehalfOfCallee { get { throw null; } } + public Azure.Communication.CommunicationIdentifier To { get { throw null; } } + public static Azure.Communication.CallAutomation.IncomingCall Deserialize(string content) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaEventReasonCode : System.IEquatable { @@ -905,6 +982,12 @@ public HoldOptions(Azure.Communication.CommunicationIdentifier targetParticipant public static bool operator !=(Azure.Communication.CallAutomation.MediaEventReasonCode left, Azure.Communication.CallAutomation.MediaEventReasonCode right) { throw null; } public override string ToString() { throw null; } } + [System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public enum MediaKind + { + AudioData = 0, + StopAudio = 1, + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaStreamingAudioChannel : System.IEquatable { @@ -923,14 +1006,6 @@ public HoldOptions(Azure.Communication.CommunicationIdentifier targetParticipant public static bool operator !=(Azure.Communication.CallAutomation.MediaStreamingAudioChannel left, Azure.Communication.CallAutomation.MediaStreamingAudioChannel right) { throw null; } public override string ToString() { throw null; } } - public partial class MediaStreamingConfiguration - { - public MediaStreamingConfiguration(System.Uri transportUrl, Azure.Communication.CallAutomation.MediaStreamingTransport transportType, Azure.Communication.CallAutomation.MediaStreamingContent contentType, Azure.Communication.CallAutomation.MediaStreamingAudioChannel audioChannelType) { } - public Azure.Communication.CallAutomation.MediaStreamingAudioChannel AudioChannelType { get { throw null; } } - public Azure.Communication.CallAutomation.MediaStreamingContent ContentType { get { throw null; } } - public Azure.Communication.CallAutomation.MediaStreamingTransport TransportType { get { throw null; } } - public System.Uri TransportUrl { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaStreamingContent : System.IEquatable { @@ -956,10 +1031,13 @@ internal MediaStreamingFailed() { } } public partial class MediaStreamingOptions { - public MediaStreamingOptions(System.Uri transportUri, Azure.Communication.CallAutomation.MediaStreamingTransport transportType, Azure.Communication.CallAutomation.MediaStreamingContent contentType, Azure.Communication.CallAutomation.MediaStreamingAudioChannel audioChannelType) { } + public MediaStreamingOptions(System.Uri transportUri, Azure.Communication.CallAutomation.MediaStreamingContent contentType, Azure.Communication.CallAutomation.MediaStreamingAudioChannel audioChannelType, Azure.Communication.CallAutomation.MediaStreamingTransport transportType = default(Azure.Communication.CallAutomation.MediaStreamingTransport), bool? startMediaStreaming = default(bool?)) { } + public Azure.Communication.CallAutomation.AudioFormat? AudioFormat { get { throw null; } set { } } + public bool? EnableBidirectional { get { throw null; } set { } } public Azure.Communication.CallAutomation.MediaStreamingAudioChannel MediaStreamingAudioChannel { get { throw null; } } public Azure.Communication.CallAutomation.MediaStreamingContent MediaStreamingContent { get { throw null; } } public Azure.Communication.CallAutomation.MediaStreamingTransport MediaStreamingTransport { get { throw null; } } + public bool? StartMediaStreaming { get { throw null; } set { } } public System.Uri TransportUri { get { throw null; } } } public partial class MediaStreamingStarted : Azure.Communication.CallAutomation.CallAutomationEventBase @@ -1025,6 +1103,32 @@ internal MediaStreamingStopped() { } public Azure.Communication.CallAutomation.MediaStreamingUpdate MediaStreamingUpdate { get { throw null; } } public static Azure.Communication.CallAutomation.MediaStreamingStopped Deserialize(string content) { throw null; } } + public partial class MediaStreamingSubscription + { + public MediaStreamingSubscription(string id, Azure.Communication.CallAutomation.MediaStreamingSubscriptionState? state, System.Collections.Generic.IReadOnlyList subscribedContentTypes) { } + public string Id { get { throw null; } } + public Azure.Communication.CallAutomation.MediaStreamingSubscriptionState? State { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubscribedContentTypes { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MediaStreamingSubscriptionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MediaStreamingSubscriptionState(string value) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingSubscriptionState Active { get { throw null; } } + public static Azure.Communication.CallAutomation.MediaStreamingSubscriptionState Disabled { get { throw null; } } + public static Azure.Communication.CallAutomation.MediaStreamingSubscriptionState Inactive { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.MediaStreamingSubscriptionState 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.Communication.CallAutomation.MediaStreamingSubscriptionState left, Azure.Communication.CallAutomation.MediaStreamingSubscriptionState right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.MediaStreamingSubscriptionState (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.MediaStreamingSubscriptionState left, Azure.Communication.CallAutomation.MediaStreamingSubscriptionState right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaStreamingTransport : System.IEquatable { @@ -1060,6 +1164,15 @@ public partial class MuteParticipantResult internal MuteParticipantResult() { } public string OperationContext { get { throw null; } } } + public partial class OutStreamingData + { + internal OutStreamingData() { } + public Azure.Communication.CallAutomation.AudioData AudioData { get { throw null; } } + public Azure.Communication.CallAutomation.MediaKind Kind { get { throw null; } } + public Azure.Communication.CallAutomation.StopAudio StopAudio { get { throw null; } } + public static string GetAudioDataForOutbound(byte[] audioData) { throw null; } + public static string GetStopAudioForOutbound() { throw null; } + } public partial class ParticipantsUpdated : Azure.Communication.CallAutomation.CallAutomationEventBase { internal ParticipantsUpdated() { } @@ -1113,6 +1226,11 @@ public abstract partial class PlaySource protected PlaySource() { } public string PlaySourceCacheId { get { throw null; } set { } } } + public partial class PlayStarted : Azure.Communication.CallAutomation.CallAutomationEventBase + { + internal PlayStarted() { } + public static Azure.Communication.CallAutomation.PlayStarted Deserialize(string content) { throw null; } + } public partial class PlayToAllOptions { public PlayToAllOptions(Azure.Communication.CallAutomation.PlaySource playSource) { } @@ -1387,10 +1505,12 @@ internal ResultInformation() { } public string Message { get { throw null; } } public int? SubCode { get { throw null; } } } - public enum ResultStatus + public partial class RoomCallLocator : Azure.Communication.CallAutomation.CallLocator { - Intermediate = 0, - Final = 1, + public RoomCallLocator(string id) { } + public override bool Equals(Azure.Communication.CallAutomation.CallLocator other) { throw null; } + public override int GetHashCode() { throw null; } + public override string ToString() { throw null; } } public partial class SendDtmfTonesCompleted : Azure.Communication.CallAutomation.CallAutomationEventBase { @@ -1459,6 +1579,12 @@ public StartHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetP public Azure.Communication.CallAutomation.PlaySource PlaySourceInfo { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } } + public partial class StartMediaStreamingOptions + { + public StartMediaStreamingOptions() { } + public System.Uri OperationCallbackUri { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + } public partial class StartRecognizingCallMediaResult { internal StartRecognizingCallMediaResult() { } @@ -1488,7 +1614,13 @@ public partial class StartTranscriptionOptions { public StartTranscriptionOptions() { } public string Locale { get { throw null; } set { } } + public string OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } + } + public partial class StopAudio + { + public StopAudio() { } } public partial class StopHoldMusicOptions { @@ -1496,18 +1628,37 @@ public StopHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetPa public string OperationContext { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } } + public partial class StopMediaStreamingOptions + { + public StopMediaStreamingOptions() { } + public System.Uri OperationCallbackUri { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + } public partial class StopTranscriptionOptions { public StopTranscriptionOptions() { } + public string OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } } public abstract partial class StreamingData { protected StreamingData() { } + public static Azure.Communication.CallAutomation.StreamingDataKind Kind { get { throw null; } } + public static Azure.Communication.CallAutomation.StreamingData Parse(string data) { throw null; } + public static T Parse(string data) where T : Azure.Communication.CallAutomation.StreamingData { throw null; } + } + [System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public enum StreamingDataKind + { + AudioData = 0, + AudioMetadata = 1, + TranscriptionData = 2, + TranscriptionMetadata = 3, } public static partial class StreamingDataParser { - public static Azure.Communication.CallAutomation.StreamingData Parse(System.BinaryData json) { throw null; } + public static Azure.Communication.CallAutomation.StreamingData Parse(System.BinaryData binaryData) { throw null; } public static Azure.Communication.CallAutomation.StreamingData Parse(byte[] receivedBytes) { throw null; } public static Azure.Communication.CallAutomation.StreamingData Parse(string stringJson) { throw null; } } @@ -1530,17 +1681,18 @@ public partial class TranscriptionData : Azure.Communication.CallAutomation.Stre { internal TranscriptionData() { } public double Confidence { get { throw null; } set { } } - public ulong Duration { get { throw null; } set { } } + public System.TimeSpan Duration { get { throw null; } set { } } public Azure.Communication.CallAutomation.TextFormat Format { get { throw null; } set { } } - public ulong Offset { get { throw null; } set { } } + public System.TimeSpan Offset { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } set { } } - public Azure.Communication.CallAutomation.ResultStatus ResultStatus { get { throw null; } set { } } + public Azure.Communication.CallAutomation.TranscriptionResultState ResultState { get { throw null; } set { } } public string Text { get { throw null; } set { } } public System.Collections.Generic.IEnumerable Words { get { throw null; } set { } } } public partial class TranscriptionFailed : Azure.Communication.CallAutomation.CallAutomationEventBase { internal TranscriptionFailed() { } + public Azure.Communication.CallAutomation.MediaEventReasonCode ReasonCode { get { throw null; } } public Azure.Communication.CallAutomation.TranscriptionUpdate TranscriptionUpdate { get { throw null; } } public static Azure.Communication.CallAutomation.TranscriptionFailed Deserialize(string content) { throw null; } } @@ -1558,12 +1710,32 @@ public TranscriptionMetadata() { } } public partial class TranscriptionOptions { - public TranscriptionOptions(System.Uri transportUri, Azure.Communication.CallAutomation.TranscriptionTransport transportType, string locale, bool startTranscription) { } + public TranscriptionOptions(System.Uri transportUri, string locale, bool? startTranscription = default(bool?), Azure.Communication.CallAutomation.TranscriptionTransport transcriptionTransport = default(Azure.Communication.CallAutomation.TranscriptionTransport)) { } + public bool? EnableIntermediateResults { get { throw null; } set { } } public string Locale { get { throw null; } } - public bool StartTranscription { get { throw null; } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } + public bool? StartTranscription { get { throw null; } } public Azure.Communication.CallAutomation.TranscriptionTransport TranscriptionTransport { get { throw null; } } public System.Uri TransportUrl { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TranscriptionResultState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TranscriptionResultState(string value) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionResultState Final { get { throw null; } } + public static Azure.Communication.CallAutomation.TranscriptionResultState Intermediate { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.TranscriptionResultState 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.Communication.CallAutomation.TranscriptionResultState left, Azure.Communication.CallAutomation.TranscriptionResultState right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.TranscriptionResultState (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.TranscriptionResultState left, Azure.Communication.CallAutomation.TranscriptionResultState right) { throw null; } + public override string ToString() { throw null; } + } public partial class TranscriptionStarted : Azure.Communication.CallAutomation.CallAutomationEventBase { internal TranscriptionStarted() { } @@ -1629,6 +1801,32 @@ internal TranscriptionStopped() { } public Azure.Communication.CallAutomation.TranscriptionUpdate TranscriptionUpdate { get { throw null; } } public static Azure.Communication.CallAutomation.TranscriptionStopped Deserialize(string content) { throw null; } } + public partial class TranscriptionSubscription + { + internal TranscriptionSubscription() { } + public string Id { get { throw null; } } + public Azure.Communication.CallAutomation.TranscriptionSubscriptionState? State { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubscribedResultStates { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TranscriptionSubscriptionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TranscriptionSubscriptionState(string value) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionSubscriptionState Active { get { throw null; } } + public static Azure.Communication.CallAutomation.TranscriptionSubscriptionState Disabled { get { throw null; } } + public static Azure.Communication.CallAutomation.TranscriptionSubscriptionState Inactive { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.TranscriptionSubscriptionState 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.Communication.CallAutomation.TranscriptionSubscriptionState left, Azure.Communication.CallAutomation.TranscriptionSubscriptionState right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.TranscriptionSubscriptionState (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.TranscriptionSubscriptionState left, Azure.Communication.CallAutomation.TranscriptionSubscriptionState right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct TranscriptionTransport : System.IEquatable { @@ -1675,6 +1873,7 @@ internal TransferCallToParticipantResult() { } public partial class TransferToParticipantOptions { public TransferToParticipantOptions(Azure.Communication.CommunicationUserIdentifier targetIdentity) { } + public TransferToParticipantOptions(Azure.Communication.MicrosoftTeamsAppIdentifier targetIdentity) { } public TransferToParticipantOptions(Azure.Communication.MicrosoftTeamsUserIdentifier targetIdentity) { } public TransferToParticipantOptions(Azure.Communication.PhoneNumberIdentifier targetPhoneNumberIdentity) { } public Azure.Communication.CallAutomation.CustomCallingContext CustomCallingContext { get { throw null; } } @@ -1708,6 +1907,13 @@ public UpdateDialogOptions(string dialogId, Azure.Communication.CallAutomation.D public string DialogId { get { throw null; } } public string OperationContext { get { throw null; } set { } } } + public partial class UpdateTranscriptionOptions + { + public UpdateTranscriptionOptions(string locale) { } + public string OperationCallbackUri { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } + } public partial class UserConsent { internal UserConsent() { } @@ -1733,11 +1939,11 @@ internal UserConsent() { } } public partial class WordData { - public WordData() { } + internal WordData() { } [System.Text.Json.Serialization.JsonPropertyNameAttribute("duration")] - public ulong Duration { get { throw null; } set { } } + public System.TimeSpan Duration { get { throw null; } set { } } [System.Text.Json.Serialization.JsonPropertyNameAttribute("offset")] - public ulong Offset { get { throw null; } set { } } + public System.TimeSpan Offset { get { throw null; } set { } } [System.Text.Json.Serialization.JsonPropertyNameAttribute("text")] public string Text { get { throw null; } set { } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs index 29cb16e2cc56..7925c5d84361 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs @@ -69,26 +69,45 @@ public partial class AnswerFailed : Azure.Communication.CallAutomation.CallAutom internal AnswerFailed() { } public static Azure.Communication.CallAutomation.AnswerFailed Deserialize(string content) { throw null; } } + [System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public enum AudioChannel + { + Unknown = 0, + Mono = 1, + } public partial class AudioData : Azure.Communication.CallAutomation.StreamingData { - internal AudioData() { } - public string Data { get { throw null; } } + public AudioData(byte[] data) { } + public byte[] Data { get { throw null; } } public bool IsSilent { get { throw null; } } public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } } - public System.DateTime Timestamp { get { throw null; } } + public System.DateTimeOffset Timestamp { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AudioFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AudioFormat(string value) { throw null; } + public static Azure.Communication.CallAutomation.AudioFormat Pcm16KMono { get { throw null; } } + public static Azure.Communication.CallAutomation.AudioFormat Pcm24KMono { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.AudioFormat 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.Communication.CallAutomation.AudioFormat left, Azure.Communication.CallAutomation.AudioFormat right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.AudioFormat (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.AudioFormat left, Azure.Communication.CallAutomation.AudioFormat right) { throw null; } + public override string ToString() { throw null; } } public partial class AudioMetadata : Azure.Communication.CallAutomation.StreamingData { - public AudioMetadata() { } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("channels")] - public int Channels { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("encoding")] + internal AudioMetadata() { } + public Azure.Communication.CallAutomation.AudioChannel Channels { get { throw null; } set { } } public string Encoding { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("length")] public int Length { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("subscriptionId")] public string MediaSubscriptionId { get { throw null; } set { } } - [System.Text.Json.Serialization.JsonPropertyNameAttribute("sampleRate")] public int SampleRate { get { throw null; } set { } } } public partial class AzureOpenAIDialog : Azure.Communication.CallAutomation.BaseDialog @@ -112,12 +131,15 @@ public CallAutomationClient(string connectionString, Azure.Communication.CallAut public CallAutomationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { } public CallAutomationClient(System.Uri pmaEndpoint, string connectionString, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { } public CallAutomationClient(System.Uri pmaEndpoint, System.Uri acsEndpoint, Azure.Core.TokenCredential credential, Azure.Communication.CallAutomation.CallAutomationClientOptions options = null) { } - public Azure.Communication.MicrosoftTeamsAppIdentifier OPSSource { get { throw null; } } public Azure.Communication.CommunicationUserIdentifier Source { get { throw null; } } public virtual Azure.Response AnswerCall(Azure.Communication.CallAutomation.AnswerCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response AnswerCall(string incomingCallContext, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AnswerCallAsync(Azure.Communication.CallAutomation.AnswerCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AnswerCallAsync(string incomingCallContext, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ConnectCall(Azure.Communication.CallAutomation.CallLocator callLocator, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ConnectCall(Azure.Communication.CallAutomation.ConnectCallOptions connectCallOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ConnectCallAsync(Azure.Communication.CallAutomation.CallLocator callLocator, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ConnectCallAsync(Azure.Communication.CallAutomation.ConnectCallOptions connectCallOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateCall(Azure.Communication.CallAutomation.CallInvite callInvite, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateCall(Azure.Communication.CallAutomation.CreateCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateCallAsync(Azure.Communication.CallAutomation.CallInvite callInvite, System.Uri callbackUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -138,8 +160,7 @@ public CallAutomationClient(System.Uri pmaEndpoint, System.Uri acsEndpoint, Azur } public partial class CallAutomationClientOptions : Azure.Core.ClientOptions { - public CallAutomationClientOptions(Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion version = Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion.V2023_10_03_Preview) { } - public Azure.Communication.MicrosoftTeamsAppIdentifier OPSSource { get { throw null; } set { } } + public CallAutomationClientOptions(Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion version = Azure.Communication.CallAutomation.CallAutomationClientOptions.ServiceVersion.V2024_09_01_Preview) { } public Azure.Communication.CommunicationUserIdentifier Source { get { throw null; } set { } } public enum ServiceVersion { @@ -147,6 +168,7 @@ public enum ServiceVersion V2023_06_15_Preview = 2, V2023_10_15 = 3, V2023_10_03_Preview = 4, + V2024_09_01_Preview = 5, } } public abstract partial class CallAutomationEventBase @@ -185,17 +207,16 @@ public static partial class CallAutomationModelFactory public static Azure.Communication.CallAutomation.AddParticipantSucceeded AddParticipantSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CommunicationIdentifier participant = null) { throw null; } public static Azure.Communication.CallAutomation.AnswerCallResult AnswerCallResult(Azure.Communication.CallAutomation.CallConnection callConnection = null, Azure.Communication.CallAutomation.CallConnectionProperties callConnectionProperties = null) { throw null; } public static Azure.Communication.CallAutomation.AnswerFailed AnswerFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties(string callConnectionId = null, string serverCallId = null, System.Collections.Generic.IEnumerable targets = null, Azure.Communication.CallAutomation.CallConnectionState callConnectionState = default(Azure.Communication.CallAutomation.CallConnectionState), System.Uri callbackUri = null, Azure.Communication.CommunicationIdentifier sourceIdentity = null, Azure.Communication.PhoneNumberIdentifier sourceCallerIdNumber = null, string sourceDisplayName = null, Azure.Communication.CommunicationUserIdentifier answeredBy = null, string mediaSubscriptionId = null, string dataSubscriptionId = null) { throw null; } - public static Azure.Communication.CallAutomation.CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } + public static Azure.Communication.CallAutomation.CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties(string callConnectionId = null, string serverCallId = null, System.Collections.Generic.IEnumerable targets = null, Azure.Communication.CallAutomation.CallConnectionState callConnectionState = default(Azure.Communication.CallAutomation.CallConnectionState), System.Uri callbackUri = null, Azure.Communication.CommunicationIdentifier sourceIdentity = null, Azure.Communication.PhoneNumberIdentifier sourceCallerIdNumber = null, string sourceDisplayName = null, Azure.Communication.CommunicationUserIdentifier answeredBy = null, Azure.Communication.CallAutomation.MediaStreamingSubscription mediaStreamingSubscription = null, Azure.Communication.CallAutomation.TranscriptionSubscription transcriptionSubscription = null, Azure.Communication.PhoneNumberIdentifier answeredFor = null) { throw null; } + public static Azure.Communication.CallAutomation.CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.CallParticipant CallParticipant(Azure.Communication.CommunicationIdentifier identifier = null, bool isMuted = false, bool isOnHold = false) { throw null; } public static Azure.Communication.CallAutomation.CallTransferAccepted CallTransferAccepted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CommunicationIdentifier transferee = null, Azure.Communication.CommunicationIdentifier transferTarget = null) { throw null; } public static Azure.Communication.CallAutomation.CallTransferFailed CallTransferFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.CancelAddParticipantFailed CancelAddParticipantFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string invitationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.CancelAddParticipantOperationResult CancelAddParticipantResult(string invitationId = null, string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.CancelAddParticipantSucceeded CancelAddParticipantSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string invitationId = null, Azure.Communication.CommunicationIdentifier participant = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.CancelAddParticipantSucceeded CancelAddParticipantSucceeded(string callConnectionId = null, string serverCallId = null, string correlationId = null, string invitationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.ChoiceResult ChoiceResult(string label = null, string recognizedPhrase = null) { throw null; } - public static Azure.Communication.CallAutomation.CollectTonesResult CollectTonesResult(System.Collections.Generic.IEnumerable tones = null) { throw null; } public static Azure.Communication.CallAutomation.ContinuousDtmfRecognitionStopped ContinuousDtmfRecognitionStopped(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.ContinuousDtmfRecognitionToneFailed ContinuousDtmfRecognitionToneFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.ContinuousDtmfRecognitionToneReceived ContinuousDtmfRecognitionToneReceived(int? sequenceId = default(int?), Azure.Communication.CallAutomation.DtmfTone? tone = default(Azure.Communication.CallAutomation.DtmfTone?), string callConnectionId = null, string serverCallId = null, string correlationId = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, string operationContext = null) { throw null; } @@ -203,21 +224,19 @@ public static partial class CallAutomationModelFactory public static Azure.Communication.CallAutomation.CreateCallResult CreateCallResult(Azure.Communication.CallAutomation.CallConnection callConnection = null, Azure.Communication.CallAutomation.CallConnectionProperties callConnectionProperties = null) { throw null; } public static Azure.Communication.CallAutomation.DtmfResult DtmfResult(System.Collections.Generic.IEnumerable tones = null) { throw null; } public static Azure.Communication.CallAutomation.HoldFailed HoldFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.MediaStreamingFailed MediaStreamingFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.MediaStreamingStarted MediaStreamingStarted(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.MediaStreamingStopped MediaStreamingStopped(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingFailed MediaStreamingFailed(Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingStarted MediaStreamingStarted(Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingStopped MediaStreamingStopped(Azure.Communication.CallAutomation.MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.MediaStreamingUpdate MediaStreamingUpdate(string contentType = null, Azure.Communication.CallAutomation.MediaStreamingStatus? mediaStreamingStatus = default(Azure.Communication.CallAutomation.MediaStreamingStatus?), Azure.Communication.CallAutomation.MediaStreamingStatusDetails? mediaStreamingStatusDetails = default(Azure.Communication.CallAutomation.MediaStreamingStatusDetails?)) { throw null; } public static Azure.Communication.CallAutomation.MuteParticipantResult MuteParticipantResult(string operationContext = null) { throw null; } - public static Azure.Communication.CallAutomation.ParticipantsUpdated ParticipantsUpdated(string callConnectionId = null, string serverCallId = null, string correlationId = null, System.Collections.Generic.IEnumerable participants = null, int sequenceNumber = 0) { throw null; } - public static Azure.Communication.CallAutomation.PlayCanceled PlayCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } + public static Azure.Communication.CallAutomation.ParticipantsUpdated ParticipantsUpdated(string callConnectionId = null, string serverCallId = null, string correlationId = null, System.Collections.Generic.IEnumerable participants = null, int sequenceNumber = 0, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.PlayCanceled PlayCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.PlayCompleted PlayCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.PlayFailed PlayFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?), string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.PlayFailed PlayFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.RecognizeCanceled RecognizeCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) { throw null; } + public static Azure.Communication.CallAutomation.PlayFailed PlayFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?)) { throw null; } + public static Azure.Communication.CallAutomation.RecognizeCanceled RecognizeCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.RecognizeCompleted RecognizeCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.CallMediaRecognitionType recognitionType = default(Azure.Communication.CallAutomation.CallMediaRecognitionType), Azure.Communication.CallAutomation.RecognizeResult recognizeResult = null) { throw null; } - public static Azure.Communication.CallAutomation.RecognizeFailed RecognizeFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?), string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.RecognizeFailed RecognizeFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } - public static Azure.Communication.CallAutomation.RecordingStateChanged RecordingStateChanged(string callConnectionId = null, string serverCallId = null, string correlationId = null, string recordingId = null, Azure.Communication.CallAutomation.RecordingState state = default(Azure.Communication.CallAutomation.RecordingState), System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), Azure.Communication.CallAutomation.RecordingKind? recordingKind = default(Azure.Communication.CallAutomation.RecordingKind?)) { throw null; } + public static Azure.Communication.CallAutomation.RecognizeFailed RecognizeFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, int? failedPlaySourceIndex = default(int?)) { throw null; } + public static Azure.Communication.CallAutomation.RecordingStateChanged RecordingStateChanged(string callConnectionId = null, string serverCallId = null, string correlationId = null, string recordingId = null, Azure.Communication.CallAutomation.RecordingState state = default(Azure.Communication.CallAutomation.RecordingState), System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), Azure.Communication.CallAutomation.RecordingKind? recordingKind = default(Azure.Communication.CallAutomation.RecordingKind?), Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.RecordingStateResult RecordingStateResult(string recordingId = null, Azure.Communication.CallAutomation.RecordingState? recordingState = default(Azure.Communication.CallAutomation.RecordingState?), Azure.Communication.CallAutomation.RecordingKind? recordingKind = default(Azure.Communication.CallAutomation.RecordingKind?)) { throw null; } public static Azure.Communication.CallAutomation.RemoveParticipantFailed RemoveParticipantFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CommunicationIdentifier participant = null) { throw null; } public static Azure.Communication.CallAutomation.RemoveParticipantResult RemoveParticipantResult(string operationContext = null) { throw null; } @@ -227,11 +246,11 @@ public static partial class CallAutomationModelFactory public static Azure.Communication.CallAutomation.SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.SendDtmfTonesResult SendDtmfTonesResult(string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.SpeechResult SpeechResult(string speech = null) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionStopped TranscriptionStopped(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionFailed TranscriptionFailed(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionStarted TranscriptionStarted(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionStopped TranscriptionStopped(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.TranscriptionUpdate TranscriptionUpdate(Azure.Communication.CallAutomation.TranscriptionStatus? transcriptionStatus = default(Azure.Communication.CallAutomation.TranscriptionStatus?), Azure.Communication.CallAutomation.TranscriptionStatusDetails? transcriptionStatusDetails = default(Azure.Communication.CallAutomation.TranscriptionStatusDetails?)) { throw null; } - public static Azure.Communication.CallAutomation.TranscriptionUpdated TranscriptionUpdated(string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null, Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionUpdated TranscriptionUpdated(Azure.Communication.CallAutomation.TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, Azure.Communication.CallAutomation.ResultInformation resultInformation = null) { throw null; } public static Azure.Communication.CallAutomation.TransferCallToParticipantResult TransferCallToParticipantResult(string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.UnmuteParticipantResult UnmuteParticipantResult(string operationContext = null) { throw null; } public static Azure.Communication.CallAutomation.UserConsent UserConsent(int? recording = default(int?)) { throw null; } @@ -284,17 +303,18 @@ public partial class CallConnectionProperties { internal CallConnectionProperties() { } public Azure.Communication.CommunicationUserIdentifier AnsweredBy { get { throw null; } } + public Azure.Communication.PhoneNumberIdentifier AnsweredFor { get { throw null; } } public System.Uri CallbackUri { get { throw null; } } public string CallConnectionId { get { throw null; } } public Azure.Communication.CallAutomation.CallConnectionState CallConnectionState { get { throw null; } } public string CorrelationId { get { throw null; } } - public string DataSubscriptionId { get { throw null; } } - public string MediaSubscriptionId { get { throw null; } } + public Azure.Communication.CallAutomation.MediaStreamingSubscription MediaStreamingSubscription { get { throw null; } } public string ServerCallId { get { throw null; } } public Azure.Communication.CommunicationIdentifier Source { get { throw null; } } public Azure.Communication.PhoneNumberIdentifier SourceCallerIdNumber { get { throw null; } } public string SourceDisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public Azure.Communication.CallAutomation.TranscriptionSubscription TranscriptionSubscription { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CallConnectionState : System.IEquatable @@ -366,15 +386,23 @@ protected CallMedia() { } public virtual Azure.Response CancelAllMediaOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CancelAllMediaOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Hold(Azure.Communication.CallAutomation.HoldOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Hold(Azure.Communication.CommunicationIdentifier targetParticipant, Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Hold(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task HoldAsync(Azure.Communication.CallAutomation.HoldOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task HoldAsync(Azure.Communication.CommunicationIdentifier targetParticipant, Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task HoldAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Play(Azure.Communication.CallAutomation.PlayOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Play(Azure.Communication.CallAutomation.PlaySource playSource, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Play(System.Collections.Generic.IEnumerable playSources, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayAsync(Azure.Communication.CallAutomation.PlayOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayAsync(Azure.Communication.CallAutomation.PlaySource playSource, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlayAsync(System.Collections.Generic.IEnumerable playSources, System.Collections.Generic.IEnumerable playTo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response PlayToAll(Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response PlayToAll(Azure.Communication.CallAutomation.PlayToAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PlayToAll(System.Collections.Generic.IEnumerable playSources, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayToAllAsync(Azure.Communication.CallAutomation.PlaySource playSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> PlayToAllAsync(Azure.Communication.CallAutomation.PlayToAllOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlayToAllAsync(System.Collections.Generic.IEnumerable playSources, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SendDtmfTones(Azure.Communication.CallAutomation.SendDtmfTonesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SendDtmfTones(System.Collections.Generic.IEnumerable tones, Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SendDtmfTonesAsync(Azure.Communication.CallAutomation.SendDtmfTonesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -383,10 +411,8 @@ protected CallMedia() { } public virtual Azure.Response StartContinuousDtmfRecognition(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartContinuousDtmfRecognitionAsync(Azure.Communication.CallAutomation.ContinuousDtmfRecognitionOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartContinuousDtmfRecognitionAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us Hold instead.")] - public virtual Azure.Response StartHoldMusic(Azure.Communication.CallAutomation.StartHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us HoldAsync instead.")] - public virtual System.Threading.Tasks.Task StartHoldMusicAsync(Azure.Communication.CallAutomation.StartHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response StartMediaStreaming(Azure.Communication.CallAutomation.StartMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartMediaStreamingAsync(Azure.Communication.CallAutomation.StartMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StartRecognizing(Azure.Communication.CallAutomation.CallMediaRecognizeOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StartRecognizingAsync(Azure.Communication.CallAutomation.CallMediaRecognizeOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StartTranscription(Azure.Communication.CallAutomation.StartTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -395,15 +421,17 @@ protected CallMedia() { } public virtual Azure.Response StopContinuousDtmfRecognition(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopContinuousDtmfRecognitionAsync(Azure.Communication.CallAutomation.ContinuousDtmfRecognitionOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopContinuousDtmfRecognitionAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us Unhold instead.")] - public virtual Azure.Response StopHoldMusic(Azure.Communication.CallAutomation.StopHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ObsoleteAttribute("This operations is deprecated, please us UnholdAsync instead.")] - public virtual System.Threading.Tasks.Task StopHoldMusicAsync(Azure.Communication.CallAutomation.StopHoldMusicOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response StopMediaStreaming(Azure.Communication.CallAutomation.StopMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StopMediaStreamingAsync(Azure.Communication.CallAutomation.StopMediaStreamingOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response StopTranscription(Azure.Communication.CallAutomation.StopTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StopTranscriptionAsync(Azure.Communication.CallAutomation.StopTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Unhold(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Unhold(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UnholdAsync(Azure.Communication.CallAutomation.UnholdOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnholdAsync(Azure.Communication.CommunicationIdentifier targetParticipant, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateTranscription(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateTranscription(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateTranscriptionAsync(Azure.Communication.CallAutomation.UpdateTranscriptionOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateTranscriptionAsync(string locale, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -446,6 +474,7 @@ protected CallMediaRecognizeOptions(Azure.Communication.CallAutomation.Recognize public bool InterruptPrompt { get { throw null; } set { } } public System.Uri OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public System.Collections.Generic.IList PlayPrompts { get { throw null; } set { } } public Azure.Communication.CallAutomation.PlaySource Prompt { get { throw null; } set { } } public string SpeechLanguage { get { throw null; } set { } } public string SpeechModelEndpointId { get { throw null; } set { } } @@ -586,12 +615,35 @@ internal ChoiceResult() { } public string RecognizedPhrase { get { throw null; } } public override Azure.Communication.CallAutomation.RecognizeResultType ResultType { get { throw null; } } } - public partial class CollectTonesResult : Azure.Communication.CallAutomation.RecognizeResult + public partial class ConnectCallEventResult { - internal CollectTonesResult() { } - public override Azure.Communication.CallAutomation.RecognizeResultType ResultType { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Tones { get { throw null; } } - public string ConvertToString() { throw null; } + internal ConnectCallEventResult() { } + public Azure.Communication.CallAutomation.ConnectFailed FailureResult { get { throw null; } } + public bool IsSuccess { get { throw null; } } + public Azure.Communication.CallAutomation.CallConnected SuccessResult { get { throw null; } } + } + public partial class ConnectCallOptions + { + public ConnectCallOptions(Azure.Communication.CallAutomation.CallLocator callLocator, System.Uri callbackUri) { } + public System.Uri CallbackUri { get { throw null; } } + public Azure.Communication.CallAutomation.CallIntelligenceOptions CallIntelligenceOptions { get { throw null; } set { } } + public Azure.Communication.CallAutomation.CallLocator CallLocator { get { throw null; } } + public Azure.Communication.CallAutomation.MediaStreamingOptions MediaStreamingOptions { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + public Azure.Communication.CallAutomation.TranscriptionOptions TranscriptionOptions { get { throw null; } set { } } + } + public partial class ConnectCallResult + { + internal ConnectCallResult() { } + public Azure.Communication.CallAutomation.CallConnection CallConnection { get { throw null; } } + public Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties { get { throw null; } } + public Azure.Communication.CallAutomation.ConnectCallEventResult WaitForEventProcessor(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.Task WaitForEventProcessorAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ConnectFailed : Azure.Communication.CallAutomation.CallAutomationEventBase + { + internal ConnectFailed() { } + public static Azure.Communication.CallAutomation.ConnectFailed Deserialize(string content) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct ContentTransferOptions : System.IEquatable @@ -654,6 +706,7 @@ public CreateCallOptions(Azure.Communication.CallAutomation.CallInvite callInvit public Azure.Communication.CallAutomation.CallInvite CallInvite { get { throw null; } } public Azure.Communication.CallAutomation.MediaStreamingOptions MediaStreamingOptions { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public Azure.Communication.MicrosoftTeamsAppIdentifier TeamsAppSource { get { throw null; } set { } } public Azure.Communication.CallAutomation.TranscriptionOptions TranscriptionOptions { get { throw null; } set { } } } public partial class CreateCallResult @@ -675,6 +728,7 @@ public CreateGroupCallOptions(System.Collections.Generic.IEnumerable Targets { get { throw null; } } + public Azure.Communication.MicrosoftTeamsAppIdentifier TeamsAppSource { get { throw null; } set { } } public Azure.Communication.CallAutomation.TranscriptionOptions TranscriptionOptions { get { throw null; } set { } } } public partial class CustomCallingContext @@ -856,6 +910,12 @@ public GroupCallLocator(string id) { } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } + public partial class HoldEventResult + { + internal HoldEventResult() { } + public Azure.Communication.CallAutomation.HoldFailed FailureResult { get { throw null; } } + public bool IsSuccess { get { throw null; } } + } public partial class HoldFailed : Azure.Communication.CallAutomation.CallAutomationEventBase { internal HoldFailed() { } @@ -867,9 +927,26 @@ public partial class HoldOptions public HoldOptions(Azure.Communication.CommunicationIdentifier targetParticipant) { } public System.Uri OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } - public Azure.Communication.CallAutomation.PlaySource PlaySourceInfo { get { throw null; } set { } } + public Azure.Communication.CallAutomation.PlaySource PlaySource { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } } + public partial class HoldResult + { + internal HoldResult() { } + public Azure.Communication.CallAutomation.HoldEventResult WaitForEventProcessor(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.Task WaitForEventProcessorAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IncomingCall : Azure.Communication.CallAutomation.CallAutomationEventBase + { + internal IncomingCall() { } + public string CallerDisplayName { get { throw null; } } + public Azure.Communication.CallAutomation.CustomCallingContext CustomContext { get { throw null; } } + public Azure.Communication.CommunicationIdentifier From { get { throw null; } } + public string IncomingCallContext { get { throw null; } } + public Azure.Communication.CommunicationIdentifier OnBehalfOfCallee { get { throw null; } } + public Azure.Communication.CommunicationIdentifier To { get { throw null; } } + public static Azure.Communication.CallAutomation.IncomingCall Deserialize(string content) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaEventReasonCode : System.IEquatable { @@ -904,6 +981,12 @@ public HoldOptions(Azure.Communication.CommunicationIdentifier targetParticipant public static bool operator !=(Azure.Communication.CallAutomation.MediaEventReasonCode left, Azure.Communication.CallAutomation.MediaEventReasonCode right) { throw null; } public override string ToString() { throw null; } } + [System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public enum MediaKind + { + AudioData = 0, + StopAudio = 1, + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaStreamingAudioChannel : System.IEquatable { @@ -922,14 +1005,6 @@ public HoldOptions(Azure.Communication.CommunicationIdentifier targetParticipant public static bool operator !=(Azure.Communication.CallAutomation.MediaStreamingAudioChannel left, Azure.Communication.CallAutomation.MediaStreamingAudioChannel right) { throw null; } public override string ToString() { throw null; } } - public partial class MediaStreamingConfiguration - { - public MediaStreamingConfiguration(System.Uri transportUrl, Azure.Communication.CallAutomation.MediaStreamingTransport transportType, Azure.Communication.CallAutomation.MediaStreamingContent contentType, Azure.Communication.CallAutomation.MediaStreamingAudioChannel audioChannelType) { } - public Azure.Communication.CallAutomation.MediaStreamingAudioChannel AudioChannelType { get { throw null; } } - public Azure.Communication.CallAutomation.MediaStreamingContent ContentType { get { throw null; } } - public Azure.Communication.CallAutomation.MediaStreamingTransport TransportType { get { throw null; } } - public System.Uri TransportUrl { get { throw null; } } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaStreamingContent : System.IEquatable { @@ -955,10 +1030,13 @@ internal MediaStreamingFailed() { } } public partial class MediaStreamingOptions { - public MediaStreamingOptions(System.Uri transportUri, Azure.Communication.CallAutomation.MediaStreamingTransport transportType, Azure.Communication.CallAutomation.MediaStreamingContent contentType, Azure.Communication.CallAutomation.MediaStreamingAudioChannel audioChannelType) { } + public MediaStreamingOptions(System.Uri transportUri, Azure.Communication.CallAutomation.MediaStreamingContent contentType, Azure.Communication.CallAutomation.MediaStreamingAudioChannel audioChannelType, Azure.Communication.CallAutomation.MediaStreamingTransport transportType = default(Azure.Communication.CallAutomation.MediaStreamingTransport), bool? startMediaStreaming = default(bool?)) { } + public Azure.Communication.CallAutomation.AudioFormat? AudioFormat { get { throw null; } set { } } + public bool? EnableBidirectional { get { throw null; } set { } } public Azure.Communication.CallAutomation.MediaStreamingAudioChannel MediaStreamingAudioChannel { get { throw null; } } public Azure.Communication.CallAutomation.MediaStreamingContent MediaStreamingContent { get { throw null; } } public Azure.Communication.CallAutomation.MediaStreamingTransport MediaStreamingTransport { get { throw null; } } + public bool? StartMediaStreaming { get { throw null; } set { } } public System.Uri TransportUri { get { throw null; } } } public partial class MediaStreamingStarted : Azure.Communication.CallAutomation.CallAutomationEventBase @@ -1024,6 +1102,32 @@ internal MediaStreamingStopped() { } public Azure.Communication.CallAutomation.MediaStreamingUpdate MediaStreamingUpdate { get { throw null; } } public static Azure.Communication.CallAutomation.MediaStreamingStopped Deserialize(string content) { throw null; } } + public partial class MediaStreamingSubscription + { + public MediaStreamingSubscription(string id, Azure.Communication.CallAutomation.MediaStreamingSubscriptionState? state, System.Collections.Generic.IReadOnlyList subscribedContentTypes) { } + public string Id { get { throw null; } } + public Azure.Communication.CallAutomation.MediaStreamingSubscriptionState? State { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubscribedContentTypes { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MediaStreamingSubscriptionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MediaStreamingSubscriptionState(string value) { throw null; } + public static Azure.Communication.CallAutomation.MediaStreamingSubscriptionState Active { get { throw null; } } + public static Azure.Communication.CallAutomation.MediaStreamingSubscriptionState Disabled { get { throw null; } } + public static Azure.Communication.CallAutomation.MediaStreamingSubscriptionState Inactive { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.MediaStreamingSubscriptionState 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.Communication.CallAutomation.MediaStreamingSubscriptionState left, Azure.Communication.CallAutomation.MediaStreamingSubscriptionState right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.MediaStreamingSubscriptionState (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.MediaStreamingSubscriptionState left, Azure.Communication.CallAutomation.MediaStreamingSubscriptionState right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MediaStreamingTransport : System.IEquatable { @@ -1059,6 +1163,15 @@ public partial class MuteParticipantResult internal MuteParticipantResult() { } public string OperationContext { get { throw null; } } } + public partial class OutStreamingData + { + internal OutStreamingData() { } + public Azure.Communication.CallAutomation.AudioData AudioData { get { throw null; } } + public Azure.Communication.CallAutomation.MediaKind Kind { get { throw null; } } + public Azure.Communication.CallAutomation.StopAudio StopAudio { get { throw null; } } + public static string GetAudioDataForOutbound(byte[] audioData) { throw null; } + public static string GetStopAudioForOutbound() { throw null; } + } public partial class ParticipantsUpdated : Azure.Communication.CallAutomation.CallAutomationEventBase { internal ParticipantsUpdated() { } @@ -1112,6 +1225,11 @@ public abstract partial class PlaySource protected PlaySource() { } public string PlaySourceCacheId { get { throw null; } set { } } } + public partial class PlayStarted : Azure.Communication.CallAutomation.CallAutomationEventBase + { + internal PlayStarted() { } + public static Azure.Communication.CallAutomation.PlayStarted Deserialize(string content) { throw null; } + } public partial class PlayToAllOptions { public PlayToAllOptions(Azure.Communication.CallAutomation.PlaySource playSource) { } @@ -1386,10 +1504,12 @@ internal ResultInformation() { } public string Message { get { throw null; } } public int? SubCode { get { throw null; } } } - public enum ResultStatus + public partial class RoomCallLocator : Azure.Communication.CallAutomation.CallLocator { - Intermediate = 0, - Final = 1, + public RoomCallLocator(string id) { } + public override bool Equals(Azure.Communication.CallAutomation.CallLocator other) { throw null; } + public override int GetHashCode() { throw null; } + public override string ToString() { throw null; } } public partial class SendDtmfTonesCompleted : Azure.Communication.CallAutomation.CallAutomationEventBase { @@ -1458,6 +1578,12 @@ public StartHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetP public Azure.Communication.CallAutomation.PlaySource PlaySourceInfo { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } } + public partial class StartMediaStreamingOptions + { + public StartMediaStreamingOptions() { } + public System.Uri OperationCallbackUri { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + } public partial class StartRecognizingCallMediaResult { internal StartRecognizingCallMediaResult() { } @@ -1487,7 +1613,13 @@ public partial class StartTranscriptionOptions { public StartTranscriptionOptions() { } public string Locale { get { throw null; } set { } } + public string OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } + } + public partial class StopAudio + { + public StopAudio() { } } public partial class StopHoldMusicOptions { @@ -1495,18 +1627,37 @@ public StopHoldMusicOptions(Azure.Communication.CommunicationIdentifier targetPa public string OperationContext { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier TargetParticipant { get { throw null; } } } + public partial class StopMediaStreamingOptions + { + public StopMediaStreamingOptions() { } + public System.Uri OperationCallbackUri { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + } public partial class StopTranscriptionOptions { public StopTranscriptionOptions() { } + public string OperationCallbackUri { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } } public abstract partial class StreamingData { protected StreamingData() { } + public static Azure.Communication.CallAutomation.StreamingDataKind Kind { get { throw null; } } + public static Azure.Communication.CallAutomation.StreamingData Parse(string data) { throw null; } + public static T Parse(string data) where T : Azure.Communication.CallAutomation.StreamingData { throw null; } + } + [System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public enum StreamingDataKind + { + AudioData = 0, + AudioMetadata = 1, + TranscriptionData = 2, + TranscriptionMetadata = 3, } public static partial class StreamingDataParser { - public static Azure.Communication.CallAutomation.StreamingData Parse(System.BinaryData json) { throw null; } + public static Azure.Communication.CallAutomation.StreamingData Parse(System.BinaryData binaryData) { throw null; } public static Azure.Communication.CallAutomation.StreamingData Parse(byte[] receivedBytes) { throw null; } public static Azure.Communication.CallAutomation.StreamingData Parse(string stringJson) { throw null; } } @@ -1529,17 +1680,18 @@ public partial class TranscriptionData : Azure.Communication.CallAutomation.Stre { internal TranscriptionData() { } public double Confidence { get { throw null; } set { } } - public ulong Duration { get { throw null; } set { } } + public System.TimeSpan Duration { get { throw null; } set { } } public Azure.Communication.CallAutomation.TextFormat Format { get { throw null; } set { } } - public ulong Offset { get { throw null; } set { } } + public System.TimeSpan Offset { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier Participant { get { throw null; } set { } } - public Azure.Communication.CallAutomation.ResultStatus ResultStatus { get { throw null; } set { } } + public Azure.Communication.CallAutomation.TranscriptionResultState ResultState { get { throw null; } set { } } public string Text { get { throw null; } set { } } public System.Collections.Generic.IEnumerable Words { get { throw null; } set { } } } public partial class TranscriptionFailed : Azure.Communication.CallAutomation.CallAutomationEventBase { internal TranscriptionFailed() { } + public Azure.Communication.CallAutomation.MediaEventReasonCode ReasonCode { get { throw null; } } public Azure.Communication.CallAutomation.TranscriptionUpdate TranscriptionUpdate { get { throw null; } } public static Azure.Communication.CallAutomation.TranscriptionFailed Deserialize(string content) { throw null; } } @@ -1557,12 +1709,32 @@ public TranscriptionMetadata() { } } public partial class TranscriptionOptions { - public TranscriptionOptions(System.Uri transportUri, Azure.Communication.CallAutomation.TranscriptionTransport transportType, string locale, bool startTranscription) { } + public TranscriptionOptions(System.Uri transportUri, string locale, bool? startTranscription = default(bool?), Azure.Communication.CallAutomation.TranscriptionTransport transcriptionTransport = default(Azure.Communication.CallAutomation.TranscriptionTransport)) { } + public bool? EnableIntermediateResults { get { throw null; } set { } } public string Locale { get { throw null; } } - public bool StartTranscription { get { throw null; } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } + public bool? StartTranscription { get { throw null; } } public Azure.Communication.CallAutomation.TranscriptionTransport TranscriptionTransport { get { throw null; } } public System.Uri TransportUrl { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TranscriptionResultState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TranscriptionResultState(string value) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionResultState Final { get { throw null; } } + public static Azure.Communication.CallAutomation.TranscriptionResultState Intermediate { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.TranscriptionResultState 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.Communication.CallAutomation.TranscriptionResultState left, Azure.Communication.CallAutomation.TranscriptionResultState right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.TranscriptionResultState (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.TranscriptionResultState left, Azure.Communication.CallAutomation.TranscriptionResultState right) { throw null; } + public override string ToString() { throw null; } + } public partial class TranscriptionStarted : Azure.Communication.CallAutomation.CallAutomationEventBase { internal TranscriptionStarted() { } @@ -1628,6 +1800,32 @@ internal TranscriptionStopped() { } public Azure.Communication.CallAutomation.TranscriptionUpdate TranscriptionUpdate { get { throw null; } } public static Azure.Communication.CallAutomation.TranscriptionStopped Deserialize(string content) { throw null; } } + public partial class TranscriptionSubscription + { + internal TranscriptionSubscription() { } + public string Id { get { throw null; } } + public Azure.Communication.CallAutomation.TranscriptionSubscriptionState? State { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubscribedResultStates { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TranscriptionSubscriptionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TranscriptionSubscriptionState(string value) { throw null; } + public static Azure.Communication.CallAutomation.TranscriptionSubscriptionState Active { get { throw null; } } + public static Azure.Communication.CallAutomation.TranscriptionSubscriptionState Disabled { get { throw null; } } + public static Azure.Communication.CallAutomation.TranscriptionSubscriptionState Inactive { get { throw null; } } + public bool Equals(Azure.Communication.CallAutomation.TranscriptionSubscriptionState 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.Communication.CallAutomation.TranscriptionSubscriptionState left, Azure.Communication.CallAutomation.TranscriptionSubscriptionState right) { throw null; } + public static implicit operator Azure.Communication.CallAutomation.TranscriptionSubscriptionState (string value) { throw null; } + public static bool operator !=(Azure.Communication.CallAutomation.TranscriptionSubscriptionState left, Azure.Communication.CallAutomation.TranscriptionSubscriptionState right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct TranscriptionTransport : System.IEquatable { @@ -1674,6 +1872,7 @@ internal TransferCallToParticipantResult() { } public partial class TransferToParticipantOptions { public TransferToParticipantOptions(Azure.Communication.CommunicationUserIdentifier targetIdentity) { } + public TransferToParticipantOptions(Azure.Communication.MicrosoftTeamsAppIdentifier targetIdentity) { } public TransferToParticipantOptions(Azure.Communication.MicrosoftTeamsUserIdentifier targetIdentity) { } public TransferToParticipantOptions(Azure.Communication.PhoneNumberIdentifier targetPhoneNumberIdentity) { } public Azure.Communication.CallAutomation.CustomCallingContext CustomCallingContext { get { throw null; } } @@ -1707,6 +1906,13 @@ public UpdateDialogOptions(string dialogId, Azure.Communication.CallAutomation.D public string DialogId { get { throw null; } } public string OperationContext { get { throw null; } set { } } } + public partial class UpdateTranscriptionOptions + { + public UpdateTranscriptionOptions(string locale) { } + public string OperationCallbackUri { get { throw null; } set { } } + public string OperationContext { get { throw null; } set { } } + public string SpeechRecognitionModelEndpointId { get { throw null; } set { } } + } public partial class UserConsent { internal UserConsent() { } @@ -1732,11 +1938,11 @@ internal UserConsent() { } } public partial class WordData { - public WordData() { } + internal WordData() { } [System.Text.Json.Serialization.JsonPropertyNameAttribute("duration")] - public ulong Duration { get { throw null; } set { } } + public System.TimeSpan Duration { get { throw null; } set { } } [System.Text.Json.Serialization.JsonPropertyNameAttribute("offset")] - public ulong Offset { get { throw null; } set { } } + public System.TimeSpan Offset { get { throw null; } set { } } [System.Text.Json.Serialization.JsonPropertyNameAttribute("text")] public string Text { get { throw null; } set { } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/assets.json b/sdk/communication/Azure.Communication.CallAutomation/assets.json index 5601d08ddd16..1f8d5565a6f4 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/assets.json +++ b/sdk/communication/Azure.Communication.CallAutomation/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/communication/Azure.Communication.CallAutomation", - "Tag": "net/communication/Azure.Communication.CallAutomation_a7eb7ffb4a" + "Tag": "net/communication/Azure.Communication.CallAutomation_42ef7c9c87" } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Azure.Communication.CallAutomation.csproj b/sdk/communication/Azure.Communication.CallAutomation/src/Azure.Communication.CallAutomation.csproj index ed196849ec97..eca71289027f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Azure.Communication.CallAutomation.csproj +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Azure.Communication.CallAutomation.csproj @@ -6,7 +6,7 @@ Microsoft Azure Communication Call Automation quickstart - https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions?pivots=programming-language-csharp Azure Communication CallAutomation Service - 1.3.0-beta.1 + 1.4.0-beta.2 Microsoft Azure Communication CallAutomation Service;Microsoft;Azure;Azure Communication Service;Azure Communication CallAutomation Service;Calling;Communication;$(PackageCommonTags) $(RequiredTargetFrameworks) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs index a63950ff4b85..dadfad71109a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClient.cs @@ -9,7 +9,6 @@ using Azure.Core.Pipeline; using Azure.Communication.Pipeline; using System.Collections.Generic; -using System.Net; namespace Azure.Communication.CallAutomation { @@ -36,14 +35,6 @@ public class CallAutomationClient /// public CommunicationUserIdentifier Source { get; } - /// - /// MicrosoftTeamsAppIdentifier that makes the outbound call. - /// This can be provided by providing CallAutomationClientOption during construction of CallAutomationClient. - /// If left blank, Source is the default outbound call identity. - /// This should be mutual exclusive with Source. - /// - public MicrosoftTeamsAppIdentifier OPSSource { get; } - #region public constructors /// Initializes a new instance of . /// Connection string acquired from the Azure Communication Services resource. @@ -127,7 +118,6 @@ private CallAutomationClient(Uri endpoint, HttpPipeline httpPipeline, CallAutoma CallDialogRestClient = new CallDialogRestClient(_clientDiagnostics, httpPipeline, endpoint, options.ApiVersion); EventProcessor = new CallAutomationEventProcessor(); Source = options.Source; - OPSSource = options.OPSSource; } private CallAutomationClient( @@ -179,7 +169,8 @@ public virtual async Task> AnswerCallAsync(AnswerCall scope.Start(); try { - if (options == null) throw new ArgumentNullException(nameof(options)); + if (options == null) + throw new ArgumentNullException(nameof(options)); AnswerCallRequestInternal request = CreateAnswerCallRequest(options); @@ -226,7 +217,8 @@ public virtual Response AnswerCall(AnswerCallOptions options, scope.Start(); try { - if (options == null) throw new ArgumentNullException(nameof(options)); + if (options == null) + throw new ArgumentNullException(nameof(options)); AnswerCallRequestInternal request = CreateAnswerCallRequest(options); @@ -259,8 +251,8 @@ private AnswerCallRequestInternal CreateAnswerCallRequest(AnswerCallOptions opti }; } - request.MediaStreamingConfiguration = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); - request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); + request.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); + request.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); request.AnsweredBy = Source == null ? null : new CommunicationUserIdentifierModel(Source.Id); request.OperationContext = options.OperationContext; request.CustomCallingContext = new CustomCallingContextInternal( @@ -344,8 +336,8 @@ public virtual Response RedirectCall(RedirectCallOptions options, CancellationTo RedirectCallRequestInternal request = new RedirectCallRequestInternal(options.IncomingCallContext, CommunicationIdentifierSerializer.Serialize(options.CallInvite.Target)); request.CustomCallingContext = new CustomCallingContextInternal( - options.CallInvite.CustomCallingContext.SipHeaders == null ? new ChangeTrackingDictionary() : options.CallInvite.CustomCallingContext.SipHeaders, - options.CallInvite.CustomCallingContext.VoipHeaders == null ? new ChangeTrackingDictionary() : options.CallInvite.CustomCallingContext.VoipHeaders); + options.CallInvite.CustomCallingContext.SipHeaders == null ? new ChangeTrackingDictionary() : options.CallInvite.CustomCallingContext.SipHeaders, + options.CallInvite.CustomCallingContext.VoipHeaders == null ? new ChangeTrackingDictionary() : options.CallInvite.CustomCallingContext.VoipHeaders); return AzureCommunicationServicesRestClient.RedirectCall(request, cancellationToken); } @@ -519,7 +511,8 @@ public virtual Response CreateCall(CreateCallOptions options, scope.Start(); try { - if (options == null) throw new ArgumentNullException(nameof(options)); + if (options == null) + throw new ArgumentNullException(nameof(options)); CreateCallRequestInternal request = CreateCallRequest(options); @@ -618,6 +611,107 @@ public virtual Response CreateGroupCall(CreateGroupCallOptions } } + /// + /// Create a connect request. + /// + /// + /// + /// + /// is null. + /// callbackUrl is not formatted correctly or empty. + /// The server returned an error. See for details returned from the server. + /// + public virtual async Task> ConnectCallAsync(CallLocator callLocator, Uri callbackUri, CancellationToken cancellationToken = default) + { + ConnectCallOptions options = new ConnectCallOptions(callLocator, callbackUri); + + return await ConnectCallAsync(options, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a connect request. + /// + /// ConnectOptions for connect request. + /// The cancellation token. + /// is null. + /// CallbackUrl is not formatted correctly. + /// The server returned an error. See for details returned from the server. + /// + public virtual async Task> ConnectCallAsync(ConnectCallOptions connectCallOptions, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(ConnectCall)}"); + scope.Start(); + try + { + if (connectCallOptions == null) + throw new ArgumentNullException(nameof(connectCallOptions)); + + ConnectRequestInternal connectRequest = ConnectRequest(connectCallOptions); + Response response = await AzureCommunicationServicesRestClient.ConnectAsync(connectRequest).ConfigureAwait(false); + + var callConnection = GetCallConnection(response.Value.CallConnectionId); + ConnectCallResult connectResult = new ConnectCallResult(new CallConnectionProperties(response.Value), callConnection); + connectResult.SetEventProcessor(EventProcessor, response.Value.CallConnectionId); + + return Response.FromValue(connectResult, response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Create a connect request. + /// + /// + /// + /// + /// is null. + /// callbackUrl is not formatted correctly or empty. + /// The server returned an error. See for details returned from the server. + /// + public virtual Response ConnectCall(CallLocator callLocator, Uri callbackUri, CancellationToken cancellationToken = default) + { + ConnectCallOptions options = new ConnectCallOptions(callLocator, callbackUri); + + return ConnectCall(options, cancellationToken); + } + + /// + /// Create a connect request. + /// + /// ConnectOptions for connect request. + /// The cancellation token. + /// is null. + /// CallbackUrl is not formatted correctly. + /// The server returned an error. See for details returned from the server. + /// + public virtual Response ConnectCall(ConnectCallOptions connectCallOptions, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallAutomationClient)}.{nameof(ConnectCall)}"); + scope.Start(); + try + { + if (connectCallOptions == null) + throw new ArgumentNullException(nameof(connectCallOptions)); + + ConnectRequestInternal connectRequest = ConnectRequest(connectCallOptions); + Response response = AzureCommunicationServicesRestClient.Connect(connectRequest); + + var callConnection = GetCallConnection(response.Value.CallConnectionId); + ConnectCallResult connectResult = new ConnectCallResult(new CallConnectionProperties(response.Value), callConnection); + connectResult.SetEventProcessor(EventProcessor, response.Value.CallConnectionId); + + return Response.FromValue(connectResult, response.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options) { CreateCallRequestInternal request = new( @@ -629,7 +723,7 @@ private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options) : new PhoneNumberIdentifierModel(options?.CallInvite?.SourceCallerIdNumber?.PhoneNumber), SourceDisplayName = options?.CallInvite?.SourceDisplayName, Source = Source == null ? null : new CommunicationUserIdentifierModel(Source.Id), - OpsSource = OPSSource == null ? null : new MicrosoftTeamsAppIdentifierModel(OPSSource.AppId), + TeamsAppSource = options.TeamsAppSource == null ? null : new MicrosoftTeamsAppIdentifierModel(options.TeamsAppSource.AppId), }; request.CustomCallingContext = new CustomCallingContextInternal( @@ -647,8 +741,8 @@ private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options) } request.OperationContext = options.OperationContext; - request.MediaStreamingConfiguration = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); - request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); + request.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); + request.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); return request; } @@ -664,7 +758,7 @@ private CreateCallRequestInternal CreateCallRequest(CreateGroupCallOptions optio : new PhoneNumberIdentifierModel(options?.SourceCallerIdNumber?.PhoneNumber), SourceDisplayName = options?.SourceDisplayName, Source = Source == null ? null : new CommunicationUserIdentifierModel(Source.Id), - OpsSource = OPSSource == null ? null : new MicrosoftTeamsAppIdentifierModel(OPSSource.AppId) + TeamsAppSource = options.TeamsAppSource == null ? null : new MicrosoftTeamsAppIdentifierModel(options.TeamsAppSource.AppId) }; request.CustomCallingContext = new CustomCallingContextInternal( @@ -682,18 +776,39 @@ private CreateCallRequestInternal CreateCallRequest(CreateGroupCallOptions optio } request.OperationContext = options.OperationContext; - request.MediaStreamingConfiguration = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); - request.TranscriptionConfiguration = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); + request.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); + request.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); return request; } + private ConnectRequestInternal ConnectRequest(ConnectCallOptions options) + { + CallLocatorInternal callLocatorInternal = CallLocatorSerializer.Serialize(options.CallLocator); + ConnectRequestInternal connectRequest = new ConnectRequestInternal(callLocatorInternal, options.CallbackUri?.AbsoluteUri); + connectRequest.OperationContext = options.OperationContext; + connectRequest.MediaStreamingOptions = CreateMediaStreamingOptionsInternal(options.MediaStreamingOptions); + connectRequest.TranscriptionOptions = CreateTranscriptionOptionsInternal(options.TranscriptionOptions); + + if (options.CallIntelligenceOptions != null && options.CallIntelligenceOptions.CognitiveServicesEndpoint != null) + { + CallIntelligenceOptionsInternal callIntelligenceOptionsInternal = new CallIntelligenceOptionsInternal + { + CognitiveServicesEndpoint = options.CallIntelligenceOptions?.CognitiveServicesEndpoint?.AbsoluteUri + }; + connectRequest.CallIntelligenceOptions = callIntelligenceOptionsInternal; + } + + return connectRequest; + } + /// /// Validates an Https Uri. /// /// /// - private static bool IsValidHttpsUri(Uri uri) { + private static bool IsValidHttpsUri(Uri uri) + { if (uri == null) return false; var uriString = uri.AbsoluteUri; @@ -704,15 +819,20 @@ private static MediaStreamingOptionsInternal CreateMediaStreamingOptionsInternal { return configuration == default ? default - : new MediaStreamingOptionsInternal(configuration.TransportUri.AbsoluteUri, configuration.MediaStreamingTransport, configuration.MediaStreamingContent, - configuration.MediaStreamingAudioChannel); + : new MediaStreamingOptionsInternal(configuration.TransportUri.AbsoluteUri, configuration.MediaStreamingTransport, + configuration.MediaStreamingContent, configuration.MediaStreamingAudioChannel, configuration.StartMediaStreaming, + configuration.EnableBidirectional, configuration.AudioFormat == null ? AudioFormat.Pcm24KMono : configuration.AudioFormat); } private static TranscriptionOptionsInternal CreateTranscriptionOptionsInternal(TranscriptionOptions configuration) { return configuration == default ? default : new TranscriptionOptionsInternal(configuration.TransportUrl.AbsoluteUri, configuration.TranscriptionTransport, configuration.Locale, - configuration.StartTranscription); + configuration.StartTranscription.GetValueOrDefault()) + { + EnableIntermediateResults = configuration.EnableIntermediateResults, + SpeechRecognitionModelEndpointId = configuration.SpeechRecognitionModelEndpointId + }; } /// Initializes a new instance of CallConnection. . diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs index 6b04dd4a45a3..cf2707ca6927 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationClientOptions.cs @@ -16,22 +16,15 @@ public class CallAutomationClientOptions : ClientOptions /// /// The latest version of the CallAutomation service. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V2023_10_03_Preview; + internal const ServiceVersion LatestVersion = ServiceVersion.V2024_09_01_Preview; internal string ApiVersion { get; } /// /// The caller source of the call automation client. - /// Mutual exclusive with . /// public CommunicationUserIdentifier Source { get; set; } - /// - /// The One Phone System caller source of the call automation client. - /// Mutual exclusive with . - /// - public MicrosoftTeamsAppIdentifier OPSSource { get; set; } - /// /// Initializes a new instance of the . /// @@ -43,6 +36,7 @@ public CallAutomationClientOptions(ServiceVersion version = LatestVersion) ServiceVersion.V2023_06_15_Preview => "2023-06-15-preview", ServiceVersion.V2023_10_15 => "2023-10-15", ServiceVersion.V2023_10_03_Preview => "2023-10-03-preview", + ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview", _ => throw new ArgumentOutOfRangeException(nameof(version)), }; } @@ -71,7 +65,12 @@ public enum ServiceVersion /// /// Latest ALPHA3 (1.2.0-alpha) preview of the CallAutomation service. /// - V2023_10_03_Preview = 4 + V2023_10_03_Preview = 4, + + /// + /// Latest ALPHA4 (1.4.0-alpha) preview of the CallAutomation service. + /// + V2024_09_01_Preview = 5 #pragma warning restore CA1707 // Identifiers should not contain underscores } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AnswerCallEventResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AnswerCallEventResult.cs index 70a68b7da14f..4bd7ddca1b05 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AnswerCallEventResult.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/AnswerCallEventResult.cs @@ -17,7 +17,7 @@ public class AnswerCallEventResult public CallConnected SuccessResult { get; } /// - /// evnet will be returned when the call was not answered. + /// event will be returned once the call is established with AnswerCall. /// /// public AnswerFailed FailureResult { get; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/ConnectCallEventResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/ConnectCallEventResult.cs new file mode 100644 index 000000000000..f6b5534ee12a --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/ConnectCallEventResult.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.CallAutomation +{ + /// is returned from WaitForEvent of . + public class ConnectCallEventResult + { + /// + /// Indicates whether the returned event is considered successful or not. + /// + public bool IsSuccess { get; internal set; } + + /// + /// event will be returned once the connect succeeded. + /// + public CallConnected SuccessResult { get; } + + /// + /// event will be returned once the connect failed. + /// + public ConnectFailed FailureResult { get; } + + internal ConnectCallEventResult(bool isSuccess, ConnectFailed failureResult, CallConnected successResult) + { + IsSuccess = isSuccess; + FailureResult = failureResult; + SuccessResult = successResult; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/HoldEventResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/HoldEventResult.cs new file mode 100644 index 000000000000..3cbbad5dc69b --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallAutomationEventProcessor/EventResult/HoldEventResult.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.CallAutomation +{ + /// is returned from WaitForEvent of . + public class HoldEventResult + { + /// + /// Indicates whether the returned event is considered successful or not. + /// + public bool IsSuccess { get; internal set; } + + /// + /// event will be returned once the hold failed. + /// + public HoldFailed FailureResult { get; } + + internal HoldEventResult(bool isSuccess, HoldFailed failureResult) + { + IsSuccess = isSuccess; + FailureResult = failureResult; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs index 5f8d00391034..010cb2ddfd69 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs @@ -172,6 +172,10 @@ public virtual async Task> TransferCal { options = new TransferToParticipantOptions(targetParticipant as MicrosoftTeamsUserIdentifier); } + else if (targetParticipant is MicrosoftTeamsAppIdentifier) + { + options = new TransferToParticipantOptions(targetParticipant as MicrosoftTeamsAppIdentifier); + } else { throw new ArgumentException("targetParticipant type is invalid.", nameof(targetParticipant)); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs index bc151e39f2c3..39e46b74b292 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallMedia.cs @@ -104,6 +104,41 @@ public virtual async Task> PlayAsync(PlaySource playSource, } } + /// + /// Plays audio to specified participant(s) async. + /// + /// + /// + /// + /// Returns , which can be used to wait for Play's related events. + public virtual async Task> PlayAsync(IEnumerable playSources, IEnumerable playTo, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Play)}"); + scope.Start(); + try + { + var playOptions = new PlayOptions(playSources, playTo) + { + Loop = false, + OperationContext = null + }; + + PlayRequestInternal request = CreatePlayRequest(playOptions); + + var response = await CallMediaRestClient.PlayAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false); + + var result = new PlayResult(); + result.SetEventProcessor(EventProcessor, CallConnectionId, request.OperationContext); + + return Response.FromValue(result, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Plays audio to specified participant(s). /// @@ -167,6 +202,41 @@ public virtual Response Play(PlaySource playSource, IEnumerable + /// Plays a file. + /// + /// + /// + /// + /// Returns , which can be used to wait for Play's related events. + public virtual Response Play(IEnumerable playSources, IEnumerable playTo, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Play)}"); + scope.Start(); + try + { + var playOptions = new PlayOptions(playSources, playTo) + { + Loop = false, + OperationContext = null + }; + + PlayRequestInternal request = CreatePlayRequest(playOptions); + + var response = CallMediaRestClient.Play(CallConnectionId, request, cancellationToken); + + var result = new PlayResult(); + result.SetEventProcessor(EventProcessor, CallConnectionId, request.OperationContext); + + return Response.FromValue(result, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + private static PlayRequestInternal CreatePlayRequest(PlayOptions options) { PlayRequestInternal request = new PlayRequestInternal(options.PlaySources.Select(t => TranslatePlaySourceToInternal(t)).ToList()); @@ -235,6 +305,27 @@ public virtual async Task> PlayToAllAsync(PlaySource playSo } } + /// + /// Play to all participants async. + /// + /// + /// + /// Returns , which can be used to wait for Play's related events. + public virtual async Task> PlayToAllAsync(IEnumerable playSources, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(PlayToAll)}"); + scope.Start(); + try + { + return await PlayAsync(playSources, Enumerable.Empty(), cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Play audio to all participants. /// @@ -281,6 +372,27 @@ public virtual Response PlayToAll(PlaySource playSource, Cancellatio } } + /// + /// Play to all participants. + /// + /// + /// + /// Returns , which can be used to wait for Play's related events. + public virtual Response PlayToAll(IEnumerable playSources, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(PlayToAll)}"); + scope.Start(); + try + { + return Play(playSources, Enumerable.Empty(), cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Cancel any media operation to all participants. /// @@ -393,23 +505,21 @@ public virtual Response StartRecognizing(CallMe /// The options. /// /// - [Obsolete("This operations is deprecated, please us Hold instead.")] - public virtual Response StartHoldMusic(StartHoldMusicOptions options, CancellationToken cancellationToken = default) + public virtual async Task HoldAsync(HoldOptions options, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartHoldMusic)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(HoldAsync)}"); scope.Start(); try { - //ToDo: Media team needs to fix the options.Loop since StartHoldMusicRequestInternal does not have Lopp anymore. - // and work on the StartHoldMusicRequestInternal.operationCallbackUri - var request = new StartHoldMusicRequestInternal( + var request = new HoldRequestInternal( CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)) { OperationContext = options.OperationContext, - PlaySourceInfo = TranslatePlaySourceToInternal(options.PlaySourceInfo), + PlaySourceInfo = TranslatePlaySourceToInternal(options.PlaySource), + OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, }; - return CallMediaRestClient.StartHoldMusic(CallConnectionId, request, cancellationToken: cancellationToken); + return await CallMediaRestClient.HoldAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); } catch (Exception ex) { @@ -421,24 +531,19 @@ public virtual Response StartHoldMusic(StartHoldMusicOptions options, Cancellati /// /// Hold participant from the call. /// - /// The options. + /// The targetParticipant. /// /// - [Obsolete("This operations is deprecated, please us HoldAsync instead.")] - public virtual async Task StartHoldMusicAsync(StartHoldMusicOptions options, CancellationToken cancellationToken = default) + public virtual async Task HoldAsync(CommunicationIdentifier targetParticipant, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartHoldMusicAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(HoldAsync)}"); scope.Start(); try { - var request = new StartHoldMusicRequestInternal( - CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)) - { - OperationContext = options.OperationContext, - PlaySourceInfo = TranslatePlaySourceToInternal(options.PlaySourceInfo), - }; + var request = new HoldRequestInternal( + CommunicationIdentifierSerializer.Serialize(targetParticipant)); - return await CallMediaRestClient.StartHoldMusicAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); + return await CallMediaRestClient.HoldAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); } catch (Exception ex) { @@ -448,21 +553,25 @@ public virtual async Task StartHoldMusicAsync(StartHoldMusicOptions op } /// - /// Remove hold from participant. + /// Hold participant from the call. /// - /// The options. + /// The targetParticipant. + /// The playsource. /// /// - [Obsolete("This operations is deprecated, please us UnholdAsync instead.")] - public virtual async Task StopHoldMusicAsync(StopHoldMusicOptions options, CancellationToken cancellationToken = default) + public virtual async Task HoldAsync(CommunicationIdentifier targetParticipant, PlaySource playSource, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopHoldMusicAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(HoldAsync)}"); scope.Start(); try { - StopHoldMusicRequestInternal request = new StopHoldMusicRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); + var request = new HoldRequestInternal( + CommunicationIdentifierSerializer.Serialize(targetParticipant)) + { + PlaySourceInfo = TranslatePlaySourceToInternal(playSource), + }; - return await CallMediaRestClient.StopHoldMusicAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); + return await CallMediaRestClient.HoldAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); } catch (Exception ex) { @@ -472,21 +581,26 @@ public virtual async Task StopHoldMusicAsync(StopHoldMusicOptions opti } /// - /// Remove hold from participant. + /// Hold participant from the call. /// /// The options. /// /// - [Obsolete("This operations is deprecated, please us Unhold instead.")] - public virtual Response StopHoldMusic(StopHoldMusicOptions options, CancellationToken cancellationToken = default) + public virtual Response Hold(HoldOptions options, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopHoldMusicAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Hold)}"); scope.Start(); try { - StopHoldMusicRequestInternal request = new StopHoldMusicRequestInternal(CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)); + var request = new HoldRequestInternal( + CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)) + { + OperationContext = options.OperationContext, + PlaySourceInfo = TranslatePlaySourceToInternal(options.PlaySource), + OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, + }; - return CallMediaRestClient.StopHoldMusic(CallConnectionId, request, cancellationToken: cancellationToken); + return CallMediaRestClient.Hold(CallConnectionId, request, cancellationToken: cancellationToken); } catch (Exception ex) { @@ -498,24 +612,19 @@ public virtual Response StopHoldMusic(StopHoldMusicOptions options, Cancellation /// /// Hold participant from the call. /// - /// The options. + /// The targetParticipant. /// /// - public virtual async Task HoldAsync(HoldOptions options, CancellationToken cancellationToken = default) + public virtual Response Hold(CommunicationIdentifier targetParticipant, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartHoldMusicAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Hold)}"); scope.Start(); try { var request = new HoldRequestInternal( - CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)) - { - OperationContext = options.OperationContext, - PlaySourceInfo = TranslatePlaySourceToInternal(options.PlaySourceInfo), - OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, - }; + CommunicationIdentifierSerializer.Serialize(targetParticipant)); - return await CallMediaRestClient.HoldAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); + return CallMediaRestClient.Hold(CallConnectionId, request, cancellationToken: cancellationToken); } catch (Exception ex) { @@ -527,21 +636,20 @@ public virtual async Task HoldAsync(HoldOptions options, CancellationT /// /// Hold participant from the call. /// - /// The options. + /// The targetParticipant. + /// The playsource. /// /// - public virtual Response Hold(HoldOptions options, CancellationToken cancellationToken = default) + public virtual Response Hold(CommunicationIdentifier targetParticipant, PlaySource playSource, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Hold)}"); scope.Start(); try { var request = new HoldRequestInternal( - CommunicationIdentifierSerializer.Serialize(options.TargetParticipant)) + CommunicationIdentifierSerializer.Serialize(targetParticipant)) { - OperationContext = options.OperationContext, - PlaySourceInfo = TranslatePlaySourceToInternal(options.PlaySourceInfo), - OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, + PlaySourceInfo = TranslatePlaySourceToInternal(playSource), }; return CallMediaRestClient.Hold(CallConnectionId, request, cancellationToken: cancellationToken); @@ -561,7 +669,7 @@ public virtual Response Hold(HoldOptions options, CancellationToken cancellation /// public virtual async Task UnholdAsync(UnholdOptions options, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopHoldMusicAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UnholdAsync)}"); scope.Start(); try { @@ -576,6 +684,29 @@ public virtual async Task UnholdAsync(UnholdOptions options, Cancellat } } + /// + /// Remove hold from participant. + /// + /// The targetParticipant. + /// + /// + public virtual async Task UnholdAsync(CommunicationIdentifier targetParticipant, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UnholdAsync)}"); + scope.Start(); + try + { + var request = new UnholdRequestInternal(CommunicationIdentifierSerializer.Serialize(targetParticipant)); + + return await CallMediaRestClient.UnholdAsync(CallConnectionId, request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Remove hold from participant. /// @@ -584,7 +715,7 @@ public virtual async Task UnholdAsync(UnholdOptions options, Cancellat /// public virtual Response Unhold(UnholdOptions options, CancellationToken cancellationToken = default) { - using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopHoldMusicAsync)}"); + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Unhold)}"); scope.Start(); try { @@ -599,6 +730,29 @@ public virtual Response Unhold(UnholdOptions options, CancellationToken cancella } } + /// + /// Remove hold from participant. + /// + /// The targetParticipant. + /// + /// + public virtual Response Unhold(CommunicationIdentifier targetParticipant, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(Unhold)}"); + scope.Start(); + try + { + var request = new UnholdRequestInternal(CommunicationIdentifierSerializer.Serialize(targetParticipant)); + + return CallMediaRestClient.Unhold(CallConnectionId, request, cancellationToken: cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecognizeOptions recognizeOptions) { if (recognizeOptions == null) @@ -623,6 +777,8 @@ private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecogniz RecognizeRequestInternal request = new RecognizeRequestInternal(recognizeDtmfOptions.InputType, recognizeConfigurationsInternal); request.PlayPrompt = TranslatePlaySourceToInternal(recognizeDtmfOptions.Prompt); + if (recognizeOptions.PlayPrompts != null && recognizeOptions.PlayPrompts.Any()) + request.PlayPrompts = recognizeOptions.PlayPrompts.Select(t => TranslatePlaySourceToInternal(t)).ToList(); request.InterruptCallMediaOperation = recognizeOptions.InterruptCallMediaOperation; request.OperationContext = recognizeOptions.OperationContext == default ? Guid.NewGuid().ToString() : recognizeOptions.OperationContext; request.OperationCallbackUri = recognizeOptions.OperationCallbackUri?.AbsoluteUri; @@ -653,6 +809,8 @@ private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecogniz RecognizeRequestInternal request = new RecognizeRequestInternal(recognizeChoiceOptions.InputType, recognizeConfigurationsInternal); request.PlayPrompt = TranslatePlaySourceToInternal(recognizeChoiceOptions.Prompt); + if (recognizeOptions.PlayPrompts != null && recognizeOptions.PlayPrompts.Any()) + request.PlayPrompts = recognizeOptions.PlayPrompts.Select(t => TranslatePlaySourceToInternal(t)).ToList(); request.InterruptCallMediaOperation = recognizeOptions.InterruptCallMediaOperation; request.OperationContext = recognizeOptions.OperationContext == default ? Guid.NewGuid().ToString() : recognizeOptions.OperationContext; request.OperationCallbackUri = recognizeOptions.OperationCallbackUri?.AbsoluteUri; @@ -686,6 +844,8 @@ private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecogniz RecognizeRequestInternal request = new RecognizeRequestInternal(recognizeSpeechOptions.InputType, recognizeConfigurationsInternal); request.PlayPrompt = TranslatePlaySourceToInternal(recognizeSpeechOptions.Prompt); + if (recognizeOptions.PlayPrompts != null && recognizeOptions.PlayPrompts.Any()) + request.PlayPrompts = recognizeOptions.PlayPrompts.Select(t => TranslatePlaySourceToInternal(t)).ToList(); request.InterruptCallMediaOperation = recognizeOptions.InterruptCallMediaOperation; request.OperationContext = recognizeOptions.OperationContext == default ? Guid.NewGuid().ToString() : recognizeOptions.OperationContext; request.OperationCallbackUri = recognizeOptions.OperationCallbackUri?.AbsoluteUri; @@ -727,6 +887,8 @@ private static RecognizeRequestInternal CreateRecognizeRequest(CallMediaRecogniz RecognizeRequestInternal request = new RecognizeRequestInternal(recognizeSpeechOrDtmfOptions.InputType, recognizeConfigurationsInternal); request.PlayPrompt = TranslatePlaySourceToInternal(recognizeSpeechOrDtmfOptions.Prompt); + if (recognizeOptions.PlayPrompts != null && recognizeOptions.PlayPrompts.Any()) + request.PlayPrompts = recognizeOptions.PlayPrompts.Select(t => TranslatePlaySourceToInternal(t)).ToList(); request.InterruptCallMediaOperation = recognizeOptions.InterruptCallMediaOperation; request.OperationContext = recognizeOptions.OperationContext == default ? Guid.NewGuid().ToString() : recognizeOptions.OperationContext; request.OperationCallbackUri = recognizeOptions.OperationCallbackUri?.AbsoluteUri; @@ -1108,7 +1270,7 @@ public virtual Response StartTranscription(StartTranscriptionOptions options = d { var request = options == default ? new StartTranscriptionRequestInternal() - : new StartTranscriptionRequestInternal() { Locale = options.Locale, OperationContext = options.OperationContext }; + : new StartTranscriptionRequestInternal() { Locale = options.Locale, OperationContext = options.OperationContext, OperationCallbackUri=options.OperationCallbackUri, SpeechRecognitionModelEndpointId=options.SpeechRecognitionModelEndpointId }; return CallMediaRestClient.StartTranscription(CallConnectionId, request, cancellationToken); } @@ -1133,7 +1295,7 @@ public virtual async Task StartTranscriptionAsync(StartTranscriptionOp { var request = options == default ? new StartTranscriptionRequestInternal() - : new StartTranscriptionRequestInternal() { Locale = options.Locale, OperationContext = options.OperationContext }; + : new StartTranscriptionRequestInternal() { Locale = options.Locale, OperationContext = options.OperationContext, OperationCallbackUri = options.OperationCallbackUri, SpeechRecognitionModelEndpointId = options.SpeechRecognitionModelEndpointId }; return await CallMediaRestClient.StartTranscriptionAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false); } @@ -1158,7 +1320,7 @@ public virtual Response StopTranscription(StopTranscriptionOptions options = def { var request = options == default ? new StopTranscriptionRequestInternal() - : new StopTranscriptionRequestInternal() { OperationContext = options.OperationContext }; + : new StopTranscriptionRequestInternal() { OperationContext = options.OperationContext, OperationCallbackUri = options.OperationCallbackUri }; return CallMediaRestClient.StopTranscription(CallConnectionId, request, cancellationToken); } @@ -1183,7 +1345,7 @@ public virtual async Task StopTranscriptionAsync(StopTranscriptionOpti { var request = options == default ? new StopTranscriptionRequestInternal() - : new StopTranscriptionRequestInternal() { OperationContext = options.OperationContext }; + : new StopTranscriptionRequestInternal() { OperationContext = options.OperationContext, OperationCallbackUri = options.OperationCallbackUri }; return await CallMediaRestClient.StopTranscriptionAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false); } @@ -1216,6 +1378,29 @@ public virtual Response UpdateTranscription(string locale, CancellationToken can } } + /// + /// API to change transcription language. + /// + /// An optional object containing update transcription options and configurations. + /// An optional CancellationToken to cancel the request. + /// Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error. + public virtual Response UpdateTranscription(UpdateTranscriptionOptions options = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UpdateTranscription)}"); + scope.Start(); + try + { + UpdateTranscriptionRequestInternal request = new(options.Locale, options.SpeechRecognitionModelEndpointId, options.OperationContext, options.OperationCallbackUri); + + return CallMediaRestClient.UpdateTranscription(CallConnectionId, request, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// API to change transcription language. /// @@ -1237,5 +1422,128 @@ public virtual async Task UpdateTranscriptionAsync(string locale, Canc throw; } } + + /// + /// API to change transcription language. + /// + /// An optional object containing update transcription options and configurations. + /// An optional CancellationToken to cancel the request. + /// Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error. + public virtual async Task UpdateTranscriptionAsync(UpdateTranscriptionOptions options = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(UpdateTranscription)}"); + scope.Start(); + try + { + UpdateTranscriptionRequestInternal request = new(options.Locale, options.SpeechRecognitionModelEndpointId, options.OperationContext, options.OperationCallbackUri); + + return await CallMediaRestClient.UpdateTranscriptionAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Starts media streaming in the call. + /// + /// An optional object containing start media streaming options. + /// An optional CancellationToken to cancel the request. + /// Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error. + public virtual Response StartMediaStreaming(StartMediaStreamingOptions options = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartMediaStreaming)}"); + scope.Start(); + try + { + var request = options == default + ? new StartMediaStreamingRequestInternal() + : new StartMediaStreamingRequestInternal() { OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, OperationContext = options.OperationContext }; + + return CallMediaRestClient.StartMediaStreaming(CallConnectionId, request, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Starts media streaming in the call. + /// + /// An optional object containing start media streaming options. + /// An optional CancellationToken to cancel the request. + /// Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error. + public virtual async Task StartMediaStreamingAsync(StartMediaStreamingOptions options = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StartMediaStreaming)}"); + scope.Start(); + try + { + var request = options == default + ? new StartMediaStreamingRequestInternal() + : new StartMediaStreamingRequestInternal() { OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, OperationContext = options.OperationContext }; + + return await CallMediaRestClient.StartMediaStreamingAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Stops media streaming in the call. + /// + /// An optional object containing stop media streaming options. + /// An optional CancellationToken to cancel the request. + /// Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error. + public virtual Response StopMediaStreaming(StopMediaStreamingOptions options = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopMediaStreaming)}"); + scope.Start(); + try + { + var request = options == default + ? new StopMediaStreamingRequestInternal() + : new StopMediaStreamingRequestInternal() { OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri, OperationContext = options.OperationContext }; + + return CallMediaRestClient.StopMediaStreaming(CallConnectionId, request, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Stops media streaming in the call. + /// + /// An optional object containing stop media streaming options. + /// An optional CancellationToken to cancel the request. + /// Returns an HTTP response with a 202 status code for success, or an HTTP failure error code in case of an error. + public virtual async Task StopMediaStreamingAsync(StopMediaStreamingOptions options = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(CallMedia)}.{nameof(StopMediaStreaming)}"); + scope.Start(); + try + { + var request = options == default + ? new StopMediaStreamingRequestInternal() + : new StopMediaStreamingRequestInternal() { OperationCallbackUri = options.OperationCallbackUri?.AbsoluteUri }; // OperationContext = options.OperationContext + + return await CallMediaRestClient.StopMediaStreamingAsync(CallConnectionId, request, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallRecording.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallRecording.cs index 77e7dccf4f63..1b30b00039bc 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallRecording.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallRecording.cs @@ -56,8 +56,9 @@ public virtual Response Start(StartRecordingOptions option scope.Start(); try { - StartCallRecordingRequestInternal request = new(CallLocatorSerializer.Serialize(options.CallLocator)) + StartCallRecordingRequestInternal request = new() { + CallLocator = CallLocatorSerializer.Serialize(options.CallLocator), RecordingStateCallbackUri = options.RecordingStateCallbackUri?.AbsoluteUri, RecordingChannelType = options.RecordingChannel, RecordingContentType = options.RecordingContent, @@ -118,8 +119,9 @@ public virtual async Task> StartAsync(StartRecord scope.Start(); try { - StartCallRecordingRequestInternal request = new(CallLocatorSerializer.Serialize(options.CallLocator)) + StartCallRecordingRequestInternal request = new() { + CallLocator = CallLocatorSerializer.Serialize(options.CallLocator), RecordingStateCallbackUri = options.RecordingStateCallbackUri?.AbsoluteUri, RecordingChannelType = options.RecordingChannel, RecordingContentType = options.RecordingContent, diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/AzureCommunicationServicesRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/AzureCommunicationServicesRestClient.cs index 30b3c24f2578..6345b6e95be2 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/AzureCommunicationServicesRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/AzureCommunicationServicesRestClient.cs @@ -29,7 +29,7 @@ internal partial class AzureCommunicationServicesRestClient /// The endpoint of the Azure Communication resource. /// Api Version. /// , , or is null. - public AzureCommunicationServicesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-10-03-preview") + public AzureCommunicationServicesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2024-09-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -314,5 +314,81 @@ public Response RejectCall(RejectCallRequestInternal rejectCallRequestInternal, throw new RequestFailedException(message.Response); } } + + internal HttpMessage CreateConnectRequest(ConnectRequestInternal connectRequestInternal) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/calling/callConnections:connect", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectRequestInternal); + request.Content = content; + return message; + } + + /// Create a Connection to a CallLocator. + /// The create connection request. + /// The cancellation token to use. + /// is null. + /// Create a connection to a CallLocator. + public async Task> ConnectAsync(ConnectRequestInternal connectRequestInternal, CancellationToken cancellationToken = default) + { + if (connectRequestInternal == null) + { + throw new ArgumentNullException(nameof(connectRequestInternal)); + } + + using var message = CreateConnectRequest(connectRequestInternal); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CallConnectionPropertiesInternal value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CallConnectionPropertiesInternal.DeserializeCallConnectionPropertiesInternal(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Connection to a CallLocator. + /// The create connection request. + /// The cancellation token to use. + /// is null. + /// Create a connection to a CallLocator. + public Response Connect(ConnectRequestInternal connectRequestInternal, CancellationToken cancellationToken = default) + { + if (connectRequestInternal == null) + { + throw new ArgumentNullException(nameof(connectRequestInternal)); + } + + using var message = CreateConnectRequest(connectRequestInternal); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CallConnectionPropertiesInternal value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CallConnectionPropertiesInternal.DeserializeCallConnectionPropertiesInternal(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallAutomationModelFactory.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallAutomationModelFactory.cs index 7be732a51cf9..1a76faff3b67 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallAutomationModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallAutomationModelFactory.cs @@ -46,16 +46,6 @@ public static UnmuteParticipantResult UnmuteParticipantResult(string operationCo return new UnmuteParticipantResult(operationContext); } - /// Initializes a new instance of . - /// - /// - /// - /// A new instance for mocking. - public static RecordingStateResult RecordingStateResult(string recordingId = null, RecordingState? recordingState = null, RecordingKind? recordingKind = null) - { - return new RecordingStateResult(recordingId, recordingState, recordingKind); - } - /// Initializes a new instance of . /// Code of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result was unexpected. /// Subcode of the current result. This can be helpful to Call Automation team to troubleshoot the issue if this result was unexpected. @@ -66,35 +56,6 @@ public static ResultInformation ResultInformation(int? code = null, int? subCode return new ResultInformation(code, subCode, message); } - /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Indicates the index of the failed play source. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// A new instance for mocking. - public static PlayFailed PlayFailed(string operationContext = null, ResultInformation resultInformation = null, int? failedPlaySourceIndex = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) - { - return new PlayFailed( - operationContext, - resultInformation, - failedPlaySourceIndex, - callConnectionId, - serverCallId, - correlationId); - } - - /// Initializes a new instance of . - /// - /// A new instance for mocking. - public static CollectTonesResult CollectTonesResult(IEnumerable tones = null) - { - tones ??= new List(); - - return new CollectTonesResult(tones?.ToList()); - } - /// Initializes a new instance of . /// /// A new instance for mocking. @@ -105,14 +66,6 @@ public static DtmfResult DtmfResult(IEnumerable tones = null) return new DtmfResult(tones?.ToList()); } - /// Initializes a new instance of . - /// The recognized speech in string. - /// A new instance for mocking. - public static SpeechResult SpeechResult(string speech = null) - { - return new SpeechResult(speech); - } - /// Initializes a new instance of . /// Label is the primary identifier for the choice detected. /// @@ -125,23 +78,12 @@ public static ChoiceResult ChoiceResult(string label = null, string recognizedPh return new ChoiceResult(label, recognizedPhrase); } - /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Indicates the index of the failed play source. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// A new instance for mocking. - public static RecognizeFailed RecognizeFailed(string operationContext = null, ResultInformation resultInformation = null, int? failedPlaySourceIndex = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + /// Initializes a new instance of . + /// The recognized speech in string. + /// A new instance for mocking. + public static SpeechResult SpeechResult(string speech = null) { - return new RecognizeFailed( - operationContext, - resultInformation, - failedPlaySourceIndex, - callConnectionId, - serverCallId, - correlationId); + return new SpeechResult(speech); } /// Initializes a new instance of . @@ -153,22 +95,22 @@ public static UserConsent UserConsent(int? recording = null) } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static TranscriptionStarted TranscriptionStarted(string operationContext = null, ResultInformation resultInformation = null, TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static TranscriptionStarted TranscriptionStarted(TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new TranscriptionStarted( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Initializes a new instance of . @@ -181,79 +123,79 @@ public static TranscriptionUpdate TranscriptionUpdate(TranscriptionStatus? trans } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static TranscriptionStopped TranscriptionStopped(string operationContext = null, ResultInformation resultInformation = null, TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static TranscriptionStopped TranscriptionStopped(TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new TranscriptionStopped( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static TranscriptionFailed TranscriptionFailed(string operationContext = null, ResultInformation resultInformation = null, TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static TranscriptionFailed TranscriptionFailed(TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new TranscriptionFailed( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static TranscriptionUpdated TranscriptionUpdated(string operationContext = null, ResultInformation resultInformation = null, TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static TranscriptionUpdated TranscriptionUpdated(TranscriptionUpdate transcriptionUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new TranscriptionUpdated( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Defines the result for audio streaming update with the current status and the details about the status. + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static MediaStreamingFailed MediaStreamingFailed(string operationContext = null, ResultInformation resultInformation = null, MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static MediaStreamingFailed MediaStreamingFailed(MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new MediaStreamingFailed( - operationContext, - resultInformation, mediaStreamingUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Initializes a new instance of . @@ -267,41 +209,41 @@ public static MediaStreamingUpdate MediaStreamingUpdate(string contentType = nul } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Defines the result for audio streaming update with the current status and the details about the status. + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static MediaStreamingStarted MediaStreamingStarted(string operationContext = null, ResultInformation resultInformation = null, MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static MediaStreamingStarted MediaStreamingStarted(MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new MediaStreamingStarted( - operationContext, - resultInformation, mediaStreamingUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Defines the result for audio streaming update with the current status and the details about the status. + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static MediaStreamingStopped MediaStreamingStopped(string operationContext = null, ResultInformation resultInformation = null, MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null) + public static MediaStreamingStopped MediaStreamingStopped(MediaStreamingUpdate mediaStreamingUpdate = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { return new MediaStreamingStopped( - operationContext, - resultInformation, mediaStreamingUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs index 831f28de3d56..c76e65cbac13 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallConnectionRestClient.cs @@ -29,7 +29,7 @@ internal partial class CallConnectionRestClient /// The endpoint of the Azure Communication resource. /// Api Version. /// , , or is null. - public CallConnectionRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-10-03-preview") + public CallConnectionRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2024-09-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -407,7 +407,7 @@ internal HttpMessage CreateAddParticipantRequest(string callConnectionId, AddPar /// Add a participant to the call. /// The call connection Id. - /// The to use. + /// The add participants request. /// The cancellation token to use. /// or is null. public async Task> AddParticipantAsync(string callConnectionId, AddParticipantRequestInternal addParticipantRequestInternal, CancellationToken cancellationToken = default) @@ -439,7 +439,7 @@ public async Task> AddParticipantAsync( /// Add a participant to the call. /// The call connection Id. - /// The to use. + /// The add participants request. /// The cancellation token to use. /// or is null. public Response AddParticipant(string callConnectionId, AddParticipantRequestInternal addParticipantRequestInternal, CancellationToken cancellationToken = default) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallDialogRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallDialogRestClient.cs index 34dc32e28db9..57ab85942184 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallDialogRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallDialogRestClient.cs @@ -29,7 +29,7 @@ internal partial class CallDialogRestClient /// The endpoint of the Azure Communication resource. /// Api Version. /// , , or is null. - public CallDialogRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-10-03-preview") + public CallDialogRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2024-09-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs index ec699000f758..b64397fa8ce8 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallMediaRestClient.cs @@ -29,7 +29,7 @@ internal partial class CallMediaRestClient /// The endpoint of the Azure Communication resource. /// Api Version. /// , , or is null. - public CallMediaRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-10-03-preview") + public CallMediaRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2024-09-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -851,81 +851,7 @@ public Response Unhold(string callConnectionId, UnholdRequestInternal unholdRequ } } - internal HttpMessage CreateStartHoldMusicRequest(string callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequestInternal) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/calling/callConnections/", false); - uri.AppendPath(callConnectionId, true); - uri.AppendPath(":startHoldMusic", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(startHoldMusicRequestInternal); - request.Content = content; - return message; - } - - /// Hold participant from the call using identifier. - /// The call connection id. - /// The participants to be hold from the call. - /// The cancellation token to use. - /// or is null. - public async Task StartHoldMusicAsync(string callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequestInternal, CancellationToken cancellationToken = default) - { - if (callConnectionId == null) - { - throw new ArgumentNullException(nameof(callConnectionId)); - } - if (startHoldMusicRequestInternal == null) - { - throw new ArgumentNullException(nameof(startHoldMusicRequestInternal)); - } - - using var message = CreateStartHoldMusicRequest(callConnectionId, startHoldMusicRequestInternal); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Hold participant from the call using identifier. - /// The call connection id. - /// The participants to be hold from the call. - /// The cancellation token to use. - /// or is null. - public Response StartHoldMusic(string callConnectionId, StartHoldMusicRequestInternal startHoldMusicRequestInternal, CancellationToken cancellationToken = default) - { - if (callConnectionId == null) - { - throw new ArgumentNullException(nameof(callConnectionId)); - } - if (startHoldMusicRequestInternal == null) - { - throw new ArgumentNullException(nameof(startHoldMusicRequestInternal)); - } - - using var message = CreateStartHoldMusicRequest(callConnectionId, startHoldMusicRequestInternal); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequestInternal) + internal HttpMessage CreateStartMediaStreamingRequest(string callConnectionId, StartMediaStreamingRequestInternal startMediaStreamingRequestInternal) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -934,72 +860,74 @@ internal HttpMessage CreateStopHoldMusicRequest(string callConnectionId, StopHol uri.Reset(_endpoint); uri.AppendPath("/calling/callConnections/", false); uri.AppendPath(callConnectionId, true); - uri.AppendPath(":stopHoldMusic", false); + uri.AppendPath(":startMediaStreaming", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(stopHoldMusicRequestInternal); + content.JsonWriter.WriteObjectValue(startMediaStreamingRequestInternal); request.Content = content; return message; } - /// Unhold participants from the call using identifier. + /// Starts media streaming in the call. /// The call connection id. - /// The participants to be hold from the call. + /// The to use. /// The cancellation token to use. - /// or is null. - public async Task StopHoldMusicAsync(string callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequestInternal, CancellationToken cancellationToken = default) + /// or is null. + /// Starts media streaming in the call. + public async Task StartMediaStreamingAsync(string callConnectionId, StartMediaStreamingRequestInternal startMediaStreamingRequestInternal, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (stopHoldMusicRequestInternal == null) + if (startMediaStreamingRequestInternal == null) { - throw new ArgumentNullException(nameof(stopHoldMusicRequestInternal)); + throw new ArgumentNullException(nameof(startMediaStreamingRequestInternal)); } - using var message = CreateStopHoldMusicRequest(callConnectionId, stopHoldMusicRequestInternal); + using var message = CreateStartMediaStreamingRequest(callConnectionId, startMediaStreamingRequestInternal); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Unhold participants from the call using identifier. + /// Starts media streaming in the call. /// The call connection id. - /// The participants to be hold from the call. + /// The to use. /// The cancellation token to use. - /// or is null. - public Response StopHoldMusic(string callConnectionId, StopHoldMusicRequestInternal stopHoldMusicRequestInternal, CancellationToken cancellationToken = default) + /// or is null. + /// Starts media streaming in the call. + public Response StartMediaStreaming(string callConnectionId, StartMediaStreamingRequestInternal startMediaStreamingRequestInternal, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (stopHoldMusicRequestInternal == null) + if (startMediaStreamingRequestInternal == null) { - throw new ArgumentNullException(nameof(stopHoldMusicRequestInternal)); + throw new ArgumentNullException(nameof(startMediaStreamingRequestInternal)); } - using var message = CreateStopHoldMusicRequest(callConnectionId, stopHoldMusicRequestInternal); + using var message = CreateStartMediaStreamingRequest(callConnectionId, startMediaStreamingRequestInternal); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateStartMediaStreamingRequest(string callConnectionId, StartMediaStreamingRequestInternal startMediaStreamingRequestInternal) + internal HttpMessage CreateStopMediaStreamingRequest(string callConnectionId, StopMediaStreamingRequestInternal stopMediaStreamingRequestInternal) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1008,35 +936,35 @@ internal HttpMessage CreateStartMediaStreamingRequest(string callConnectionId, S uri.Reset(_endpoint); uri.AppendPath("/calling/callConnections/", false); uri.AppendPath(callConnectionId, true); - uri.AppendPath(":startMediaStreaming", false); + uri.AppendPath(":stopMediaStreaming", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(startMediaStreamingRequestInternal); + content.JsonWriter.WriteObjectValue(stopMediaStreamingRequestInternal); request.Content = content; return message; } - /// Starts media streaming in the call. + /// Stops media streaming in the call. /// The call connection id. - /// The to use. + /// stop media streaming request payload. /// The cancellation token to use. - /// or is null. - /// Starts media streaming in the call. - public async Task StartMediaStreamingAsync(string callConnectionId, StartMediaStreamingRequestInternal startMediaStreamingRequestInternal, CancellationToken cancellationToken = default) + /// or is null. + /// Stops media streaming in the call. + public async Task StopMediaStreamingAsync(string callConnectionId, StopMediaStreamingRequestInternal stopMediaStreamingRequestInternal, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (startMediaStreamingRequestInternal == null) + if (stopMediaStreamingRequestInternal == null) { - throw new ArgumentNullException(nameof(startMediaStreamingRequestInternal)); + throw new ArgumentNullException(nameof(stopMediaStreamingRequestInternal)); } - using var message = CreateStartMediaStreamingRequest(callConnectionId, startMediaStreamingRequestInternal); + using var message = CreateStopMediaStreamingRequest(callConnectionId, stopMediaStreamingRequestInternal); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1047,24 +975,24 @@ public async Task StartMediaStreamingAsync(string callConnectionId, St } } - /// Starts media streaming in the call. + /// Stops media streaming in the call. /// The call connection id. - /// The to use. + /// stop media streaming request payload. /// The cancellation token to use. - /// or is null. - /// Starts media streaming in the call. - public Response StartMediaStreaming(string callConnectionId, StartMediaStreamingRequestInternal startMediaStreamingRequestInternal, CancellationToken cancellationToken = default) + /// or is null. + /// Stops media streaming in the call. + public Response StopMediaStreaming(string callConnectionId, StopMediaStreamingRequestInternal stopMediaStreamingRequestInternal, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (startMediaStreamingRequestInternal == null) + if (stopMediaStreamingRequestInternal == null) { - throw new ArgumentNullException(nameof(startMediaStreamingRequestInternal)); + throw new ArgumentNullException(nameof(stopMediaStreamingRequestInternal)); } - using var message = CreateStartMediaStreamingRequest(callConnectionId, startMediaStreamingRequestInternal); + using var message = CreateStopMediaStreamingRequest(callConnectionId, stopMediaStreamingRequestInternal); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1075,7 +1003,7 @@ public Response StartMediaStreaming(string callConnectionId, StartMediaStreaming } } - internal HttpMessage CreateStopMediaStreamingRequest(string callConnectionId, StopMediaStreamingRequestInternal stopMediaStreamingRequestInternal) + internal HttpMessage CreateInterruptAudioAndAnnounceRequest(string callConnectionId, InterruptAudioAndAnnounceRequestInternal interruptRequest) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1084,35 +1012,34 @@ internal HttpMessage CreateStopMediaStreamingRequest(string callConnectionId, St uri.Reset(_endpoint); uri.AppendPath("/calling/callConnections/", false); uri.AppendPath(callConnectionId, true); - uri.AppendPath(":stopMediaStreaming", false); + uri.AppendPath(":interruptAudioAndAnnounce", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(stopMediaStreamingRequestInternal); + content.JsonWriter.WriteObjectValue(interruptRequest); request.Content = content; return message; } - /// Stops media streaming in the call. + /// Plays audio to participants in the call. /// The call connection id. - /// stop media streaming request payload. + /// play request payload. /// The cancellation token to use. - /// or is null. - /// Stops media streaming in the call. - public async Task StopMediaStreamingAsync(string callConnectionId, StopMediaStreamingRequestInternal stopMediaStreamingRequestInternal, CancellationToken cancellationToken = default) + /// or is null. + public async Task InterruptAudioAndAnnounceAsync(string callConnectionId, InterruptAudioAndAnnounceRequestInternal interruptRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (stopMediaStreamingRequestInternal == null) + if (interruptRequest == null) { - throw new ArgumentNullException(nameof(stopMediaStreamingRequestInternal)); + throw new ArgumentNullException(nameof(interruptRequest)); } - using var message = CreateStopMediaStreamingRequest(callConnectionId, stopMediaStreamingRequestInternal); + using var message = CreateInterruptAudioAndAnnounceRequest(callConnectionId, interruptRequest); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1123,24 +1050,23 @@ public async Task StopMediaStreamingAsync(string callConnectionId, Sto } } - /// Stops media streaming in the call. + /// Plays audio to participants in the call. /// The call connection id. - /// stop media streaming request payload. + /// play request payload. /// The cancellation token to use. - /// or is null. - /// Stops media streaming in the call. - public Response StopMediaStreaming(string callConnectionId, StopMediaStreamingRequestInternal stopMediaStreamingRequestInternal, CancellationToken cancellationToken = default) + /// or is null. + public Response InterruptAudioAndAnnounce(string callConnectionId, InterruptAudioAndAnnounceRequestInternal interruptRequest, CancellationToken cancellationToken = default) { if (callConnectionId == null) { throw new ArgumentNullException(nameof(callConnectionId)); } - if (stopMediaStreamingRequestInternal == null) + if (interruptRequest == null) { - throw new ArgumentNullException(nameof(stopMediaStreamingRequestInternal)); + throw new ArgumentNullException(nameof(interruptRequest)); } - using var message = CreateStopMediaStreamingRequest(callConnectionId, stopMediaStreamingRequestInternal); + using var message = CreateInterruptAudioAndAnnounceRequest(callConnectionId, interruptRequest); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallRecordingRestClient.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallRecordingRestClient.cs index 63d4716393de..32dca7d0c649 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallRecordingRestClient.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/CallRecordingRestClient.cs @@ -29,7 +29,7 @@ internal partial class CallRecordingRestClient /// The endpoint of the Azure Communication resource. /// Api Version. /// , , or is null. - public CallRecordingRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2023-10-03-preview") + public CallRecordingRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2024-09-01-preview") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -73,6 +73,7 @@ public async Task> StartRecordingAsync(StartCallR switch (message.Response.Status) { case 200: + case 202: { RecordingStateResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -100,6 +101,7 @@ public Response StartRecording(StartCallRecordingRequestIn switch (message.Response.Status) { case 200: + case 202: { RecordingStateResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.Serialization.cs index 35a664dea611..9aa0aa521124 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.Serialization.cs @@ -17,14 +17,29 @@ internal static AddParticipantFailedInternal DeserializeAddParticipantFailedInte { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - CommunicationIdentifierModel participant = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + CommunicationIdentifierModel participant = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -48,29 +63,14 @@ internal static AddParticipantFailedInternal DeserializeAddParticipantFailedInte participant = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } return new AddParticipantFailedInternal( - operationContext, - resultInformation, - participant, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + participant); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.cs index 91b81c265992..9c962c8f909c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantFailedInternal.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - /// The failed to add participant event. + /// The failed to add participants event. internal partial class AddParticipantFailedInternal { /// Initializes a new instance of . @@ -16,33 +16,33 @@ internal AddParticipantFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Participant. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal AddParticipantFailedInternal(string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Participant. + internal AddParticipantFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant) { - OperationContext = operationContext; - ResultInformation = resultInformation; - Participant = participant; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + Participant = participant; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } - /// Participant. - public CommunicationIdentifierModel Participant { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + /// Participant. + public CommunicationIdentifierModel Participant { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs index e5938052601f..a7fda1b5a72a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs @@ -37,16 +37,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } - if (Optional.IsDefined(CustomCallingContext)) - { - writer.WritePropertyName("customCallingContext"u8); - writer.WriteObjectValue(CustomCallingContext); - } if (Optional.IsDefined(OperationCallbackUri)) { writer.WritePropertyName("operationCallbackUri"u8); writer.WriteStringValue(OperationCallbackUri); } + if (Optional.IsDefined(CustomCallingContext)) + { + writer.WritePropertyName("customCallingContext"u8); + writer.WriteObjectValue(CustomCallingContext); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs index 2724da9be020..5e8533df419b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs @@ -37,20 +37,20 @@ public AddParticipantRequestInternal(CommunicationIdentifierModel participantToA /// The maximum value of this is 180 seconds /// /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Used by customer to send custom calling context to targets. /// /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. /// - internal AddParticipantRequestInternal(PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationIdentifierModel participantToAdd, int? invitationTimeoutInSeconds, string operationContext, CustomCallingContextInternal customCallingContext, string operationCallbackUri) + /// Used by customer to send custom calling context to targets. + internal AddParticipantRequestInternal(PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationIdentifierModel participantToAdd, int? invitationTimeoutInSeconds, string operationContext, string operationCallbackUri, CustomCallingContextInternal customCallingContext) { SourceCallerIdNumber = sourceCallerIdNumber; SourceDisplayName = sourceDisplayName; ParticipantToAdd = participantToAdd; InvitationTimeoutInSeconds = invitationTimeoutInSeconds; OperationContext = operationContext; - CustomCallingContext = customCallingContext; OperationCallbackUri = operationCallbackUri; + CustomCallingContext = customCallingContext; } /// @@ -72,12 +72,12 @@ internal AddParticipantRequestInternal(PhoneNumberIdentifierModel sourceCallerId public int? InvitationTimeoutInSeconds { get; set; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; set; } - /// Used by customer to send custom calling context to targets. - public CustomCallingContextInternal CustomCallingContext { get; set; } /// /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. /// public string OperationCallbackUri { get; set; } + /// Used by customer to send custom calling context to targets. + public CustomCallingContextInternal CustomCallingContext { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.Serialization.cs index 6009c35f1067..4b943ceb5e52 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.Serialization.cs @@ -17,14 +17,29 @@ internal static AddParticipantSucceededInternal DeserializeAddParticipantSucceed { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - CommunicationIdentifierModel participant = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + CommunicationIdentifierModel participant = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -48,29 +63,14 @@ internal static AddParticipantSucceededInternal DeserializeAddParticipantSucceed participant = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } return new AddParticipantSucceededInternal( - operationContext, - resultInformation, - participant, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + participant); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.cs index f509b3f9afa5..c7a93c95a41c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantSucceededInternal.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - /// The participant successfully added event. + /// The participants successfully added event. internal partial class AddParticipantSucceededInternal { /// Initializes a new instance of . @@ -16,33 +16,33 @@ internal AddParticipantSucceededInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Participant. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal AddParticipantSucceededInternal(string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Participant. + internal AddParticipantSucceededInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant) { - OperationContext = operationContext; - ResultInformation = resultInformation; - Participant = participant; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + Participant = participant; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } - /// Participant. - public CommunicationIdentifierModel Participant { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + /// Participant. + public CommunicationIdentifierModel Participant { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs index b8c78cf506d5..eedd4d26e2db 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.Serialization.cs @@ -29,16 +29,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } - if (Optional.IsDefined(MediaStreamingConfiguration)) - { - writer.WritePropertyName("mediaStreamingConfiguration"u8); - writer.WriteObjectValue(MediaStreamingConfiguration); - } - if (Optional.IsDefined(TranscriptionConfiguration)) - { - writer.WritePropertyName("transcriptionConfiguration"u8); - writer.WriteObjectValue(TranscriptionConfiguration); - } if (Optional.IsDefined(CallIntelligenceOptions)) { writer.WritePropertyName("callIntelligenceOptions"u8); @@ -49,6 +39,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("answeredBy"u8); writer.WriteObjectValue(AnsweredBy); } + if (Optional.IsDefined(MediaStreamingOptions)) + { + writer.WritePropertyName("mediaStreamingOptions"u8); + writer.WriteObjectValue(MediaStreamingOptions); + } + if (Optional.IsDefined(TranscriptionOptions)) + { + writer.WritePropertyName("transcriptionOptions"u8); + writer.WriteObjectValue(TranscriptionOptions); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs index a9b6afa15903..0b89298c4137 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerCallRequestInternal.cs @@ -30,20 +30,20 @@ public AnswerCallRequestInternal(string incomingCallContext, string callbackUri) /// The callback uri. /// Used by customer to send custom calling context to targets when answering On-Behalf-Of call. /// A customer set value used to track the answering of a call. - /// Media Streaming Configuration. - /// Live Transcription Configuration. /// AI options for the call. /// The identifier of the call automation entity which answers the call. - internal AnswerCallRequestInternal(string incomingCallContext, string callbackUri, CustomCallingContextInternal customCallingContext, string operationContext, MediaStreamingOptionsInternal mediaStreamingConfiguration, TranscriptionOptionsInternal transcriptionConfiguration, CallIntelligenceOptionsInternal callIntelligenceOptions, CommunicationUserIdentifierModel answeredBy) + /// Media Streaming Options. + /// Transcription Options. + internal AnswerCallRequestInternal(string incomingCallContext, string callbackUri, CustomCallingContextInternal customCallingContext, string operationContext, CallIntelligenceOptionsInternal callIntelligenceOptions, CommunicationUserIdentifierModel answeredBy, MediaStreamingOptionsInternal mediaStreamingOptions, TranscriptionOptionsInternal transcriptionOptions) { IncomingCallContext = incomingCallContext; CallbackUri = callbackUri; CustomCallingContext = customCallingContext; OperationContext = operationContext; - MediaStreamingConfiguration = mediaStreamingConfiguration; - TranscriptionConfiguration = transcriptionConfiguration; CallIntelligenceOptions = callIntelligenceOptions; AnsweredBy = answeredBy; + MediaStreamingOptions = mediaStreamingOptions; + TranscriptionOptions = transcriptionOptions; } /// The context associated with the call. @@ -54,13 +54,13 @@ internal AnswerCallRequestInternal(string incomingCallContext, string callbackUr public CustomCallingContextInternal CustomCallingContext { get; set; } /// A customer set value used to track the answering of a call. public string OperationContext { get; set; } - /// Media Streaming Configuration. - public MediaStreamingOptionsInternal MediaStreamingConfiguration { get; set; } - /// Live Transcription Configuration. - public TranscriptionOptionsInternal TranscriptionConfiguration { get; set; } /// AI options for the call. public CallIntelligenceOptionsInternal CallIntelligenceOptions { get; set; } /// The identifier of the call automation entity which answers the call. public CommunicationUserIdentifierModel AnsweredBy { get; set; } + /// Media Streaming Options. + public MediaStreamingOptionsInternal MediaStreamingOptions { get; set; } + /// Transcription Options. + public TranscriptionOptionsInternal TranscriptionOptions { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.Serialization.cs index ed845b420be8..4e4a10a0346b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.Serialization.cs @@ -17,27 +17,13 @@ internal static AnswerFailedInternal DeserializeAnswerFailedInternal(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static AnswerFailedInternal DeserializeAnswerFailedInternal(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new AnswerFailedInternal(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new AnswerFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.cs index 3798b8058546..fb3dd15fa6e0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AnswerFailedInternal.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - /// AnswerFailed event. + /// The failed to answer call event. internal partial class AnswerFailedInternal { /// Initializes a new instance of . @@ -16,29 +16,29 @@ internal AnswerFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal AnswerFailedInternal(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal AnswerFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AudioFormat.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AudioFormat.cs new file mode 100644 index 000000000000..024ee2d792cb --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AudioFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.CallAutomation +{ + /// Specifies the audio format used for encoding, including sample rate and channel type. + public readonly partial struct AudioFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AudioFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Pcm16KMonoValue = "Pcm16KMono"; + private const string Pcm24KMonoValue = "Pcm24KMono"; + + /// Pcm16KMono. + public static AudioFormat Pcm16KMono { get; } = new AudioFormat(Pcm16KMonoValue); + /// Pcm24KMono. + public static AudioFormat Pcm24KMono { get; } = new AudioFormat(Pcm24KMonoValue); + /// Determines if two values are the same. + public static bool operator ==(AudioFormat left, AudioFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AudioFormat left, AudioFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AudioFormat(string value) => new AudioFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AudioFormat other && Equals(other); + /// + public bool Equals(AudioFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.Serialization.cs index 468f7580818d..6b7a1a67ac26 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.Serialization.cs @@ -17,17 +17,13 @@ internal static CallConnected DeserializeCallConnected(JsonElement element) { return null; } - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -43,8 +39,22 @@ internal static CallConnected DeserializeCallConnected(JsonElement element) correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new CallConnected(operationContext, callConnectionId, serverCallId, correlationId); + return new CallConnected(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.cs index 0228c7ab8887..d85f3121dbc0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnected.cs @@ -16,16 +16,18 @@ internal CallConnected() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CallConnected(string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal CallConnected(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs index 7b08a181f575..4846581e7d56 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.Serialization.cs @@ -23,13 +23,15 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper IReadOnlyList targets = default; CallConnectionState? callConnectionState = default; string callbackUri = default; - string mediaSubscriptionId = default; - string dataSubscriptionId = default; PhoneNumberIdentifierModel sourceCallerIdNumber = default; string sourceDisplayName = default; CommunicationIdentifierModel source = default; string correlationId = default; CommunicationUserIdentifierModel answeredBy = default; + string mediaSubscriptionId = default; + string dataSubscriptionId = default; + MediaStreamingSubscriptionInternal mediaStreamingSubscription = default; + TranscriptionSubscriptionInternal transcriptionSubscription = default; PhoneNumberIdentifierModel answeredFor = default; foreach (var property in element.EnumerateObject()) { @@ -71,16 +73,6 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper callbackUri = property.Value.GetString(); continue; } - if (property.NameEquals("mediaSubscriptionId"u8)) - { - mediaSubscriptionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("dataSubscriptionId"u8)) - { - dataSubscriptionId = property.Value.GetString(); - continue; - } if (property.NameEquals("sourceCallerIdNumber"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -118,6 +110,34 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper answeredBy = CommunicationUserIdentifierModel.DeserializeCommunicationUserIdentifierModel(property.Value); continue; } + if (property.NameEquals("mediaSubscriptionId"u8)) + { + mediaSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataSubscriptionId"u8)) + { + dataSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("mediaStreamingSubscription"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mediaStreamingSubscription = MediaStreamingSubscriptionInternal.DeserializeMediaStreamingSubscriptionInternal(property.Value); + continue; + } + if (property.NameEquals("transcriptionSubscription"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transcriptionSubscription = TranscriptionSubscriptionInternal.DeserializeTranscriptionSubscriptionInternal(property.Value); + continue; + } if (property.NameEquals("answeredFor"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -134,13 +154,15 @@ internal static CallConnectionPropertiesInternal DeserializeCallConnectionProper targets ?? new ChangeTrackingList(), callConnectionState, callbackUri, - mediaSubscriptionId, - dataSubscriptionId, sourceCallerIdNumber, sourceDisplayName, source, correlationId, answeredBy, + mediaSubscriptionId, + dataSubscriptionId, + mediaStreamingSubscription, + transcriptionSubscription, answeredFor); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs index ae2711f1f500..4244c2849309 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallConnectionPropertiesInternal.cs @@ -24,8 +24,6 @@ internal CallConnectionPropertiesInternal() /// The targets of the call. /// The state of the call connection. /// The callback URI. - /// SubscriptionId for media streaming. - /// SubscriptionId for transcription. /// /// The source caller Id, a phone number, that's shown to the PSTN participant being invited. /// Required only when calling a PSTN callee. @@ -34,21 +32,27 @@ internal CallConnectionPropertiesInternal() /// Source identity. /// The correlation ID. /// Identity of the answering entity. Only populated when identity is provided in the request. + /// SubscriptionId for media streaming. + /// SubscriptionId for transcription. + /// The state of media streaming subscription for the call. + /// Transcription Subscription. /// Identity of the original Pstn target of an incoming Call. Only populated when the original target is a Pstn number. - internal CallConnectionPropertiesInternal(string callConnectionId, string serverCallId, IReadOnlyList targets, CallConnectionState? callConnectionState, string callbackUri, string mediaSubscriptionId, string dataSubscriptionId, PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationIdentifierModel source, string correlationId, CommunicationUserIdentifierModel answeredBy, PhoneNumberIdentifierModel answeredFor) + internal CallConnectionPropertiesInternal(string callConnectionId, string serverCallId, IReadOnlyList targets, CallConnectionState? callConnectionState, string callbackUri, PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationIdentifierModel source, string correlationId, CommunicationUserIdentifierModel answeredBy, string mediaSubscriptionId, string dataSubscriptionId, MediaStreamingSubscriptionInternal mediaStreamingSubscription, TranscriptionSubscriptionInternal transcriptionSubscription, PhoneNumberIdentifierModel answeredFor) { CallConnectionId = callConnectionId; ServerCallId = serverCallId; Targets = targets; CallConnectionState = callConnectionState; CallbackUri = callbackUri; - MediaSubscriptionId = mediaSubscriptionId; - DataSubscriptionId = dataSubscriptionId; SourceCallerIdNumber = sourceCallerIdNumber; SourceDisplayName = sourceDisplayName; Source = source; CorrelationId = correlationId; AnsweredBy = answeredBy; + MediaSubscriptionId = mediaSubscriptionId; + DataSubscriptionId = dataSubscriptionId; + MediaStreamingSubscription = mediaStreamingSubscription; + TranscriptionSubscription = transcriptionSubscription; AnsweredFor = answeredFor; } @@ -62,10 +66,6 @@ internal CallConnectionPropertiesInternal(string callConnectionId, string server public CallConnectionState? CallConnectionState { get; } /// The callback URI. public string CallbackUri { get; } - /// SubscriptionId for media streaming. - public string MediaSubscriptionId { get; } - /// SubscriptionId for transcription. - public string DataSubscriptionId { get; } /// /// The source caller Id, a phone number, that's shown to the PSTN participant being invited. /// Required only when calling a PSTN callee. @@ -79,6 +79,14 @@ internal CallConnectionPropertiesInternal(string callConnectionId, string server public string CorrelationId { get; } /// Identity of the answering entity. Only populated when identity is provided in the request. public CommunicationUserIdentifierModel AnsweredBy { get; } + /// SubscriptionId for media streaming. + public string MediaSubscriptionId { get; } + /// SubscriptionId for transcription. + public string DataSubscriptionId { get; } + /// The state of media streaming subscription for the call. + public MediaStreamingSubscriptionInternal MediaStreamingSubscription { get; } + /// Transcription Subscription. + public TranscriptionSubscriptionInternal TranscriptionSubscription { get; } /// Identity of the original Pstn target of an incoming Call. Only populated when the original target is a Pstn number. public PhoneNumberIdentifierModel AnsweredFor { get; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.Serialization.cs index f79b61d8a974..ae5e75f98eeb 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.Serialization.cs @@ -17,17 +17,13 @@ internal static CallDisconnected DeserializeCallDisconnected(JsonElement element { return null; } - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -43,8 +39,22 @@ internal static CallDisconnected DeserializeCallDisconnected(JsonElement element correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new CallDisconnected(operationContext, callConnectionId, serverCallId, correlationId); + return new CallDisconnected(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.cs index 9caf9c928e95..3b655b623a25 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallDisconnected.cs @@ -16,16 +16,18 @@ internal CallDisconnected() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CallDisconnected(string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal CallDisconnected(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.Serialization.cs index bacfdd77a7fb..ecf883327bd1 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.Serialization.cs @@ -25,6 +25,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("serverCallId"u8); writer.WriteStringValue(ServerCallId); } + if (Optional.IsDefined(RoomId)) + { + writer.WritePropertyName("roomId"u8); + writer.WriteStringValue(RoomId); + } if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.cs index e9d748add63d..652c7e5263a7 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorInternal.cs @@ -18,11 +18,13 @@ public CallLocatorInternal() /// Initializes a new instance of . /// The group call id. /// The server call id. + /// The Acs room id. /// The call locator kind. - internal CallLocatorInternal(string groupCallId, string serverCallId, CallLocatorKindInternal? kind) + internal CallLocatorInternal(string groupCallId, string serverCallId, string roomId, CallLocatorKindInternal? kind) { GroupCallId = groupCallId; ServerCallId = serverCallId; + RoomId = roomId; Kind = kind; } @@ -30,6 +32,8 @@ internal CallLocatorInternal(string groupCallId, string serverCallId, CallLocato public string GroupCallId { get; set; } /// The server call id. public string ServerCallId { get; set; } + /// The Acs room id. + public string RoomId { get; set; } /// The call locator kind. public CallLocatorKindInternal? Kind { get; set; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorKindInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorKindInternal.cs index aa3aa0a2d26b..7edbdb32cd29 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorKindInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallLocatorKindInternal.cs @@ -22,13 +22,19 @@ public CallLocatorKindInternal(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } + private const string UnknownValue = "unknown"; private const string GroupCallLocatorValue = "groupCallLocator"; private const string ServerCallLocatorValue = "serverCallLocator"; + private const string RoomCallLocatorValue = "roomCallLocator"; + /// unknown. + public static CallLocatorKindInternal Unknown { get; } = new CallLocatorKindInternal(UnknownValue); /// groupCallLocator. public static CallLocatorKindInternal GroupCallLocator { get; } = new CallLocatorKindInternal(GroupCallLocatorValue); /// serverCallLocator. public static CallLocatorKindInternal ServerCallLocator { get; } = new CallLocatorKindInternal(ServerCallLocatorValue); + /// roomCallLocator. + public static CallLocatorKindInternal RoomCallLocator { get; } = new CallLocatorKindInternal(RoomCallLocatorValue); /// Determines if two values are the same. public static bool operator ==(CallLocatorKindInternal left, CallLocatorKindInternal right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.Serialization.cs index f1c56fab4859..d540b6034561 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.Serialization.cs @@ -17,15 +17,30 @@ internal static CallTransferAcceptedInternal DeserializeCallTransferAcceptedInte { return null; } + string callConnectionId = default; + string serverCallId = default; + string correlationId = default; string operationContext = default; ResultInformation resultInformation = default; CommunicationIdentifierModel transferTarget = default; CommunicationIdentifierModel transferee = default; - string callConnectionId = default; - string serverCallId = default; - string correlationId = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -58,30 +73,15 @@ internal static CallTransferAcceptedInternal DeserializeCallTransferAcceptedInte transferee = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } return new CallTransferAcceptedInternal( + callConnectionId, + serverCallId, + correlationId, operationContext, resultInformation, transferTarget, - transferee, - callConnectionId, - serverCallId, - correlationId); + transferee); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.cs index c416861e7fee..c4b01a539f58 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferAcceptedInternal.cs @@ -16,24 +16,30 @@ internal CallTransferAcceptedInternal() } /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Contains the resulting SIP code, sub-code and message. /// Target who the call is transferred to. /// the participant who is being transferred away. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CallTransferAcceptedInternal(string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel transferTarget, CommunicationIdentifierModel transferee, string callConnectionId, string serverCallId, string correlationId) + internal CallTransferAcceptedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel transferTarget, CommunicationIdentifierModel transferee) { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; OperationContext = operationContext; ResultInformation = resultInformation; TransferTarget = transferTarget; Transferee = transferee; - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; } + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; } /// Contains the resulting SIP code, sub-code and message. @@ -42,11 +48,5 @@ internal CallTransferAcceptedInternal(string operationContext, ResultInformation public CommunicationIdentifierModel TransferTarget { get; } /// the participant who is being transferred away. public CommunicationIdentifierModel Transferee { get; } - /// Call connection ID. - public string CallConnectionId { get; } - /// Server call ID. - public string ServerCallId { get; } - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - public string CorrelationId { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.Serialization.cs index fc5b28081751..c9ea46a9502b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.Serialization.cs @@ -17,27 +17,13 @@ internal static CallTransferFailed DeserializeCallTransferFailed(JsonElement ele { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static CallTransferFailed DeserializeCallTransferFailed(JsonElement ele correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new CallTransferFailed(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new CallTransferFailed(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.cs index b1e9cd0e6925..9be70147b26f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CallTransferFailed.cs @@ -16,18 +16,18 @@ internal CallTransferFailed() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CallTransferFailed(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal CallTransferFailed(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.Serialization.cs index c2118ff8c0a4..d17f70f6a067 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.Serialization.cs @@ -17,14 +17,29 @@ internal static CancelAddParticipantFailedInternal DeserializeCancelAddParticipa { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - string invitationId = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + string invitationId = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -44,29 +59,14 @@ internal static CancelAddParticipantFailedInternal DeserializeCancelAddParticipa invitationId = property.Value.GetString(); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } return new CancelAddParticipantFailedInternal( - operationContext, - resultInformation, - invitationId, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + invitationId); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.cs index 439c9cd43923..f56046f0c63d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantFailedInternal.cs @@ -16,33 +16,33 @@ internal CancelAddParticipantFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Invitation ID used to cancel the request. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CancelAddParticipantFailedInternal(string operationContext, ResultInformation resultInformation, string invitationId, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Invitation ID used to cancel the request. + internal CancelAddParticipantFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, string invitationId) { - OperationContext = operationContext; - ResultInformation = resultInformation; - InvitationId = invitationId; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + InvitationId = invitationId; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } - /// Invitation ID used to cancel the request. - public string InvitationId { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + /// Invitation ID used to cancel the request. + public string InvitationId { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.Serialization.cs index e2aeffccc363..9e234c3bc0a4 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.Serialization.cs @@ -17,56 +17,56 @@ internal static CancelAddParticipantSucceededInternal DeserializeCancelAddPartic { return null; } - string invitationId = default; - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + string invitationId = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("invitationId"u8)) + if (property.NameEquals("callConnectionId"u8)) { - invitationId = property.Value.GetString(); + callConnectionId = property.Value.GetString(); continue; } - if (property.NameEquals("operationContext"u8)) + if (property.NameEquals("serverCallId"u8)) { - operationContext = property.Value.GetString(); + serverCallId = property.Value.GetString(); continue; } - if (property.NameEquals("resultInformation"u8)) + if (property.NameEquals("correlationId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + correlationId = property.Value.GetString(); continue; } - if (property.NameEquals("callConnectionId"u8)) + if (property.NameEquals("operationContext"u8)) { - callConnectionId = property.Value.GetString(); + operationContext = property.Value.GetString(); continue; } - if (property.NameEquals("serverCallId"u8)) + if (property.NameEquals("invitationId"u8)) { - serverCallId = property.Value.GetString(); + invitationId = property.Value.GetString(); continue; } - if (property.NameEquals("correlationId"u8)) + if (property.NameEquals("resultInformation"u8)) { - correlationId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); continue; } } return new CancelAddParticipantSucceededInternal( - invitationId, - operationContext, - resultInformation, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + invitationId, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.cs index 0842de354662..cb033f6ae3cc 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CancelAddParticipantSucceededInternal.cs @@ -16,33 +16,33 @@ internal CancelAddParticipantSucceededInternal() } /// Initializes a new instance of . - /// Invitation ID used to cancel the request. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CancelAddParticipantSucceededInternal(string invitationId, string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Invitation ID used to cancel the request. + /// Contains the resulting SIP code, sub-code and message. + internal CancelAddParticipantSucceededInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, string invitationId, ResultInformation resultInformation) { - InvitationId = invitationId; - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + InvitationId = invitationId; + ResultInformation = resultInformation; } - /// Invitation ID used to cancel the request. - public string InvitationId { get; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Gets the result information. - public ResultInformation ResultInformation { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Invitation ID used to cancel the request. + public string InvitationId { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CollectTonesResult.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CollectTonesResult.Serialization.cs deleted file mode 100644 index cd923ce53c1b..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CollectTonesResult.Serialization.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 System.Text.Json; - -namespace Azure.Communication.CallAutomation -{ - public partial class CollectTonesResult - { - internal static CollectTonesResult DeserializeCollectTonesResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList tones = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tones"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new DtmfTone(item.GetString())); - } - tones = array; - continue; - } - } - return new CollectTonesResult(tones ?? new ChangeTrackingList()); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static CollectTonesResult FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeCollectTonesResult(document.RootElement); - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CollectTonesResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CollectTonesResult.cs deleted file mode 100644 index a8a30d875376..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CollectTonesResult.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; - -namespace Azure.Communication.CallAutomation -{ - /// The CollectTonesResult. - public partial class CollectTonesResult - { - /// Initializes a new instance of . - internal CollectTonesResult() - { - Tones = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// - internal CollectTonesResult(IReadOnlyList tones) - { - Tones = tones; - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompleted.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectFailed.Serialization.cs similarity index 85% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompleted.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectFailed.Serialization.cs index ac17c8928d48..71b998354e62 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompleted.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectFailed.Serialization.cs @@ -9,35 +9,21 @@ namespace Azure.Communication.CallAutomation { - public partial class PlayCompleted + public partial class ConnectFailed { - internal static PlayCompleted DeserializePlayCompleted(JsonElement element) + internal static ConnectFailed DeserializeConnectFailed(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - ResultInformation resultInformation = default; - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,16 +39,30 @@ internal static PlayCompleted DeserializePlayCompleted(JsonElement element) correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new PlayCompleted(resultInformation, operationContext, callConnectionId, serverCallId, correlationId); + return new ConnectFailed(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static PlayCompleted FromResponse(Response response) + internal static ConnectFailed FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializePlayCompleted(document.RootElement); + return DeserializeConnectFailed(document.RootElement); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectFailed.cs new file mode 100644 index 000000000000..82dc1462fe5f --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectFailed.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The ConnectFailed event. + public partial class ConnectFailed + { + /// Initializes a new instance of . + internal ConnectFailed() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal ConnectFailed(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectRequestInternal.Serialization.cs similarity index 52% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectRequestInternal.Serialization.cs index abfced792412..7cb650920ebf 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectRequestInternal.Serialization.cs @@ -10,27 +10,34 @@ namespace Azure.Communication.CallAutomation { - internal partial class StartHoldMusicRequestInternal : IUtf8JsonSerializable + internal partial class ConnectRequestInternal : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("targetParticipant"u8); - writer.WriteObjectValue(TargetParticipant); - if (Optional.IsDefined(PlaySourceInfo)) - { - writer.WritePropertyName("playSourceInfo"u8); - writer.WriteObjectValue(PlaySourceInfo); - } + writer.WritePropertyName("callLocator"u8); + writer.WriteObjectValue(CallLocator); + writer.WritePropertyName("callbackUri"u8); + writer.WriteStringValue(CallbackUri); if (Optional.IsDefined(OperationContext)) { writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } - if (Optional.IsDefined(OperationCallbackUri)) + if (Optional.IsDefined(CallIntelligenceOptions)) + { + writer.WritePropertyName("callIntelligenceOptions"u8); + writer.WriteObjectValue(CallIntelligenceOptions); + } + if (Optional.IsDefined(MediaStreamingOptions)) + { + writer.WritePropertyName("mediaStreamingOptions"u8); + writer.WriteObjectValue(MediaStreamingOptions); + } + if (Optional.IsDefined(TranscriptionOptions)) { - writer.WritePropertyName("operationCallbackUri"u8); - writer.WriteStringValue(OperationCallbackUri); + writer.WritePropertyName("transcriptionOptions"u8); + writer.WriteObjectValue(TranscriptionOptions); } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectRequestInternal.cs new file mode 100644 index 000000000000..3692047ce8d5 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ConnectRequestInternal.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Communication.CallAutomation +{ + /// The request payload for creating a connection to a CallLocator. + internal partial class ConnectRequestInternal + { + /// Initializes a new instance of . + /// The call locator. + /// The callback URI. + /// or is null. + public ConnectRequestInternal(CallLocatorInternal callLocator, string callbackUri) + { + Argument.AssertNotNull(callLocator, nameof(callLocator)); + Argument.AssertNotNull(callbackUri, nameof(callbackUri)); + + CallLocator = callLocator; + CallbackUri = callbackUri; + } + + /// Initializes a new instance of . + /// The call locator. + /// The callback URI. + /// Used by customers to correlate the request to the response event. + /// AI options for the call. + /// Media Streaming Options. + /// Transcription Options. + internal ConnectRequestInternal(CallLocatorInternal callLocator, string callbackUri, string operationContext, CallIntelligenceOptionsInternal callIntelligenceOptions, MediaStreamingOptionsInternal mediaStreamingOptions, TranscriptionOptionsInternal transcriptionOptions) + { + CallLocator = callLocator; + CallbackUri = callbackUri; + OperationContext = operationContext; + CallIntelligenceOptions = callIntelligenceOptions; + MediaStreamingOptions = mediaStreamingOptions; + TranscriptionOptions = transcriptionOptions; + } + + /// The call locator. + public CallLocatorInternal CallLocator { get; } + /// The callback URI. + public string CallbackUri { get; } + /// Used by customers to correlate the request to the response event. + public string OperationContext { get; set; } + /// AI options for the call. + public CallIntelligenceOptionsInternal CallIntelligenceOptions { get; set; } + /// Media Streaming Options. + public MediaStreamingOptionsInternal MediaStreamingOptions { get; set; } + /// Transcription Options. + public TranscriptionOptionsInternal TranscriptionOptions { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.Serialization.cs index 10a0595e9d7b..7730cd689d27 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.Serialization.cs @@ -17,27 +17,13 @@ internal static ContinuousDtmfRecognitionStopped DeserializeContinuousDtmfRecogn { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static ContinuousDtmfRecognitionStopped DeserializeContinuousDtmfRecogn correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new ContinuousDtmfRecognitionStopped(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new ContinuousDtmfRecognitionStopped(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.cs index 7fffac46ddc8..41c76f74a944 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionStopped.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - /// Call connection ID. + /// The ContinuousDtmfRecognitionStopped. public partial class ContinuousDtmfRecognitionStopped { /// Initializes a new instance of . @@ -16,18 +16,18 @@ internal ContinuousDtmfRecognitionStopped() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal ContinuousDtmfRecognitionStopped(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal ContinuousDtmfRecognitionStopped(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.Serialization.cs index edec4a4a7f6c..b301ece871f0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.Serialization.cs @@ -17,27 +17,13 @@ internal static ContinuousDtmfRecognitionToneFailed DeserializeContinuousDtmfRec { return null; } - ResultInformation resultInformation = default; - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + ResultInformation resultInformation = default; + string operationContext = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static ContinuousDtmfRecognitionToneFailed DeserializeContinuousDtmfRec correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } } - return new ContinuousDtmfRecognitionToneFailed(resultInformation, operationContext, callConnectionId, serverCallId, correlationId); + return new ContinuousDtmfRecognitionToneFailed(callConnectionId, serverCallId, correlationId, resultInformation, operationContext); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.cs index 373e57e5eb8a..7df347401b88 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneFailed.cs @@ -16,18 +16,18 @@ internal ContinuousDtmfRecognitionToneFailed() } /// Initializes a new instance of . - /// Result information defines the code, subcode and message. - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal ContinuousDtmfRecognitionToneFailed(ResultInformation resultInformation, string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// Contains the resulting SIP code, sub-code and message. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + internal ContinuousDtmfRecognitionToneFailed(string callConnectionId, string serverCallId, string correlationId, ResultInformation resultInformation, string operationContext) { - ResultInformation = resultInformation; - OperationContext = operationContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + ResultInformation = resultInformation; + OperationContext = operationContext; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.Serialization.cs index 80a8c099081e..64ffcf4b1e03 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.Serialization.cs @@ -17,24 +17,15 @@ internal static ContinuousDtmfRecognitionToneReceived DeserializeContinuousDtmfR { return null; } - ResultInformation resultInformation = default; int? sequenceId = default; DtmfTone? tone = default; - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("sequenceId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -53,11 +44,6 @@ internal static ContinuousDtmfRecognitionToneReceived DeserializeContinuousDtmfR tone = new DtmfTone(property.Value.GetString()); continue; } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -73,15 +59,29 @@ internal static ContinuousDtmfRecognitionToneReceived DeserializeContinuousDtmfR correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new ContinuousDtmfRecognitionToneReceived( - resultInformation, sequenceId, tone, - operationContext, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.cs index 235162b194b1..37337deb1ecf 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ContinuousDtmfRecognitionToneReceived.cs @@ -16,23 +16,24 @@ internal ContinuousDtmfRecognitionToneReceived() } /// Initializes a new instance of . - /// Result information defines the code, subcode and message. /// The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. /// - /// /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal ContinuousDtmfRecognitionToneReceived(ResultInformation resultInformation, int? sequenceId, DtmfTone? tone, string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal ContinuousDtmfRecognitionToneReceived(int? sequenceId, DtmfTone? tone, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - ResultInformation = resultInformation; SequenceId = sequenceId; Tone = tone; - OperationContext = operationContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } + /// The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. public int? SequenceId { get; } /// Gets the tone. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.Serialization.cs index 5296def00ba3..e626cbd91283 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.Serialization.cs @@ -17,27 +17,13 @@ internal static CreateCallFailedInternal DeserializeCreateCallFailedInternal(Jso { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static CreateCallFailedInternal DeserializeCreateCallFailedInternal(Jso correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new CreateCallFailedInternal(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new CreateCallFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.cs index 506c8ca5891e..00ea356ff7ed 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallFailedInternal.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - /// The CreateCallFailed event. + /// The create call failed event. internal partial class CreateCallFailedInternal { /// Initializes a new instance of . @@ -16,29 +16,29 @@ internal CreateCallFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal CreateCallFailedInternal(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal CreateCallFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs index 797fb28b64d4..d5f46c3470af 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.Serialization.cs @@ -37,11 +37,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("source"u8); writer.WriteObjectValue(Source); } - if (Optional.IsDefined(OpsSource)) - { - writer.WritePropertyName("opsSource"u8); - writer.WriteObjectValue(OpsSource); - } if (Optional.IsDefined(OperationContext)) { writer.WritePropertyName("operationContext"u8); @@ -49,26 +44,31 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("callbackUri"u8); writer.WriteStringValue(CallbackUri); - if (Optional.IsDefined(MediaStreamingConfiguration)) - { - writer.WritePropertyName("mediaStreamingConfiguration"u8); - writer.WriteObjectValue(MediaStreamingConfiguration); - } - if (Optional.IsDefined(TranscriptionConfiguration)) - { - writer.WritePropertyName("transcriptionConfiguration"u8); - writer.WriteObjectValue(TranscriptionConfiguration); - } if (Optional.IsDefined(CallIntelligenceOptions)) { writer.WritePropertyName("callIntelligenceOptions"u8); writer.WriteObjectValue(CallIntelligenceOptions); } + if (Optional.IsDefined(TeamsAppSource)) + { + writer.WritePropertyName("teamsAppSource"u8); + writer.WriteObjectValue(TeamsAppSource); + } if (Optional.IsDefined(CustomCallingContext)) { writer.WritePropertyName("customCallingContext"u8); writer.WriteObjectValue(CustomCallingContext); } + if (Optional.IsDefined(MediaStreamingOptions)) + { + writer.WritePropertyName("mediaStreamingOptions"u8); + writer.WriteObjectValue(MediaStreamingOptions); + } + if (Optional.IsDefined(TranscriptionOptions)) + { + writer.WritePropertyName("transcriptionOptions"u8); + writer.WriteObjectValue(TranscriptionOptions); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs index 433e67d20bf5..f3008edc7e40 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CreateCallRequestInternal.cs @@ -35,26 +35,26 @@ public CreateCallRequestInternal(IEnumerable targe /// /// Display name of the call if dialing out to a pstn number. /// The identifier of the source of the call. - /// The identifier of the source in an OPS call. /// A customer set value used to track the answering of a call. /// The callback URI. - /// Media Streaming Configuration. - /// Live Transcription Configuration. /// AI options for the call. + /// The identifier of the source for creating call with Teams resource account ID. /// Used by customer to send custom calling context to targets. - internal CreateCallRequestInternal(IList targets, PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationUserIdentifierModel source, MicrosoftTeamsAppIdentifierModel opsSource, string operationContext, string callbackUri, MediaStreamingOptionsInternal mediaStreamingConfiguration, TranscriptionOptionsInternal transcriptionConfiguration, CallIntelligenceOptionsInternal callIntelligenceOptions, CustomCallingContextInternal customCallingContext) + /// Media Streaming Options. + /// Transcription Options. + internal CreateCallRequestInternal(IList targets, PhoneNumberIdentifierModel sourceCallerIdNumber, string sourceDisplayName, CommunicationUserIdentifierModel source, string operationContext, string callbackUri, CallIntelligenceOptionsInternal callIntelligenceOptions, MicrosoftTeamsAppIdentifierModel teamsAppSource, CustomCallingContextInternal customCallingContext, MediaStreamingOptionsInternal mediaStreamingOptions, TranscriptionOptionsInternal transcriptionOptions) { Targets = targets; SourceCallerIdNumber = sourceCallerIdNumber; SourceDisplayName = sourceDisplayName; Source = source; - OpsSource = opsSource; OperationContext = operationContext; CallbackUri = callbackUri; - MediaStreamingConfiguration = mediaStreamingConfiguration; - TranscriptionConfiguration = transcriptionConfiguration; CallIntelligenceOptions = callIntelligenceOptions; + TeamsAppSource = teamsAppSource; CustomCallingContext = customCallingContext; + MediaStreamingOptions = mediaStreamingOptions; + TranscriptionOptions = transcriptionOptions; } /// The targets of the call. @@ -68,19 +68,19 @@ internal CreateCallRequestInternal(IList targets, public string SourceDisplayName { get; set; } /// The identifier of the source of the call. public CommunicationUserIdentifierModel Source { get; set; } - /// The identifier of the source in an OPS call. - public MicrosoftTeamsAppIdentifierModel OpsSource { get; set; } /// A customer set value used to track the answering of a call. public string OperationContext { get; set; } /// The callback URI. public string CallbackUri { get; } - /// Media Streaming Configuration. - public MediaStreamingOptionsInternal MediaStreamingConfiguration { get; set; } - /// Live Transcription Configuration. - public TranscriptionOptionsInternal TranscriptionConfiguration { get; set; } /// AI options for the call. public CallIntelligenceOptionsInternal CallIntelligenceOptions { get; set; } + /// The identifier of the source for creating call with Teams resource account ID. + public MicrosoftTeamsAppIdentifierModel TeamsAppSource { get; set; } /// Used by customer to send custom calling context to targets. public CustomCallingContextInternal CustomCallingContext { get; set; } + /// Media Streaming Options. + public MediaStreamingOptionsInternal MediaStreamingOptions { get; set; } + /// Transcription Options. + public TranscriptionOptionsInternal TranscriptionOptions { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.Serialization.cs index 0031ba9f3b7a..ec8cd88b3972 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.Serialization.cs @@ -5,6 +5,7 @@ #nullable disable +using System.Collections.Generic; using System.Text.Json; using Azure.Core; @@ -40,6 +41,56 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndObject(); } + internal static CustomCallingContextInternal DeserializeCustomCallingContextInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary voipHeaders = default; + IDictionary sipHeaders = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("voipHeaders"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()); + } + voipHeaders = dictionary; + continue; + } + if (property.NameEquals("sipHeaders"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()); + } + sipHeaders = dictionary; + continue; + } + } + return new CustomCallingContextInternal(voipHeaders ?? new ChangeTrackingDictionary(), sipHeaders ?? new ChangeTrackingDictionary()); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CustomCallingContextInternal FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomCallingContextInternal(document.RootElement); + } + /// Convert into a . internal virtual RequestContent ToRequestContent() { diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.cs index a5ca28c30988..9f7727dddbd1 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/CustomCallingContextInternal.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallAutomation { - /// The CustomCallingContext. + /// The custom calling context which will be sent to the target. internal partial class CustomCallingContextInternal { /// Initializes a new instance of . @@ -19,9 +19,9 @@ public CustomCallingContextInternal() SipHeaders = new ChangeTrackingDictionary(); } - /// Dictionary of <string>. + /// Custom calling context VoiP headers. public IDictionary VoipHeaders { get; } - /// Dictionary of <string>. + /// Custom calling context SIP headers. public IDictionary SipHeaders { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.Serialization.cs index 2aaca86f2123..89a0a187e7ed 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.Serialization.cs @@ -17,29 +17,15 @@ internal static DialogCompletedInternal DeserializeDialogCompletedInternal(JsonE { return null; } - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -69,15 +55,29 @@ internal static DialogCompletedInternal DeserializeDialogCompletedInternal(JsonE correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogCompletedInternal( - operationContext, - resultInformation, dialogInputType, dialogId, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.cs index ceebb63cbf27..5414d3eea1d7 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogCompletedInternal.cs @@ -16,28 +16,24 @@ internal DialogCompletedInternal() } /// Initializes a new instance of . - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogCompletedInternal(string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogCompletedInternal(DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. @@ -48,5 +44,9 @@ internal DialogCompletedInternal(string operationContext, ResultInformation resu public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.Serialization.cs index 67fe255cc684..f3f830aa122c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.Serialization.cs @@ -17,46 +17,32 @@ internal static DialogConsentInternal DeserializeDialogConsentInternal(JsonEleme { return null; } - UserConsent userConsent = default; - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; + UserConsent userConsent = default; string dialogId = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("userConsent"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - userConsent = UserConsent.DeserializeUserConsent(property.Value); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) + if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + dialogInputType = new DialogInputType(property.Value.GetString()); continue; } - if (property.NameEquals("dialogInputType"u8)) + if (property.NameEquals("userConsent"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - dialogInputType = new DialogInputType(property.Value.GetString()); + userConsent = UserConsent.DeserializeUserConsent(property.Value); continue; } if (property.NameEquals("dialogId"u8)) @@ -79,16 +65,30 @@ internal static DialogConsentInternal DeserializeDialogConsentInternal(JsonEleme correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogConsentInternal( - userConsent, - operationContext, - resultInformation, dialogInputType, + userConsent, dialogId, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.cs index 3c075ab47503..37dee25016f5 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogConsentInternal.cs @@ -16,34 +16,30 @@ internal DialogConsentInternal() } /// Initializes a new instance of . - /// UserConsent data from the Conversation Conductor. - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. + /// UserConsent data from the Conversation Conductor. /// Dialog ID. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogConsentInternal(UserConsent userConsent, string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogConsentInternal(DialogInputType? dialogInputType, UserConsent userConsent, string dialogId, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - UserConsent = userConsent; - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; + UserConsent = userConsent; DialogId = dialogId; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// UserConsent data from the Conversation Conductor. - public UserConsent UserConsent { get; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } + /// UserConsent data from the Conversation Conductor. + public UserConsent UserConsent { get; } /// Dialog ID. public string DialogId { get; } /// Call connection ID. @@ -52,5 +48,9 @@ internal DialogConsentInternal(UserConsent userConsent, string operationContext, public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.Serialization.cs index 718a892c26b8..42fb5887b192 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.Serialization.cs @@ -17,29 +17,15 @@ internal static DialogFailedInternal DeserializeDialogFailedInternal(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -69,15 +55,29 @@ internal static DialogFailedInternal DeserializeDialogFailedInternal(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogFailedInternal( - operationContext, - resultInformation, dialogInputType, dialogId, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.cs index 1a1fef55fdaf..b442788c4587 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogFailedInternal.cs @@ -16,28 +16,24 @@ internal DialogFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogFailedInternal(string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogFailedInternal(DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. @@ -48,5 +44,9 @@ internal DialogFailedInternal(string operationContext, ResultInformation resultI public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.Serialization.cs index 5c810932a84b..61f3c6ac3c73 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.Serialization.cs @@ -17,30 +17,16 @@ internal static DialogHangupInternal DeserializeDialogHangupInternal(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; object ivrContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -79,16 +65,30 @@ internal static DialogHangupInternal DeserializeDialogHangupInternal(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogHangupInternal( - operationContext, - resultInformation, dialogInputType, dialogId, ivrContext, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.cs index caacfa9b9e95..c214ada07bf6 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogHangupInternal.cs @@ -16,30 +16,26 @@ internal DialogHangupInternal() } /// Initializes a new instance of . - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. /// Ivr Context. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogHangupInternal(string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, object ivrContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogHangupInternal(DialogInputType? dialogInputType, string dialogId, object ivrContext, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; IvrContext = ivrContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. @@ -52,5 +48,9 @@ internal DialogHangupInternal(string operationContext, ResultInformation resultI public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.Serialization.cs index b06fc7a80d6c..6d6f1bb54379 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.Serialization.cs @@ -17,36 +17,17 @@ internal static DialogLanguageChangeInternal DeserializeDialogLanguageChangeInte { return null; } - string selectedLanguage = default; - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; + string selectedLanguage = default; object ivrContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("selectedLanguage"u8)) - { - selectedLanguage = property.Value.GetString(); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -61,6 +42,11 @@ internal static DialogLanguageChangeInternal DeserializeDialogLanguageChangeInte dialogId = property.Value.GetString(); continue; } + if (property.NameEquals("selectedLanguage"u8)) + { + selectedLanguage = property.Value.GetString(); + continue; + } if (property.NameEquals("ivrContext"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -85,17 +71,31 @@ internal static DialogLanguageChangeInternal DeserializeDialogLanguageChangeInte correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogLanguageChangeInternal( - selectedLanguage, - operationContext, - resultInformation, dialogInputType, dialogId, + selectedLanguage, ivrContext, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.cs index 9ce79f2d489f..c4c245d4c472 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogLanguageChangeInternal.cs @@ -16,38 +16,34 @@ internal DialogLanguageChangeInternal() } /// Initializes a new instance of . - /// Selected Language. - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. + /// Selected Language. /// Ivr Context. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogLanguageChangeInternal(string selectedLanguage, string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, object ivrContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogLanguageChangeInternal(DialogInputType? dialogInputType, string dialogId, string selectedLanguage, object ivrContext, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - SelectedLanguage = selectedLanguage; - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; + SelectedLanguage = selectedLanguage; IvrContext = ivrContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Selected Language. - public string SelectedLanguage { get; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. public string DialogId { get; } + /// Selected Language. + public string SelectedLanguage { get; } /// Ivr Context. public object IvrContext { get; } /// Call connection ID. @@ -56,5 +52,9 @@ internal DialogLanguageChangeInternal(string selectedLanguage, string operationC public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs index b2a77fd4fae4..55e4b20229ca 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.Serialization.cs @@ -17,51 +17,37 @@ internal static DialogSensitivityUpdateInternal DeserializeDialogSensitivityUpda { return null; } - bool? sensitiveMask = default; - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; + bool? sensitiveMask = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sensitiveMask"u8)) + if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - sensitiveMask = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); + dialogInputType = new DialogInputType(property.Value.GetString()); continue; } - if (property.NameEquals("resultInformation"u8)) + if (property.NameEquals("dialogId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + dialogId = property.Value.GetString(); continue; } - if (property.NameEquals("dialogInputType"u8)) + if (property.NameEquals("sensitiveMask"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - dialogInputType = new DialogInputType(property.Value.GetString()); - continue; - } - if (property.NameEquals("dialogId"u8)) - { - dialogId = property.Value.GetString(); + sensitiveMask = property.Value.GetBoolean(); continue; } if (property.NameEquals("callConnectionId"u8)) @@ -79,16 +65,30 @@ internal static DialogSensitivityUpdateInternal DeserializeDialogSensitivityUpda correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogSensitivityUpdateInternal( - sensitiveMask, - operationContext, - resultInformation, dialogInputType, dialogId, + sensitiveMask, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs index 7945f7da465a..c53ec140a30d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogSensitivityUpdateInternal.cs @@ -16,41 +16,41 @@ internal DialogSensitivityUpdateInternal() } /// Initializes a new instance of . - /// SensitiveMask. - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. + /// SensitiveMask. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogSensitivityUpdateInternal(bool? sensitiveMask, string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogSensitivityUpdateInternal(DialogInputType? dialogInputType, string dialogId, bool? sensitiveMask, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - SensitiveMask = sensitiveMask; - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; + SensitiveMask = sensitiveMask; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// SensitiveMask. - public bool? SensitiveMask { get; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. public string DialogId { get; } + /// SensitiveMask. + public bool? SensitiveMask { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.Serialization.cs index 406b22ebc90c..8150001a59f4 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.Serialization.cs @@ -17,29 +17,15 @@ internal static DialogStartedInternal DeserializeDialogStartedInternal(JsonEleme { return null; } - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -69,15 +55,29 @@ internal static DialogStartedInternal DeserializeDialogStartedInternal(JsonEleme correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogStartedInternal( - operationContext, - resultInformation, dialogInputType, dialogId, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.cs index 99c2e505fbc4..43e1e9f53b72 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogStartedInternal.cs @@ -16,28 +16,24 @@ internal DialogStartedInternal() } /// Initializes a new instance of . - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogStartedInternal(string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogStartedInternal(DialogInputType? dialogInputType, string dialogId, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. @@ -48,5 +44,9 @@ internal DialogStartedInternal(string operationContext, ResultInformation result public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.Serialization.cs index 3a6cc205e4e2..4103afad0c03 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.Serialization.cs @@ -17,42 +17,18 @@ internal static DialogTransferInternal DeserializeDialogTransferInternal(JsonEle { return null; } - string transferType = default; - string transferDestination = default; - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; + string transferType = default; + string transferDestination = default; object ivrContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("transferType"u8)) - { - transferType = property.Value.GetString(); - continue; - } - if (property.NameEquals("transferDestination"u8)) - { - transferDestination = property.Value.GetString(); - continue; - } - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -67,6 +43,16 @@ internal static DialogTransferInternal DeserializeDialogTransferInternal(JsonEle dialogId = property.Value.GetString(); continue; } + if (property.NameEquals("transferType"u8)) + { + transferType = property.Value.GetString(); + continue; + } + if (property.NameEquals("transferDestination"u8)) + { + transferDestination = property.Value.GetString(); + continue; + } if (property.NameEquals("ivrContext"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -91,18 +77,32 @@ internal static DialogTransferInternal DeserializeDialogTransferInternal(JsonEle correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogTransferInternal( - transferType, - transferDestination, - operationContext, - resultInformation, dialogInputType, dialogId, + transferType, + transferDestination, ivrContext, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.cs index de8493143cc5..02fada96a19a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogTransferInternal.cs @@ -16,43 +16,39 @@ internal DialogTransferInternal() } /// Initializes a new instance of . - /// Transfer type. - /// Transfer destination. - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. - /// Ivr Context. + /// Transfer type. + /// Transfer destination. + /// IVR context. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogTransferInternal(string transferType, string transferDestination, string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, object ivrContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogTransferInternal(DialogInputType? dialogInputType, string dialogId, string transferType, string transferDestination, object ivrContext, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - TransferType = transferType; - TransferDestination = transferDestination; - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; + TransferType = transferType; + TransferDestination = transferDestination; IvrContext = ivrContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Transfer type. - public string TransferType { get; } - /// Transfer destination. - public string TransferDestination { get; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. public string DialogId { get; } - /// Ivr Context. + /// Transfer type. + public string TransferType { get; } + /// Transfer destination. + public string TransferDestination { get; } + /// IVR context. public object IvrContext { get; } /// Call connection ID. public string CallConnectionId { get; } @@ -60,5 +56,9 @@ internal DialogTransferInternal(string transferType, string transferDestination, public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.Serialization.cs index 9df41fbcf0dd..8e5818d0cea6 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.Serialization.cs @@ -17,30 +17,16 @@ internal static DialogUpdatedInternal DeserializeDialogUpdatedInternal(JsonEleme { return null; } - string operationContext = default; - ResultInformation resultInformation = default; DialogInputType? dialogInputType = default; string dialogId = default; object ivrContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("dialogInputType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -79,16 +65,30 @@ internal static DialogUpdatedInternal DeserializeDialogUpdatedInternal(JsonEleme correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new DialogUpdatedInternal( - operationContext, - resultInformation, dialogInputType, dialogId, ivrContext, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.cs index 73adc55c569f..764fd4566ea0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/DialogUpdatedInternal.cs @@ -16,35 +16,31 @@ internal DialogUpdatedInternal() } /// Initializes a new instance of . - /// Used by customers when calling answerCall action to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Determines the type of the dialog. /// Dialog ID. - /// Ivr Context. + /// IVR context. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal DialogUpdatedInternal(string operationContext, ResultInformation resultInformation, DialogInputType? dialogInputType, string dialogId, object ivrContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal DialogUpdatedInternal(DialogInputType? dialogInputType, string dialogId, object ivrContext, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; DialogInputType = dialogInputType; DialogId = dialogId; IvrContext = ivrContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling answerCall action to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code/sub-code and message from NGC services. - public ResultInformation ResultInformation { get; } /// Determines the type of the dialog. public DialogInputType? DialogInputType { get; } /// Dialog ID. public string DialogId { get; } - /// Ivr Context. + /// IVR context. public object IvrContext { get; } /// Call connection ID. public string CallConnectionId { get; } @@ -52,5 +48,9 @@ internal DialogUpdatedInternal(string operationContext, ResultInformation result public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioCompleted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioCompleted.cs new file mode 100644 index 000000000000..b560b8a3266e --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioCompleted.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The HoldAudioCompleted. + internal partial class HoldAudioCompleted + { + /// Initializes a new instance of . + internal HoldAudioCompleted() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal HoldAudioCompleted(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioPaused.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioPaused.cs new file mode 100644 index 000000000000..3feca3d79e4b --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioPaused.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The HoldAudioPaused. + internal partial class HoldAudioPaused + { + /// Initializes a new instance of . + internal HoldAudioPaused() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal HoldAudioPaused(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioResumed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioResumed.cs new file mode 100644 index 000000000000..82ff2de95a90 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioResumed.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The HoldAudioResumed. + internal partial class HoldAudioResumed + { + /// Initializes a new instance of . + internal HoldAudioResumed() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal HoldAudioResumed(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioStarted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioStarted.cs new file mode 100644 index 000000000000..cc9931cd4899 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldAudioStarted.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The HoldAudioStarted. + internal partial class HoldAudioStarted + { + /// Initializes a new instance of . + internal HoldAudioStarted() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal HoldAudioStarted(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailed.cs deleted file mode 100644 index e0721196e11e..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailed.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Communication.CallAutomation -{ - /// The HoldFailed. - public partial class HoldFailed - { - /// Initializes a new instance of . - internal HoldFailed() - { - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailedInternal.Serialization.cs new file mode 100644 index 000000000000..318a610ebb2f --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailedInternal.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + internal partial class HoldFailedInternal + { + internal static HoldFailedInternal DeserializeHoldFailedInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string callConnectionId = default; + string serverCallId = default; + string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } + } + return new HoldFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static HoldFailedInternal FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeHoldFailedInternal(document.RootElement); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailedInternal.cs new file mode 100644 index 000000000000..ad7de579f5b9 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailedInternal.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The HoldFailed. + internal partial class HoldFailedInternal + { + /// Initializes a new instance of . + internal HoldFailedInternal() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal HoldFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.Serialization.cs new file mode 100644 index 000000000000..afe821a16ad8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + internal partial class IncomingCallInternal + { + internal static IncomingCallInternal DeserializeIncomingCallInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CommunicationIdentifierModel to = default; + CommunicationIdentifierModel @from = default; + string callerDisplayName = default; + string serverCallId = default; + CustomCallingContextInternal customContext = default; + string incomingCallContext = default; + CommunicationIdentifierModel onBehalfOfCallee = default; + string correlationId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("to"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + to = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("from"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @from = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("callerDisplayName"u8)) + { + callerDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customContext"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customContext = CustomCallingContextInternal.DeserializeCustomCallingContextInternal(property.Value); + continue; + } + if (property.NameEquals("incomingCallContext"u8)) + { + incomingCallContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("onBehalfOfCallee"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + onBehalfOfCallee = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + } + return new IncomingCallInternal( + to, + @from, + callerDisplayName, + serverCallId, + customContext, + incomingCallContext, + onBehalfOfCallee, + correlationId); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IncomingCallInternal FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIncomingCallInternal(document.RootElement); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.cs new file mode 100644 index 000000000000..71dfda9a4c3b --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/IncomingCallInternal.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The incoming call event. + internal partial class IncomingCallInternal + { + /// Initializes a new instance of . + internal IncomingCallInternal() + { + } + + /// Initializes a new instance of . + /// The communication identifier of the target user. + /// The communication identifier of the user who initiated the call. + /// Display name of caller. + /// The server call id. + /// Custom Context of Incoming Call. + /// Incoming call context. + /// The communication identifier of the user on behalf of whom the call is made. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + internal IncomingCallInternal(CommunicationIdentifierModel to, CommunicationIdentifierModel @from, string callerDisplayName, string serverCallId, CustomCallingContextInternal customContext, string incomingCallContext, CommunicationIdentifierModel onBehalfOfCallee, string correlationId) + { + To = to; + From = @from; + CallerDisplayName = callerDisplayName; + ServerCallId = serverCallId; + CustomContext = customContext; + IncomingCallContext = incomingCallContext; + OnBehalfOfCallee = onBehalfOfCallee; + CorrelationId = correlationId; + } + + /// The communication identifier of the target user. + public CommunicationIdentifierModel To { get; } + /// The communication identifier of the user who initiated the call. + public CommunicationIdentifierModel From { get; } + /// Display name of caller. + public string CallerDisplayName { get; } + /// The server call id. + public string ServerCallId { get; } + /// Custom Context of Incoming Call. + public CustomCallingContextInternal CustomContext { get; } + /// Incoming call context. + public string IncomingCallContext { get; } + /// The communication identifier of the user on behalf of whom the call is made. + public CommunicationIdentifierModel OnBehalfOfCallee { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/InterruptAudioAndAnnounceRequestInternal.Serialization.cs similarity index 67% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/InterruptAudioAndAnnounceRequestInternal.Serialization.cs index 0139a4048f65..4f676f1b1d66 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/InterruptAudioAndAnnounceRequestInternal.Serialization.cs @@ -10,13 +10,20 @@ namespace Azure.Communication.CallAutomation { - internal partial class StopHoldMusicRequestInternal : IUtf8JsonSerializable + internal partial class InterruptAudioAndAnnounceRequestInternal : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("targetParticipant"u8); - writer.WriteObjectValue(TargetParticipant); + writer.WritePropertyName("playSources"u8); + writer.WriteStartArray(); + foreach (var item in PlaySources) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("playTo"u8); + writer.WriteObjectValue(PlayTo); if (Optional.IsDefined(OperationContext)) { writer.WritePropertyName("operationContext"u8); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/InterruptAudioAndAnnounceRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/InterruptAudioAndAnnounceRequestInternal.cs new file mode 100644 index 000000000000..3e022e1f0404 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/InterruptAudioAndAnnounceRequestInternal.cs @@ -0,0 +1,57 @@ +// 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.Communication.CallAutomation +{ + /// The InterruptAudioAndAnnounceRequest. + internal partial class InterruptAudioAndAnnounceRequestInternal + { + /// Initializes a new instance of . + /// The source of the audio to be played. + /// + /// The list of call participants play provided audio to. + /// Plays to everyone in the call when not provided. + /// + /// or is null. + public InterruptAudioAndAnnounceRequestInternal(IEnumerable playSources, CommunicationIdentifierModel playTo) + { + Argument.AssertNotNull(playSources, nameof(playSources)); + Argument.AssertNotNull(playTo, nameof(playTo)); + + PlaySources = playSources.ToList(); + PlayTo = playTo; + } + + /// Initializes a new instance of . + /// The source of the audio to be played. + /// + /// The list of call participants play provided audio to. + /// Plays to everyone in the call when not provided. + /// + /// The value to identify context of the operation. + internal InterruptAudioAndAnnounceRequestInternal(IList playSources, CommunicationIdentifierModel playTo, string operationContext) + { + PlaySources = playSources; + PlayTo = playTo; + OperationContext = operationContext; + } + + /// The source of the audio to be played. + public IList PlaySources { get; } + /// + /// The list of call participants play provided audio to. + /// Plays to everyone in the call when not provided. + /// + public CommunicationIdentifierModel PlayTo { get; } + /// The value to identify context of the operation. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.Serialization.cs index 660c0bcef9c7..a6aac2d0eb1b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.Serialization.cs @@ -17,28 +17,14 @@ internal static MediaStreamingFailed DeserializeMediaStreamingFailed(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; MediaStreamingUpdate mediaStreamingUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("mediaStreamingUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static MediaStreamingFailed DeserializeMediaStreamingFailed(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new MediaStreamingFailed( - operationContext, - resultInformation, mediaStreamingUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.cs index e8fce794708e..ff75df9e64ef 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingFailed.cs @@ -16,22 +16,23 @@ internal MediaStreamingFailed() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Defines the result for audio streaming update with the current status and the details about the status. + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal MediaStreamingFailed(string operationContext, ResultInformation resultInformation, MediaStreamingUpdate mediaStreamingUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal MediaStreamingFailed(MediaStreamingUpdate mediaStreamingUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; MediaStreamingUpdate = mediaStreamingUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Defines the result for audio streaming update with the current status and the details about the status. + + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. public MediaStreamingUpdate MediaStreamingUpdate { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.Serialization.cs index b4802d532bd4..31e0a8d690c0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.Serialization.cs @@ -28,6 +28,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("startMediaStreaming"u8); writer.WriteBooleanValue(StartMediaStreaming.Value); } + if (Optional.IsDefined(EnableBidirectional)) + { + writer.WritePropertyName("enableBidirectional"u8); + writer.WriteBooleanValue(EnableBidirectional.Value); + } + if (Optional.IsDefined(AudioFormat)) + { + writer.WritePropertyName("audioFormat"u8); + writer.WriteStringValue(AudioFormat.Value.ToString()); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.cs index 304acbc8a14e..bdbc504b93fe 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingOptionsInternal.cs @@ -34,13 +34,17 @@ public MediaStreamingOptionsInternal(string transportUrl, MediaStreamingTranspor /// Content type to stream, eg. audio. /// Audio channel type to stream, eg. unmixed audio, mixed audio. /// Determines if the media streaming should be started immediately after call is answered or not. - internal MediaStreamingOptionsInternal(string transportUrl, MediaStreamingTransport transportType, MediaStreamingContent contentType, MediaStreamingAudioChannel audioChannelType, bool? startMediaStreaming) + /// A value indicating whether bidirectional streaming is enabled. + /// Specifies the audio format used for encoding, including sample rate and channel type. + internal MediaStreamingOptionsInternal(string transportUrl, MediaStreamingTransport transportType, MediaStreamingContent contentType, MediaStreamingAudioChannel audioChannelType, bool? startMediaStreaming, bool? enableBidirectional, AudioFormat? audioFormat) { TransportUrl = transportUrl; TransportType = transportType; ContentType = contentType; AudioChannelType = audioChannelType; StartMediaStreaming = startMediaStreaming; + EnableBidirectional = enableBidirectional; + AudioFormat = audioFormat; } /// Transport URL for media streaming. @@ -53,5 +57,9 @@ internal MediaStreamingOptionsInternal(string transportUrl, MediaStreamingTransp public MediaStreamingAudioChannel AudioChannelType { get; } /// Determines if the media streaming should be started immediately after call is answered or not. public bool? StartMediaStreaming { get; set; } + /// A value indicating whether bidirectional streaming is enabled. + public bool? EnableBidirectional { get; set; } + /// Specifies the audio format used for encoding, including sample rate and channel type. + public AudioFormat? AudioFormat { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.Serialization.cs index c43cee8b4f1f..c7df048c3c98 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.Serialization.cs @@ -17,28 +17,14 @@ internal static MediaStreamingStarted DeserializeMediaStreamingStarted(JsonEleme { return null; } - string operationContext = default; - ResultInformation resultInformation = default; MediaStreamingUpdate mediaStreamingUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("mediaStreamingUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static MediaStreamingStarted DeserializeMediaStreamingStarted(JsonEleme correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new MediaStreamingStarted( - operationContext, - resultInformation, mediaStreamingUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.cs index 7d86d5b3e975..6211ba74022d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStarted.cs @@ -16,22 +16,23 @@ internal MediaStreamingStarted() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Defines the result for audio streaming update with the current status and the details about the status. + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal MediaStreamingStarted(string operationContext, ResultInformation resultInformation, MediaStreamingUpdate mediaStreamingUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal MediaStreamingStarted(MediaStreamingUpdate mediaStreamingUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; MediaStreamingUpdate = mediaStreamingUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Defines the result for audio streaming update with the current status and the details about the status. + + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. public MediaStreamingUpdate MediaStreamingUpdate { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.Serialization.cs index d650b0a6f9d8..9525c902b614 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.Serialization.cs @@ -17,28 +17,14 @@ internal static MediaStreamingStopped DeserializeMediaStreamingStopped(JsonEleme { return null; } - string operationContext = default; - ResultInformation resultInformation = default; MediaStreamingUpdate mediaStreamingUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("mediaStreamingUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static MediaStreamingStopped DeserializeMediaStreamingStopped(JsonEleme correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new MediaStreamingStopped( - operationContext, - resultInformation, mediaStreamingUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.cs index a7c9979b31e6..26be58f0c2c4 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingStopped.cs @@ -16,22 +16,23 @@ internal MediaStreamingStopped() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Defines the result for audio streaming update with the current status and the details about the status. + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal MediaStreamingStopped(string operationContext, ResultInformation resultInformation, MediaStreamingUpdate mediaStreamingUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal MediaStreamingStopped(MediaStreamingUpdate mediaStreamingUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; MediaStreamingUpdate = mediaStreamingUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Defines the result for audio streaming update with the current status and the details about the status. + + /// Defines the result for MediaStreamingUpdate with the current status and the details about the status. public MediaStreamingUpdate MediaStreamingUpdate { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionInternal.Serialization.cs new file mode 100644 index 000000000000..63bbbe79b1b8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionInternal.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + internal partial class MediaStreamingSubscriptionInternal + { + internal static MediaStreamingSubscriptionInternal DeserializeMediaStreamingSubscriptionInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + MediaStreamingSubscriptionState? state = default; + IReadOnlyList subscribedContentTypes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new MediaStreamingSubscriptionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("subscribedContentTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new MediaStreamingContent(item.GetString())); + } + subscribedContentTypes = array; + continue; + } + } + return new MediaStreamingSubscriptionInternal(id, state, subscribedContentTypes ?? new ChangeTrackingList()); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MediaStreamingSubscriptionInternal FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMediaStreamingSubscriptionInternal(document.RootElement); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionInternal.cs new file mode 100644 index 000000000000..4f11845a0918 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionInternal.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Communication.CallAutomation +{ + /// Media streaming Subscription Object. + internal partial class MediaStreamingSubscriptionInternal + { + /// Initializes a new instance of . + internal MediaStreamingSubscriptionInternal() + { + SubscribedContentTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Subscription Id. + /// Media streaming subscription state. + /// Subscribed media streaming content types. + internal MediaStreamingSubscriptionInternal(string id, MediaStreamingSubscriptionState? state, IReadOnlyList subscribedContentTypes) + { + Id = id; + State = state; + SubscribedContentTypes = subscribedContentTypes; + } + + /// Subscription Id. + public string Id { get; } + /// Media streaming subscription state. + public MediaStreamingSubscriptionState? State { get; } + /// Subscribed media streaming content types. + public IReadOnlyList SubscribedContentTypes { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionState.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionState.cs new file mode 100644 index 000000000000..512d726e1d73 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/MediaStreamingSubscriptionState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.CallAutomation +{ + /// Media streaming subscription state. + public readonly partial struct MediaStreamingSubscriptionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MediaStreamingSubscriptionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisabledValue = "disabled"; + private const string InactiveValue = "inactive"; + private const string ActiveValue = "active"; + + /// disabled. + public static MediaStreamingSubscriptionState Disabled { get; } = new MediaStreamingSubscriptionState(DisabledValue); + /// inactive. + public static MediaStreamingSubscriptionState Inactive { get; } = new MediaStreamingSubscriptionState(InactiveValue); + /// active. + public static MediaStreamingSubscriptionState Active { get; } = new MediaStreamingSubscriptionState(ActiveValue); + /// Determines if two values are the same. + public static bool operator ==(MediaStreamingSubscriptionState left, MediaStreamingSubscriptionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MediaStreamingSubscriptionState left, MediaStreamingSubscriptionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MediaStreamingSubscriptionState(string value) => new MediaStreamingSubscriptionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MediaStreamingSubscriptionState other && Equals(other); + /// + public bool Equals(MediaStreamingSubscriptionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.Serialization.cs index d6d27dfd76c0..bac622053fe6 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.Serialization.cs @@ -18,13 +18,38 @@ internal static ParticipantsUpdatedInternal DeserializeParticipantsUpdatedIntern { return null; } - IReadOnlyList participants = default; - int? sequenceNumber = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + int? sequenceNumber = default; + IReadOnlyList participants = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sequenceNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sequenceNumber = property.Value.GetInt32(); + continue; + } if (property.NameEquals("participants"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -39,32 +64,23 @@ internal static ParticipantsUpdatedInternal DeserializeParticipantsUpdatedIntern participants = array; continue; } - if (property.NameEquals("sequenceNumber"u8)) + if (property.NameEquals("resultInformation"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - sequenceNumber = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); continue; } } - return new ParticipantsUpdatedInternal(participants ?? new ChangeTrackingList(), sequenceNumber, callConnectionId, serverCallId, correlationId); + return new ParticipantsUpdatedInternal( + callConnectionId, + serverCallId, + correlationId, + sequenceNumber, + participants ?? new ChangeTrackingList(), + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.cs index cfee784abddf..a424d240d317 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/ParticipantsUpdatedInternal.cs @@ -19,29 +19,33 @@ internal ParticipantsUpdatedInternal() } /// Initializes a new instance of . - /// The list of participants in the call. - /// /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal ParticipantsUpdatedInternal(IReadOnlyList participants, int? sequenceNumber, string callConnectionId, string serverCallId, string correlationId) + /// The Sequence Number of the event. + /// The list of participants in the call. + /// Contains the resulting SIP code, sub-code and message. + internal ParticipantsUpdatedInternal(string callConnectionId, string serverCallId, string correlationId, int? sequenceNumber, IReadOnlyList participants, ResultInformation resultInformation) { - Participants = participants; - SequenceNumber = sequenceNumber; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + SequenceNumber = sequenceNumber; + Participants = participants; + ResultInformation = resultInformation; } - /// The list of participants in the call. - public IReadOnlyList Participants { get; } - /// Gets the sequence number. - public int? SequenceNumber { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// The Sequence Number of the event. + public int? SequenceNumber { get; } + /// The list of participants in the call. + public IReadOnlyList Participants { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.Serialization.cs index a67e5b9d60b4..90c9a1e451af 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.Serialization.cs @@ -17,17 +17,13 @@ internal static PlayCanceled DeserializePlayCanceled(JsonElement element) { return null; } - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -43,8 +39,22 @@ internal static PlayCanceled DeserializePlayCanceled(JsonElement element) correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new PlayCanceled(operationContext, callConnectionId, serverCallId, correlationId); + return new PlayCanceled(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.cs index 6186d5a5e8fc..8108f76d5297 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCanceled.cs @@ -16,16 +16,18 @@ internal PlayCanceled() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal PlayCanceled(string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal PlayCanceled(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompleted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompleted.cs deleted file mode 100644 index 8cff443664ad..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompleted.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Communication.CallAutomation -{ - /// The PlayCompleted. - public partial class PlayCompleted - { - /// Initializes a new instance of . - internal PlayCompleted() - { - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompletedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompletedInternal.Serialization.cs new file mode 100644 index 000000000000..97b5c73b2bce --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompletedInternal.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + internal partial class PlayCompletedInternal + { + internal static PlayCompletedInternal DeserializePlayCompletedInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string callConnectionId = default; + string serverCallId = default; + string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } + } + return new PlayCompletedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PlayCompletedInternal FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePlayCompletedInternal(document.RootElement); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompletedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompletedInternal.cs new file mode 100644 index 000000000000..16a95b5623b8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayCompletedInternal.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The PlayCompleted. + internal partial class PlayCompletedInternal + { + /// Initializes a new instance of . + internal PlayCompletedInternal() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal PlayCompletedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailedInternal.Serialization.cs similarity index 86% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailed.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailedInternal.Serialization.cs index 627bba292273..98b855b1bcd6 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailedInternal.Serialization.cs @@ -9,22 +9,37 @@ namespace Azure.Communication.CallAutomation { - public partial class PlayFailed + internal partial class PlayFailedInternal { - internal static PlayFailed DeserializePlayFailed(JsonElement element) + internal static PlayFailedInternal DeserializePlayFailedInternal(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - int? failedPlaySourceIndex = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + int? failedPlaySourceIndex = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -48,37 +63,22 @@ internal static PlayFailed DeserializePlayFailed(JsonElement element) failedPlaySourceIndex = property.Value.GetInt32(); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } - return new PlayFailed( - operationContext, - resultInformation, - failedPlaySourceIndex, + return new PlayFailedInternal( callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + failedPlaySourceIndex); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static PlayFailed FromResponse(Response response) + internal static PlayFailedInternal FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializePlayFailed(document.RootElement); + return DeserializePlayFailedInternal(document.RootElement); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailedInternal.cs similarity index 70% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailed.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailedInternal.cs index 9157101f89f3..b030fb7678aa 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayFailedInternal.cs @@ -8,30 +8,30 @@ namespace Azure.Communication.CallAutomation { /// The PlayFailed. - public partial class PlayFailed + internal partial class PlayFailedInternal { - /// Initializes a new instance of . - internal PlayFailed() + /// Initializes a new instance of . + internal PlayFailedInternal() { } - /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Indicates the index of the failed play source. + /// Initializes a new instance of . /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal PlayFailed(string operationContext, ResultInformation resultInformation, int? failedPlaySourceIndex, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Contains the index of the failed play source. + internal PlayFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, int? failedPlaySourceIndex) { - OperationContext = operationContext; - ResultInformation = resultInformation; - FailedPlaySourceIndex = failedPlaySourceIndex; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + FailedPlaySourceIndex = failedPlaySourceIndex; } - /// Indicates the index of the failed play source. + /// Contains the index of the failed play source. public int? FailedPlaySourceIndex { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayPaused.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayPaused.cs new file mode 100644 index 000000000000..96d0d5d4af3f --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayPaused.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// Play started event. + internal partial class PlayPaused + { + /// Initializes a new instance of . + internal PlayPaused() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal PlayPaused(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayResumed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayResumed.cs new file mode 100644 index 000000000000..d434c9974b94 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayResumed.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// Play started event. + internal partial class PlayResumed + { + /// Initializes a new instance of . + internal PlayResumed() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal PlayResumed(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Server call ID. + public string ServerCallId { get; } + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayStarted.Serialization.cs similarity index 85% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailed.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayStarted.Serialization.cs index c8ba69d4ac3e..ed624721a9e5 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/HoldFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayStarted.Serialization.cs @@ -9,35 +9,21 @@ namespace Azure.Communication.CallAutomation { - public partial class HoldFailed + public partial class PlayStarted { - internal static HoldFailed DeserializeHoldFailed(JsonElement element) + internal static PlayStarted DeserializePlayStarted(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,16 +39,30 @@ internal static HoldFailed DeserializeHoldFailed(JsonElement element) correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new HoldFailed(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new PlayStarted(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static HoldFailed FromResponse(Response response) + internal static PlayStarted FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeHoldFailed(document.RootElement); + return DeserializePlayStarted(document.RootElement); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayStarted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayStarted.cs new file mode 100644 index 000000000000..2e09231978d9 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/PlayStarted.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// Play started event. + public partial class PlayStarted + { + /// Initializes a new instance of . + internal PlayStarted() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal PlayStarted(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) + { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.Serialization.cs index 51d91445cea8..ba6e8493774c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.Serialization.cs @@ -17,17 +17,13 @@ internal static RecognizeCanceled DeserializeRecognizeCanceled(JsonElement eleme { return null; } - string operationContext = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -43,8 +39,22 @@ internal static RecognizeCanceled DeserializeRecognizeCanceled(JsonElement eleme correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new RecognizeCanceled(operationContext, callConnectionId, serverCallId, correlationId); + return new RecognizeCanceled(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.cs index 96e8cf621aad..ad565aa3628f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCanceled.cs @@ -16,16 +16,18 @@ internal RecognizeCanceled() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal RecognizeCanceled(string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal RecognizeCanceled(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.Serialization.cs index aee590596d80..2ce77a6375e0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.Serialization.cs @@ -17,18 +17,32 @@ internal static RecognizeCompletedInternal DeserializeRecognizeCompletedInternal { return null; } + string callConnectionId = default; + string serverCallId = default; + string correlationId = default; string operationContext = default; ResultInformation resultInformation = default; CallMediaRecognitionType recognitionType = default; - CollectTonesResult collectTonesResult = default; DtmfResult dtmfResult = default; - SpeechResult speechResult = default; ChoiceResult choiceResult = default; - string callConnectionId = default; - string serverCallId = default; - string correlationId = default; + SpeechResult speechResult = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -52,15 +66,6 @@ internal static RecognizeCompletedInternal DeserializeRecognizeCompletedInternal recognitionType = new CallMediaRecognitionType(property.Value.GetString()); continue; } - if (property.NameEquals("collectTonesResult"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - collectTonesResult = CollectTonesResult.DeserializeCollectTonesResult(property.Value); - continue; - } if (property.NameEquals("dtmfResult"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -70,51 +75,35 @@ internal static RecognizeCompletedInternal DeserializeRecognizeCompletedInternal dtmfResult = DtmfResult.DeserializeDtmfResult(property.Value); continue; } - if (property.NameEquals("speechResult"u8)) + if (property.NameEquals("choiceResult"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - speechResult = SpeechResult.DeserializeSpeechResult(property.Value); + choiceResult = ChoiceResult.DeserializeChoiceResult(property.Value); continue; } - if (property.NameEquals("choiceResult"u8)) + if (property.NameEquals("speechResult"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - choiceResult = ChoiceResult.DeserializeChoiceResult(property.Value); - continue; - } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); + speechResult = SpeechResult.DeserializeSpeechResult(property.Value); continue; } } return new RecognizeCompletedInternal( + callConnectionId, + serverCallId, + correlationId, operationContext, resultInformation, recognitionType, - collectTonesResult, dtmfResult, - speechResult, choiceResult, - callConnectionId, - serverCallId, - correlationId); + speechResult); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.cs index 5ea6ba892e5a..3492a6c8ba21 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeCompletedInternal.cs @@ -16,45 +16,35 @@ internal RecognizeCompletedInternal() } /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Result information defines the code, subcode and message. + /// Contains the resulting SIP code, sub-code and message. /// /// Determines the sub-type of the recognize operation. /// In case of cancel operation the this field is not set and is returned empty /// - /// - /// Defines the result for RecognitionType = Dtmf - /// Would be replaced by DtmfResult after server sdk renewed - /// /// Defines the result for RecognitionType = Dtmf. - /// Defines the result for RecognitionType = Speech and SpeechOrDtmf. /// Defines the result for RecognitionType = Choices. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal RecognizeCompletedInternal(string operationContext, ResultInformation resultInformation, CallMediaRecognitionType recognitionType, CollectTonesResult collectTonesResult, DtmfResult dtmfResult, SpeechResult speechResult, ChoiceResult choiceResult, string callConnectionId, string serverCallId, string correlationId) + /// Defines the result for RecognitionType = Speech and SpeechOrDtmf. + internal RecognizeCompletedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CallMediaRecognitionType recognitionType, DtmfResult dtmfResult, ChoiceResult choiceResult, SpeechResult speechResult) { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; OperationContext = operationContext; ResultInformation = resultInformation; RecognitionType = recognitionType; - CollectTonesResult = collectTonesResult; DtmfResult = dtmfResult; - SpeechResult = speechResult; ChoiceResult = choiceResult; - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; + SpeechResult = speechResult; } - /// - /// Defines the result for RecognitionType = Dtmf - /// Would be replaced by DtmfResult after server sdk renewed - /// - public CollectTonesResult CollectTonesResult { get; } /// Defines the result for RecognitionType = Dtmf. public DtmfResult DtmfResult { get; } - /// Defines the result for RecognitionType = Speech and SpeechOrDtmf. - public SpeechResult SpeechResult { get; } /// Defines the result for RecognitionType = Choices. public ChoiceResult ChoiceResult { get; } + /// Defines the result for RecognitionType = Speech and SpeechOrDtmf. + public SpeechResult SpeechResult { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailedInternal.Serialization.cs similarity index 85% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailed.Serialization.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailedInternal.Serialization.cs index 0d12ed0c8931..11dc59b640ba 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailedInternal.Serialization.cs @@ -9,22 +9,37 @@ namespace Azure.Communication.CallAutomation { - public partial class RecognizeFailed + internal partial class RecognizeFailedInternal { - internal static RecognizeFailed DeserializeRecognizeFailed(JsonElement element) + internal static RecognizeFailedInternal DeserializeRecognizeFailedInternal(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - int? failedPlaySourceIndex = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + int? failedPlaySourceIndex = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -48,37 +63,22 @@ internal static RecognizeFailed DeserializeRecognizeFailed(JsonElement element) failedPlaySourceIndex = property.Value.GetInt32(); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } - return new RecognizeFailed( - operationContext, - resultInformation, - failedPlaySourceIndex, + return new RecognizeFailedInternal( callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + failedPlaySourceIndex); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static RecognizeFailed FromResponse(Response response) + internal static RecognizeFailedInternal FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRecognizeFailed(document.RootElement); + return DeserializeRecognizeFailedInternal(document.RootElement); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailedInternal.cs similarity index 70% rename from sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailed.cs rename to sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailedInternal.cs index 2f606eb4b0da..62599fe20aa7 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeFailedInternal.cs @@ -8,30 +8,30 @@ namespace Azure.Communication.CallAutomation { /// The RecognizeFailed. - public partial class RecognizeFailed + internal partial class RecognizeFailedInternal { - /// Initializes a new instance of . - internal RecognizeFailed() + /// Initializes a new instance of . + internal RecognizeFailedInternal() { } - /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Indicates the index of the failed play source. + /// Initializes a new instance of . /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal RecognizeFailed(string operationContext, ResultInformation resultInformation, int? failedPlaySourceIndex, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Contains the index of the failed play source. + internal RecognizeFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, int? failedPlaySourceIndex) { - OperationContext = operationContext; - ResultInformation = resultInformation; - FailedPlaySourceIndex = failedPlaySourceIndex; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + FailedPlaySourceIndex = failedPlaySourceIndex; } - /// Indicates the index of the failed play source. + /// Contains the index of the failed play source. public int? FailedPlaySourceIndex { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs index fbf6716eb523..aa8cc290a6c0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.Serialization.cs @@ -28,7 +28,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartArray(); foreach (var item in PlayPrompts) { - writer.WriteObjectValue(item); + writer.WriteObjectValue(item); } writer.WriteEndArray(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs index d6bf12aa353e..385cde631fec 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecognizeRequestInternal.cs @@ -52,8 +52,6 @@ internal RecognizeRequestInternal(RecognizeInputType recognizeInputType, PlaySou public RecognizeInputType RecognizeInputType { get; } /// The source of the audio to be played for recognition. public PlaySourceInternal PlayPrompt { get; set; } - /// The source of the audio to be played for recognition. - public IList PlayPrompts { get; } /// If set recognize can barge into other existing queued-up/currently-processing requests. public bool? InterruptCallMediaOperation { get; set; } /// Defines options for recognition. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingKind.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingKind.cs index 562d055b719c..5aed85365821 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingKind.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingKind.cs @@ -22,15 +22,15 @@ public RecordingKind(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string AzureCommunicationServicesValue = "azureCommunicationServices"; - private const string TeamsValue = "teams"; - private const string TeamsComplianceValue = "teamsCompliance"; + private const string AzureCommunicationServicesValue = "AzureCommunicationServices"; + private const string TeamsValue = "Teams"; + private const string TeamsComplianceValue = "TeamsCompliance"; - /// azureCommunicationServices. + /// Recording initiated by Azure Communication Services. public static RecordingKind AzureCommunicationServices { get; } = new RecordingKind(AzureCommunicationServicesValue); - /// teams. + /// Recording initiated by Teams user. public static RecordingKind Teams { get; } = new RecordingKind(TeamsValue); - /// teamsCompliance. + /// Recording initiated by Teams compliance policy. public static RecordingKind TeamsCompliance { get; } = new RecordingKind(TeamsComplianceValue); /// Determines if two values are the same. public static bool operator ==(RecordingKind left, RecordingKind right) => left.Equals(right); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.Serialization.cs index 13e303e5007d..6e5fda422ccd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.Serialization.cs @@ -18,15 +18,31 @@ internal static RecordingStateChanged DeserializeRecordingStateChanged(JsonEleme { return null; } + string callConnectionId = default; + string serverCallId = default; + string correlationId = default; string recordingId = default; RecordingState state = default; DateTimeOffset? startDateTime = default; RecordingKind? recordingKind = default; - string callConnectionId = default; - string serverCallId = default; - string correlationId = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("recordingId"u8)) { recordingId = property.Value.GetString(); @@ -59,30 +75,25 @@ internal static RecordingStateChanged DeserializeRecordingStateChanged(JsonEleme recordingKind = new RecordingKind(property.Value.GetString()); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) + if (property.NameEquals("resultInformation"u8)) { - correlationId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); continue; } } return new RecordingStateChanged( + callConnectionId, + serverCallId, + correlationId, recordingId, state, startDateTime, recordingKind, - callConnectionId, - serverCallId, - correlationId); + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.cs index 96ec50f96149..615e36a463fc 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStateChanged.cs @@ -18,24 +18,25 @@ internal RecordingStateChanged() } /// Initializes a new instance of . + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// The call recording id. /// /// The time of the recording started. /// - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal RecordingStateChanged(string recordingId, RecordingState state, DateTimeOffset? startDateTime, RecordingKind? recordingKind, string callConnectionId, string serverCallId, string correlationId) + /// Contains the resulting SIP code, sub-code and message. + internal RecordingStateChanged(string callConnectionId, string serverCallId, string correlationId, string recordingId, RecordingState state, DateTimeOffset? startDateTime, RecordingKind? recordingKind, ResultInformation resultInformation) { + CallConnectionId = callConnectionId; + ServerCallId = serverCallId; + CorrelationId = correlationId; RecordingId = recordingId; State = state; StartDateTime = startDateTime; RecordingKind = recordingKind; - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; + ResultInformation = resultInformation; } - /// The call recording id. public string RecordingId { get; } /// The time of the recording started. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStorageKind.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStorageKind.cs index a02689765a5d..7393cf71c80a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStorageKind.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RecordingStorageKind.cs @@ -22,12 +22,12 @@ public RecordingStorageKind(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string AzureCommunicationServicesValue = "azureCommunicationServices"; - private const string AzureBlobStorageValue = "azureBlobStorage"; + private const string AzureCommunicationServicesValue = "AzureCommunicationServices"; + private const string AzureBlobStorageValue = "AzureBlobStorage"; - /// azureCommunicationServices. + /// Storage managed by Azure Communication Services. public static RecordingStorageKind AzureCommunicationServices { get; } = new RecordingStorageKind(AzureCommunicationServicesValue); - /// azureBlobStorage. + /// Storage managed by provided Azure blob. public static RecordingStorageKind AzureBlobStorage { get; } = new RecordingStorageKind(AzureBlobStorageValue); /// Determines if two values are the same. public static bool operator ==(RecordingStorageKind left, RecordingStorageKind right) => left.Equals(right); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.Serialization.cs index 0a4dab8877d0..b4f8caf52d73 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.Serialization.cs @@ -17,14 +17,29 @@ internal static RemoveParticipantFailedInternal DeserializeRemoveParticipantFail { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - CommunicationIdentifierModel participant = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + CommunicationIdentifierModel participant = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -48,29 +63,14 @@ internal static RemoveParticipantFailedInternal DeserializeRemoveParticipantFail participant = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } return new RemoveParticipantFailedInternal( - operationContext, - resultInformation, - participant, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + participant); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.cs index 7cd0fd454f14..c3c4bffe5f5d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantFailedInternal.cs @@ -16,33 +16,33 @@ internal RemoveParticipantFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Participant. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal RemoveParticipantFailedInternal(string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Participant. + internal RemoveParticipantFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant) { - OperationContext = operationContext; - ResultInformation = resultInformation; - Participant = participant; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + Participant = participant; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } - /// Participant. - public CommunicationIdentifierModel Participant { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + /// Participant. + public CommunicationIdentifierModel Participant { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.Serialization.cs index 9bbffbe929fb..06fe51f9aefe 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.Serialization.cs @@ -17,14 +17,29 @@ internal static RemoveParticipantSucceededInternal DeserializeRemoveParticipantS { return null; } - string operationContext = default; - ResultInformation resultInformation = default; - CommunicationIdentifierModel participant = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; + CommunicationIdentifierModel participant = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("callConnectionId"u8)) + { + callConnectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverCallId"u8)) + { + serverCallId = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } if (property.NameEquals("operationContext"u8)) { operationContext = property.Value.GetString(); @@ -48,29 +63,14 @@ internal static RemoveParticipantSucceededInternal DeserializeRemoveParticipantS participant = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("callConnectionId"u8)) - { - callConnectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serverCallId"u8)) - { - serverCallId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId"u8)) - { - correlationId = property.Value.GetString(); - continue; - } } return new RemoveParticipantSucceededInternal( - operationContext, - resultInformation, - participant, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation, + participant); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.cs index 55af488e2748..1839a2db3878 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantSucceededInternal.cs @@ -16,33 +16,33 @@ internal RemoveParticipantSucceededInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. - /// Participant. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal RemoveParticipantSucceededInternal(string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + /// Participant. + internal RemoveParticipantSucceededInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation, CommunicationIdentifierModel participant) { - OperationContext = operationContext; - ResultInformation = resultInformation; - Participant = participant; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; + Participant = participant; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } - /// Participant. - public CommunicationIdentifierModel Participant { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } + /// Participant. + public CommunicationIdentifierModel Participant { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.Serialization.cs index f98acbc0cc3c..f4b5733fd909 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.Serialization.cs @@ -17,27 +17,13 @@ internal static SendDtmfTonesCompletedInternal DeserializeSendDtmfTonesCompleted { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static SendDtmfTonesCompletedInternal DeserializeSendDtmfTonesCompleted correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new SendDtmfTonesCompletedInternal(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new SendDtmfTonesCompletedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.cs index 10c329b60036..0d7ed430172d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesCompletedInternal.cs @@ -16,29 +16,29 @@ internal SendDtmfTonesCompletedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal SendDtmfTonesCompletedInternal(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal SendDtmfTonesCompletedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.Serialization.cs index f89702fc1745..1e63b057b14b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.Serialization.cs @@ -17,27 +17,13 @@ internal static SendDtmfTonesFailedInternal DeserializeSendDtmfTonesFailedIntern { return null; } - string operationContext = default; - ResultInformation resultInformation = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("callConnectionId"u8)) { callConnectionId = property.Value.GetString(); @@ -53,8 +39,22 @@ internal static SendDtmfTonesFailedInternal DeserializeSendDtmfTonesFailedIntern correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } - return new SendDtmfTonesFailedInternal(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new SendDtmfTonesFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.cs index 8c9ed39de7d8..e416f3434cd8 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SendDtmfTonesFailedInternal.cs @@ -16,29 +16,29 @@ internal SendDtmfTonesFailedInternal() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal SendDtmfTonesFailedInternal(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal SendDtmfTonesFailedInternal(string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; } - /// Contains the resulting SIP code, sub-code and message. - public ResultInformation ResultInformation { get; } /// Call connection ID. public string CallConnectionId { get; } /// Server call ID. public string ServerCallId { get; } /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. public string CorrelationId { get; } + /// Used by customers when calling mid-call actions to correlate the request to the response event. + public string OperationContext { get; } + /// Contains the resulting SIP code, sub-code and message. + public ResultInformation ResultInformation { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SpeechResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SpeechResult.cs index 5ebcb61e3f2f..2feae855de0e 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SpeechResult.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/SpeechResult.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - /// The speech recognition status as a result. + /// The speech status as a result. public partial class SpeechResult { /// Initializes a new instance of . diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.Serialization.cs index d0c10c77fbae..7a62d8cf9850 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.Serialization.cs @@ -15,8 +15,16 @@ internal partial class StartCallRecordingRequestInternal : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("callLocator"u8); - writer.WriteObjectValue(CallLocator); + if (Optional.IsDefined(CallLocator)) + { + writer.WritePropertyName("callLocator"u8); + writer.WriteObjectValue(CallLocator); + } + if (Optional.IsDefined(CallConnectionId)) + { + writer.WritePropertyName("callConnectionId"u8); + writer.WriteStringValue(CallConnectionId); + } if (Optional.IsDefined(RecordingStateCallbackUri)) { writer.WritePropertyName("recordingStateCallbackUri"u8); @@ -57,16 +65,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } - if (Optional.IsDefined(ExternalStorage)) - { - writer.WritePropertyName("externalStorage"u8); - writer.WriteObjectValue(ExternalStorage); - } if (Optional.IsDefined(PauseOnStart)) { writer.WritePropertyName("pauseOnStart"u8); writer.WriteBooleanValue(PauseOnStart.Value); } + if (Optional.IsDefined(ExternalStorage)) + { + writer.WritePropertyName("externalStorage"u8); + writer.WriteObjectValue(ExternalStorage); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.cs index d184fc58f9a1..32fc0069be27 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartCallRecordingRequestInternal.cs @@ -5,7 +5,6 @@ #nullable disable -using System; using System.Collections.Generic; namespace Azure.Communication.CallAutomation @@ -14,19 +13,15 @@ namespace Azure.Communication.CallAutomation internal partial class StartCallRecordingRequestInternal { /// Initializes a new instance of . - /// The call locator. - /// is null. - public StartCallRecordingRequestInternal(CallLocatorInternal callLocator) + public StartCallRecordingRequestInternal() { - Argument.AssertNotNull(callLocator, nameof(callLocator)); - - CallLocator = callLocator; AudioChannelParticipantOrdering = new ChangeTrackingList(); ChannelAffinity = new ChangeTrackingList(); } /// Initializes a new instance of . - /// The call locator. + /// The call locator. (Only one of callLocator or callConnectionId to be used). + /// The call connectionId. (Only one of callLocator or callConnectionId to be used). /// The uri to send notifications to. /// The content type of call recording. /// The channel type of call recording. @@ -43,23 +38,26 @@ public StartCallRecordingRequestInternal(CallLocatorInternal callLocator) /// Channel-Participant mapping details can be found in the metadata of the recording. /// /// /// - /// Optional property to specify location where recording will be stored. /// When set to true will start recording in Pause mode, which can be resumed. - internal StartCallRecordingRequestInternal(CallLocatorInternal callLocator, string recordingStateCallbackUri, RecordingContent? recordingContentType, RecordingChannel? recordingChannelType, RecordingFormat? recordingFormatType, IList audioChannelParticipantOrdering, IList channelAffinity, RecordingStorageInternal externalStorage, bool? pauseOnStart) + /// Optional property to specify location where recording will be stored. + internal StartCallRecordingRequestInternal(CallLocatorInternal callLocator, string callConnectionId, string recordingStateCallbackUri, RecordingContent? recordingContentType, RecordingChannel? recordingChannelType, RecordingFormat? recordingFormatType, IList audioChannelParticipantOrdering, IList channelAffinity, bool? pauseOnStart, RecordingStorageInternal externalStorage) { CallLocator = callLocator; + CallConnectionId = callConnectionId; RecordingStateCallbackUri = recordingStateCallbackUri; RecordingContentType = recordingContentType; RecordingChannelType = recordingChannelType; RecordingFormatType = recordingFormatType; AudioChannelParticipantOrdering = audioChannelParticipantOrdering; ChannelAffinity = channelAffinity; - ExternalStorage = externalStorage; PauseOnStart = pauseOnStart; + ExternalStorage = externalStorage; } - /// The call locator. - public CallLocatorInternal CallLocator { get; } + /// The call locator. (Only one of callLocator or callConnectionId to be used). + public CallLocatorInternal CallLocator { get; set; } + /// The call connectionId. (Only one of callLocator or callConnectionId to be used). + public string CallConnectionId { get; set; } /// The uri to send notifications to. public string RecordingStateCallbackUri { get; set; } /// The content type of call recording. @@ -82,9 +80,9 @@ internal StartCallRecordingRequestInternal(CallLocatorInternal callLocator, stri /// /// /// public IList ChannelAffinity { get; } - /// Optional property to specify location where recording will be stored. - public RecordingStorageInternal ExternalStorage { get; set; } /// When set to true will start recording in Pause mode, which can be resumed. public bool? PauseOnStart { get; set; } + /// Optional property to specify location where recording will be stored. + public RecordingStorageInternal ExternalStorage { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.cs deleted file mode 100644 index 8bffe328b248..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartHoldMusicRequestInternal.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.Communication.CallAutomation -{ - /// The request payload for holding participant from the call. - internal partial class StartHoldMusicRequestInternal - { - /// Initializes a new instance of . - /// Participant to be held from the call. - /// is null. - public StartHoldMusicRequestInternal(CommunicationIdentifierModel targetParticipant) - { - Argument.AssertNotNull(targetParticipant, nameof(targetParticipant)); - - TargetParticipant = targetParticipant; - } - - /// Initializes a new instance of . - /// Participant to be held from the call. - /// Prompt to play while in hold. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// - /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. - /// - internal StartHoldMusicRequestInternal(CommunicationIdentifierModel targetParticipant, PlaySourceInternal playSourceInfo, string operationContext, string operationCallbackUri) - { - TargetParticipant = targetParticipant; - PlaySourceInfo = playSourceInfo; - OperationContext = operationContext; - OperationCallbackUri = operationCallbackUri; - } - - /// Participant to be held from the call. - public CommunicationIdentifierModel TargetParticipant { get; } - /// Prompt to play while in hold. - public PlaySourceInternal PlaySourceInfo { get; set; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; set; } - /// - /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. - /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. - /// - public string OperationCallbackUri { get; set; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartRecordingFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartRecordingFailed.cs new file mode 100644 index 000000000000..c5b283db838f --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartRecordingFailed.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Communication.CallAutomation +{ + /// The StartRecordingFailed. + internal partial class StartRecordingFailed + { + /// Initializes a new instance of . + internal StartRecordingFailed() + { + } + + /// Initializes a new instance of . + /// Call connection ID. + /// Correlation ID for event to call correlation. + /// The call recording id. + internal StartRecordingFailed(string callConnectionId, string correlationId, string recordingId) + { + CallConnectionId = callConnectionId; + CorrelationId = correlationId; + RecordingId = recordingId; + } + + /// Call connection ID. + public string CallConnectionId { get; } + /// Correlation ID for event to call correlation. + public string CorrelationId { get; } + /// The call recording id. + public string RecordingId { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.Serialization.cs index 297f08fb1e8f..41c6a2c387e3 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.Serialization.cs @@ -20,11 +20,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("locale"u8); writer.WriteStringValue(Locale); } + if (Optional.IsDefined(SpeechRecognitionModelEndpointId)) + { + writer.WritePropertyName("speechRecognitionModelEndpointId"u8); + writer.WriteStringValue(SpeechRecognitionModelEndpointId); + } if (Optional.IsDefined(OperationContext)) { writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(OperationCallbackUri)) + { + writer.WritePropertyName("operationCallbackUri"u8); + writer.WriteStringValue(OperationCallbackUri); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.cs index 66e0e10735a0..077222ebcdc2 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StartTranscriptionRequestInternal.cs @@ -17,16 +17,30 @@ public StartTranscriptionRequestInternal() /// Initializes a new instance of . /// Defines Locale for the transcription e,g en-US. + /// Endpoint where the custom model was deployed. /// The value to identify context of the operation. - internal StartTranscriptionRequestInternal(string locale, string operationContext) + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + internal StartTranscriptionRequestInternal(string locale, string speechRecognitionModelEndpointId, string operationContext, string operationCallbackUri) { Locale = locale; + SpeechRecognitionModelEndpointId = speechRecognitionModelEndpointId; OperationContext = operationContext; + OperationCallbackUri = operationCallbackUri; } /// Defines Locale for the transcription e,g en-US. public string Locale { get; set; } + /// Endpoint where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public string OperationCallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs deleted file mode 100644 index a421aa72e9fa..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopHoldMusicRequestInternal.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.Communication.CallAutomation -{ - /// The request payload for holding participant from the call. - internal partial class StopHoldMusicRequestInternal - { - /// Initializes a new instance of . - /// - /// Participants to be hold from the call. - /// Only ACS Users are supported. - /// - /// is null. - public StopHoldMusicRequestInternal(CommunicationIdentifierModel targetParticipant) - { - Argument.AssertNotNull(targetParticipant, nameof(targetParticipant)); - - TargetParticipant = targetParticipant; - } - - /// Initializes a new instance of . - /// - /// Participants to be hold from the call. - /// Only ACS Users are supported. - /// - /// Used by customers when calling mid-call actions to correlate the request to the response event. - internal StopHoldMusicRequestInternal(CommunicationIdentifierModel targetParticipant, string operationContext) - { - TargetParticipant = targetParticipant; - OperationContext = operationContext; - } - - /// - /// Participants to be hold from the call. - /// Only ACS Users are supported. - /// - public CommunicationIdentifierModel TargetParticipant { get; } - /// Used by customers when calling mid-call actions to correlate the request to the response event. - public string OperationContext { get; set; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.Serialization.cs index 8f11e7ee6c5e..8e10ecbcac9d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.Serialization.cs @@ -20,6 +20,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationCallbackUri"u8); writer.WriteStringValue(OperationCallbackUri); } + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.cs index 015ec0467a8e..8437d2f394b0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopMediaStreamingRequestInternal.cs @@ -20,9 +20,11 @@ public StopMediaStreamingRequestInternal() /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. /// - internal StopMediaStreamingRequestInternal(string operationCallbackUri) + /// The value to identify context of the operation. + internal StopMediaStreamingRequestInternal(string operationCallbackUri, string operationContext) { OperationCallbackUri = operationCallbackUri; + OperationContext = operationContext; } /// @@ -30,5 +32,7 @@ internal StopMediaStreamingRequestInternal(string operationCallbackUri) /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. /// public string OperationCallbackUri { get; set; } + /// The value to identify context of the operation. + public string OperationContext { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.Serialization.cs index 2ed80f343f88..5fb29980b922 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.Serialization.cs @@ -20,6 +20,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(OperationCallbackUri)) + { + writer.WritePropertyName("operationCallbackUri"u8); + writer.WriteStringValue(OperationCallbackUri); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.cs index b7155839ed26..4e4376055599 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/StopTranscriptionRequestInternal.cs @@ -17,12 +17,22 @@ public StopTranscriptionRequestInternal() /// Initializes a new instance of . /// The value to identify context of the operation. - internal StopTranscriptionRequestInternal(string operationContext) + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + internal StopTranscriptionRequestInternal(string operationContext, string operationCallbackUri) { OperationContext = operationContext; + OperationCallbackUri = operationCallbackUri; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public string OperationCallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.Serialization.cs index 556a03c10254..ed17ac07b872 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.Serialization.cs @@ -17,28 +17,14 @@ internal static TranscriptionFailed DeserializeTranscriptionFailed(JsonElement e { return null; } - string operationContext = default; - ResultInformation resultInformation = default; TranscriptionUpdate transcriptionUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("transcriptionUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static TranscriptionFailed DeserializeTranscriptionFailed(JsonElement e correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new TranscriptionFailed( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs index ee7c5e3a0d5d..2e9db7b9f1b1 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionFailed.cs @@ -16,21 +16,22 @@ internal TranscriptionFailed() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal TranscriptionFailed(string operationContext, ResultInformation resultInformation, TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal TranscriptionFailed(TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; TranscriptionUpdate = transcriptionUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. public TranscriptionUpdate TranscriptionUpdate { get; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.Serialization.cs index 351e4109d2ce..d87b20b619a9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.Serialization.cs @@ -21,8 +21,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(TransportType.ToString()); writer.WritePropertyName("locale"u8); writer.WriteStringValue(Locale); + if (Optional.IsDefined(SpeechRecognitionModelEndpointId)) + { + writer.WritePropertyName("speechRecognitionModelEndpointId"u8); + writer.WriteStringValue(SpeechRecognitionModelEndpointId); + } writer.WritePropertyName("startTranscription"u8); writer.WriteBooleanValue(StartTranscription); + if (Optional.IsDefined(EnableIntermediateResults)) + { + writer.WritePropertyName("enableIntermediateResults"u8); + writer.WriteBooleanValue(EnableIntermediateResults.Value); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.cs index 042896478b48..5e2879750900 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionOptionsInternal.cs @@ -29,13 +29,34 @@ public TranscriptionOptionsInternal(string transportUrl, TranscriptionTransport StartTranscription = startTranscription; } + /// Initializes a new instance of . + /// Transport URL for live transcription. + /// The type of transport to be used for live transcription, eg. Websocket. + /// Defines the locale for the data e.g en-CA, en-AU. + /// Endpoint where the custom model was deployed. + /// Determines if the transcription should be started immediately after call is answered or not. + /// Enables intermediate results for the transcribed speech. + internal TranscriptionOptionsInternal(string transportUrl, TranscriptionTransport transportType, string locale, string speechRecognitionModelEndpointId, bool startTranscription, bool? enableIntermediateResults) + { + TransportUrl = transportUrl; + TransportType = transportType; + Locale = locale; + SpeechRecognitionModelEndpointId = speechRecognitionModelEndpointId; + StartTranscription = startTranscription; + EnableIntermediateResults = enableIntermediateResults; + } + /// Transport URL for live transcription. public string TransportUrl { get; } /// The type of transport to be used for live transcription, eg. Websocket. public TranscriptionTransport TransportType { get; } /// Defines the locale for the data e.g en-CA, en-AU. public string Locale { get; } + /// Endpoint where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } /// Determines if the transcription should be started immediately after call is answered or not. public bool StartTranscription { get; } + /// Enables intermediate results for the transcribed speech. + public bool? EnableIntermediateResults { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResultState.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResultState.cs new file mode 100644 index 000000000000..182f241dd5d2 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionResultState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.CallAutomation +{ + /// The TranscriptionResultType. + public readonly partial struct TranscriptionResultState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TranscriptionResultState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FinalValue = "final"; + private const string IntermediateValue = "intermediate"; + + /// final. + public static TranscriptionResultState Final { get; } = new TranscriptionResultState(FinalValue); + /// intermediate. + public static TranscriptionResultState Intermediate { get; } = new TranscriptionResultState(IntermediateValue); + /// Determines if two values are the same. + public static bool operator ==(TranscriptionResultState left, TranscriptionResultState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TranscriptionResultState left, TranscriptionResultState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TranscriptionResultState(string value) => new TranscriptionResultState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TranscriptionResultState other && Equals(other); + /// + public bool Equals(TranscriptionResultState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.Serialization.cs index 0cafb2a429d2..0ce6f440e589 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.Serialization.cs @@ -17,28 +17,14 @@ internal static TranscriptionStarted DeserializeTranscriptionStarted(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; TranscriptionUpdate transcriptionUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("transcriptionUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static TranscriptionStarted DeserializeTranscriptionStarted(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new TranscriptionStarted( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs index 717e1bc76d55..08783c93ce44 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStarted.cs @@ -16,21 +16,22 @@ internal TranscriptionStarted() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal TranscriptionStarted(string operationContext, ResultInformation resultInformation, TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal TranscriptionStarted(TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; TranscriptionUpdate = transcriptionUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. public TranscriptionUpdate TranscriptionUpdate { get; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.Serialization.cs index 50f59bf7a0b3..ba92365608a4 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.Serialization.cs @@ -17,28 +17,14 @@ internal static TranscriptionStopped DeserializeTranscriptionStopped(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; TranscriptionUpdate transcriptionUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("transcriptionUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static TranscriptionStopped DeserializeTranscriptionStopped(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new TranscriptionStopped( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs index f5bbf382776e..f65945b9b940 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionStopped.cs @@ -16,21 +16,22 @@ internal TranscriptionStopped() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal TranscriptionStopped(string operationContext, ResultInformation resultInformation, TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal TranscriptionStopped(TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; TranscriptionUpdate = transcriptionUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. public TranscriptionUpdate TranscriptionUpdate { get; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionInternal.Serialization.cs new file mode 100644 index 000000000000..beeb42e75602 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionInternal.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + internal partial class TranscriptionSubscriptionInternal + { + internal static TranscriptionSubscriptionInternal DeserializeTranscriptionSubscriptionInternal(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + TranscriptionSubscriptionState? state = default; + IReadOnlyList subscribedResultTypes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new TranscriptionSubscriptionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("subscribedResultTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new TranscriptionResultState(item.GetString())); + } + subscribedResultTypes = array; + continue; + } + } + return new TranscriptionSubscriptionInternal(id, state, subscribedResultTypes ?? new ChangeTrackingList()); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TranscriptionSubscriptionInternal FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTranscriptionSubscriptionInternal(document.RootElement); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionInternal.cs new file mode 100644 index 000000000000..253f6d4abd65 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionInternal.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Communication.CallAutomation +{ + /// Transcription Subscription Object. + internal partial class TranscriptionSubscriptionInternal + { + /// Initializes a new instance of . + internal TranscriptionSubscriptionInternal() + { + SubscribedResultTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Subscription Id. + /// Transcription subscription state. + /// Subscribed transcription result types. + internal TranscriptionSubscriptionInternal(string id, TranscriptionSubscriptionState? state, IReadOnlyList subscribedResultTypes) + { + Id = id; + State = state; + SubscribedResultTypes = subscribedResultTypes; + } + + /// Subscription Id. + public string Id { get; } + /// Transcription subscription state. + public TranscriptionSubscriptionState? State { get; } + /// Subscribed transcription result types. + public IReadOnlyList SubscribedResultTypes { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionState.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionState.cs new file mode 100644 index 000000000000..14b1df831ff0 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionSubscriptionState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Communication.CallAutomation +{ + /// Transcription subscription state. + public readonly partial struct TranscriptionSubscriptionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TranscriptionSubscriptionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisabledValue = "disabled"; + private const string InactiveValue = "inactive"; + private const string ActiveValue = "active"; + + /// disabled. + public static TranscriptionSubscriptionState Disabled { get; } = new TranscriptionSubscriptionState(DisabledValue); + /// inactive. + public static TranscriptionSubscriptionState Inactive { get; } = new TranscriptionSubscriptionState(InactiveValue); + /// active. + public static TranscriptionSubscriptionState Active { get; } = new TranscriptionSubscriptionState(ActiveValue); + /// Determines if two values are the same. + public static bool operator ==(TranscriptionSubscriptionState left, TranscriptionSubscriptionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TranscriptionSubscriptionState left, TranscriptionSubscriptionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TranscriptionSubscriptionState(string value) => new TranscriptionSubscriptionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TranscriptionSubscriptionState other && Equals(other); + /// + public bool Equals(TranscriptionSubscriptionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.Serialization.cs index badca0390828..65cfc2f3f0a9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.Serialization.cs @@ -17,28 +17,14 @@ internal static TranscriptionUpdated DeserializeTranscriptionUpdated(JsonElement { return null; } - string operationContext = default; - ResultInformation resultInformation = default; TranscriptionUpdate transcriptionUpdate = default; string callConnectionId = default; string serverCallId = default; string correlationId = default; + string operationContext = default; + ResultInformation resultInformation = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("operationContext"u8)) - { - operationContext = property.Value.GetString(); - continue; - } - if (property.NameEquals("resultInformation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resultInformation = ResultInformation.DeserializeResultInformation(property.Value); - continue; - } if (property.NameEquals("transcriptionUpdate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,14 +49,28 @@ internal static TranscriptionUpdated DeserializeTranscriptionUpdated(JsonElement correlationId = property.Value.GetString(); continue; } + if (property.NameEquals("operationContext"u8)) + { + operationContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("resultInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resultInformation = ResultInformation.DeserializeResultInformation(property.Value); + continue; + } } return new TranscriptionUpdated( - operationContext, - resultInformation, transcriptionUpdate, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); } /// Deserializes the model from a raw response. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.cs index 10ac150c3eb6..2ee96f988d7b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TranscriptionUpdated.cs @@ -16,21 +16,22 @@ internal TranscriptionUpdated() } /// Initializes a new instance of . - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Defines the result for TranscriptionUpdate with the current status and the details about the status. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - internal TranscriptionUpdated(string operationContext, ResultInformation resultInformation, TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId) + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. + internal TranscriptionUpdated(TranscriptionUpdate transcriptionUpdate, string callConnectionId, string serverCallId, string correlationId, string operationContext, ResultInformation resultInformation) { - OperationContext = operationContext; - ResultInformation = resultInformation; TranscriptionUpdate = transcriptionUpdate; CallConnectionId = callConnectionId; ServerCallId = serverCallId; CorrelationId = correlationId; + OperationContext = operationContext; + ResultInformation = resultInformation; } + /// Defines the result for TranscriptionUpdate with the current status and the details about the status. public TranscriptionUpdate TranscriptionUpdate { get; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs index 17c45a9c5eb5..a8eae012d588 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs @@ -17,11 +17,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("targetParticipant"u8); writer.WriteObjectValue(TargetParticipant); - if (Optional.IsDefined(CustomCallingContext)) - { - writer.WritePropertyName("customCallingContext"u8); - writer.WriteObjectValue(CustomCallingContext); - } if (Optional.IsDefined(OperationContext)) { writer.WritePropertyName("operationContext"u8); @@ -37,6 +32,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationCallbackUri"u8); writer.WriteStringValue(OperationCallbackUri); } + if (Optional.IsDefined(CustomCallingContext)) + { + writer.WritePropertyName("customCallingContext"u8); + writer.WriteObjectValue(CustomCallingContext); + } if (Optional.IsDefined(SourceCallerIdNumber)) { writer.WritePropertyName("sourceCallerIdNumber"u8); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs index 90669d7c57e4..ba20e2eaf470 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs @@ -24,28 +24,26 @@ public TransferToParticipantRequestInternal(CommunicationIdentifierModel targetP /// Initializes a new instance of . /// The identity of the target where call should be transferred to. - /// Used by customer to send custom calling context to targets. /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Transferee is the participant who is transferred away. /// /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. /// + /// Used by customer to send custom calling context to targets. /// The source caller Id, a phone number, that will be used as the transferor's caller Id when transferring a call to a Pstn target. - internal TransferToParticipantRequestInternal(CommunicationIdentifierModel targetParticipant, CustomCallingContextInternal customCallingContext, string operationContext, CommunicationIdentifierModel transferee, string operationCallbackUri, PhoneNumberIdentifierModel sourceCallerIdNumber) + internal TransferToParticipantRequestInternal(CommunicationIdentifierModel targetParticipant, string operationContext, CommunicationIdentifierModel transferee, string operationCallbackUri, CustomCallingContextInternal customCallingContext, PhoneNumberIdentifierModel sourceCallerIdNumber) { TargetParticipant = targetParticipant; - CustomCallingContext = customCallingContext; OperationContext = operationContext; Transferee = transferee; OperationCallbackUri = operationCallbackUri; + CustomCallingContext = customCallingContext; SourceCallerIdNumber = sourceCallerIdNumber; } /// The identity of the target where call should be transferred to. public CommunicationIdentifierModel TargetParticipant { get; } - /// Used by customer to send custom calling context to targets. - public CustomCallingContextInternal CustomCallingContext { get; set; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; set; } /// Transferee is the participant who is transferred away. @@ -55,6 +53,8 @@ internal TransferToParticipantRequestInternal(CommunicationIdentifierModel targe /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. /// public string OperationCallbackUri { get; set; } + /// Used by customer to send custom calling context to targets. + public CustomCallingContextInternal CustomCallingContext { get; set; } /// The source caller Id, a phone number, that will be used as the transferor's caller Id when transferring a call to a Pstn target. public PhoneNumberIdentifierModel SourceCallerIdNumber { get; set; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.Serialization.cs index 7f576586a689..51aab15b3037 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.Serialization.cs @@ -17,6 +17,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("locale"u8); writer.WriteStringValue(Locale); + if (Optional.IsDefined(SpeechRecognitionModelEndpointId)) + { + writer.WritePropertyName("speechRecognitionModelEndpointId"u8); + writer.WriteStringValue(SpeechRecognitionModelEndpointId); + } + if (Optional.IsDefined(OperationContext)) + { + writer.WritePropertyName("operationContext"u8); + writer.WriteStringValue(OperationContext); + } + if (Optional.IsDefined(OperationCallbackUri)) + { + writer.WritePropertyName("operationCallbackUri"u8); + writer.WriteStringValue(OperationCallbackUri); + } writer.WriteEndObject(); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.cs index 865d8725f11a..7d9fccd0ed90 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/UpdateTranscriptionRequestInternal.cs @@ -22,7 +22,32 @@ public UpdateTranscriptionRequestInternal(string locale) Locale = locale; } + /// Initializes a new instance of . + /// Defines new locale for transcription. + /// Sets Endpoint id where the custom model was deployed. + /// The value to identify context of the operation. + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + internal UpdateTranscriptionRequestInternal(string locale, string speechRecognitionModelEndpointId, string operationContext, string operationCallbackUri) + { + Locale = locale; + SpeechRecognitionModelEndpointId = speechRecognitionModelEndpointId; + OperationContext = operationContext; + OperationCallbackUri = operationCallbackUri; + } + /// Defines new locale for transcription. public string Locale { get; } + /// Sets Endpoint id where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } + /// The value to identify context of the operation. + public string OperationContext { get; set; } + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public string OperationCallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/AudioFormat.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/AudioFormat.cs new file mode 100644 index 000000000000..e2db4f8ed599 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/AudioFormat.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The states of a call. + /// + [CodeGenModel("AudioFormat", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + public readonly partial struct AudioFormat + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallAutomationModelFactory.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallAutomationModelFactory.cs index 85580a38ebb7..5a37ba64137d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallAutomationModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallAutomationModelFactory.cs @@ -13,7 +13,7 @@ namespace Azure.Communication.CallAutomation [CodeGenSuppress("CallTransferFailed", typeof(string), typeof(ResultInformation), typeof(string), typeof(string), typeof(string))] [CodeGenSuppress("ContinuousDtmfRecognitionStopped", typeof(string), typeof(ResultInformation), typeof(string), typeof(string), typeof(string))] [CodeGenSuppress("ContinuousDtmfRecognitionToneFailed", typeof(ResultInformation), typeof(string), typeof(string), typeof(string), typeof(string))] - [CodeGenSuppress("ContinuousDtmfRecognitionToneReceived", typeof(ResultInformation), typeof(int?), typeof(DtmfTone?), typeof(string), typeof(string), typeof(string), typeof(string))] + [CodeGenSuppress("ContinuousDtmfRecognitionToneReceived", typeof(int?), typeof(DtmfTone?), typeof(string), typeof(string), typeof(string), typeof(string), typeof(ResultInformation))] [CodeGenSuppress("PlayCompleted", typeof(ResultInformation), typeof(string), typeof(string), typeof(string), typeof(string))] [CodeGenSuppress("PlayFailed", typeof(string), typeof(ResultInformation), typeof(string), typeof(string), typeof(string))] [CodeGenSuppress("RecognizeFailed", typeof(string), typeof(ResultInformation), typeof(string), typeof(string), typeof(string))] @@ -52,9 +52,10 @@ public static AnswerCallResult AnswerCallResult(CallConnection callConnection = /// Source identity. /// Caller ID phone number to appear on the invitee. /// Display name to appear on the invitee. - /// The subscriptionId for Media Streaming. - /// The subscriptionId for transcription. + /// The subscription details for Media Streaming. + /// The subscription details for transcription. /// Identifier that answered the call. + /// Identity of the original Pstn target of an incoming Call. /// A new instance for mocking. public static CallConnectionProperties CallConnectionProperties( string callConnectionId = default, @@ -66,10 +67,11 @@ public static CallConnectionProperties CallConnectionProperties( PhoneNumberIdentifier sourceCallerIdNumber = default, string sourceDisplayName = default, CommunicationUserIdentifier answeredBy = default, - string mediaSubscriptionId = default, - string dataSubscriptionId = default) + MediaStreamingSubscription mediaStreamingSubscription = default, + TranscriptionSubscription transcriptionSubscription = default, + PhoneNumberIdentifier answeredFor = default) { - return new CallConnectionProperties(callConnectionId, serverCallId, targets, callConnectionState, callbackUri, sourceIdentity, sourceCallerIdNumber, sourceDisplayName, mediaSubscriptionId, dataSubscriptionId, answeredBy); + return new CallConnectionProperties(callConnectionId, serverCallId, targets, callConnectionState, callbackUri, sourceIdentity, sourceCallerIdNumber, sourceDisplayName, mediaStreamingSubscription, transcriptionSubscription, answeredBy, answeredFor); } /// Initializes a new instance of CallParticipant. @@ -130,12 +132,12 @@ private static string CreateEventSource(string callConnectionId, string eventNam public static AddParticipantFailed AddParticipantFailed(string callConnectionId = default, string serverCallId = default, string correlationId = default, string operationContext = default, ResultInformation resultInformation = default, CommunicationIdentifier participant = default) { var internalObject = new AddParticipantFailedInternal( - operationContext, - resultInformation, - participant: CommunicationIdentifierSerializer.Serialize(participant), callConnectionId, serverCallId, - correlationId + correlationId, + operationContext, + resultInformation, + participant: CommunicationIdentifierSerializer.Serialize(participant) ); return new AddParticipantFailed(internalObject); @@ -147,12 +149,12 @@ public static AddParticipantFailed AddParticipantFailed(string callConnectionId public static AddParticipantSucceeded AddParticipantSucceeded(string callConnectionId = default, string serverCallId = default, string correlationId = default, string operationContext = default, ResultInformation resultInformation = default, CommunicationIdentifier participant = default) { var internalObject = new AddParticipantSucceededInternal( - operationContext, - resultInformation, - participant: CommunicationIdentifierSerializer.Serialize(participant), callConnectionId, serverCallId, - correlationId + correlationId, + operationContext, + resultInformation, + participant: CommunicationIdentifierSerializer.Serialize(participant) ); return new AddParticipantSucceeded(internalObject); @@ -161,16 +163,17 @@ public static AddParticipantSucceeded AddParticipantSucceeded(string callConnect /// /// Initializes a new instance of Participants Updated event. /// - public static ParticipantsUpdated ParticipantsUpdated(string callConnectionId = default, string serverCallId = default, string correlationId = default, IEnumerable participants = default, int sequenceNumber = default) + public static ParticipantsUpdated ParticipantsUpdated(string callConnectionId = default, string serverCallId = default, string correlationId = default, IEnumerable participants = default, int sequenceNumber = default, ResultInformation resultInformation = null) { var internalObject = new ParticipantsUpdatedInternal( - participants == null + callConnectionId, + serverCallId, + correlationId, + sequenceNumber: sequenceNumber, + participants: participants == null ? new List() : participants.Select(p => new CallParticipantInternal(CommunicationIdentifierSerializer.Serialize(p.Identifier), p.IsMuted, p.IsOnHold)).ToList(), - sequenceNumber, - callConnectionId, - serverCallId, - correlationId + resultInformation: resultInformation ); return new ParticipantsUpdated(internalObject); @@ -182,12 +185,12 @@ public static ParticipantsUpdated ParticipantsUpdated(string callConnectionId = public static RemoveParticipantFailed RemoveParticipantFailed(string callConnectionId = default, string serverCallId = default, string correlationId = default, string operationContext = default, ResultInformation resultInformation = default, CommunicationIdentifier participant = default) { var internalObject = new RemoveParticipantFailedInternal( - operationContext, - resultInformation, - participant: CommunicationIdentifierSerializer.Serialize(participant), callConnectionId, serverCallId, - correlationId + correlationId, + operationContext, + resultInformation, + participant: CommunicationIdentifierSerializer.Serialize(participant) ); return new RemoveParticipantFailed(internalObject); @@ -199,12 +202,12 @@ public static RemoveParticipantFailed RemoveParticipantFailed(string callConnect public static RemoveParticipantSucceeded RemoveParticipantSucceeded(string callConnectionId = default, string serverCallId = default, string correlationId = default, string operationContext = default, ResultInformation resultInformation = default, CommunicationIdentifier participant = default) { var internalObject = new RemoveParticipantSucceededInternal( - operationContext, - resultInformation, - participant: CommunicationIdentifierSerializer.Serialize(participant), callConnectionId, serverCallId, - correlationId + correlationId, + operationContext, + resultInformation, + participant: CommunicationIdentifierSerializer.Serialize(participant) ); return new RemoveParticipantSucceeded(internalObject); @@ -213,14 +216,14 @@ public static RemoveParticipantSucceeded RemoveParticipantSucceeded(string callC /// Initializes a new instance of RecognizeCompletedInternal. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call corre lation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Contains the resulting SIP code/sub-code and message from NGC services. /// /// Determines the sub-type of the recognize operation. /// In case of cancel operation the this field is not set and is returned empty /// - /// Defines the result for RecognitionType = Dtmf,Choice,Speech. + /// Defines the result for general recognizeResult. /// A new instance for mocking. public static RecognizeCompleted RecognizeCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null, CallMediaRecognitionType recognitionType = default, RecognizeResult recognizeResult = null) { @@ -232,20 +235,20 @@ public static RecognizeCompleted RecognizeCompleted(string callConnectionId = nu /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. - /// Transferee is the participant who is transferring the call. - /// The identity of the target where call should be transferred to. + /// Contains the resulting SIP code, sub-code and message. + /// Target who the call is transferred to. + /// the participant who is being transferred away. /// A new instance for mocking. public static CallTransferAccepted CallTransferAccepted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null, CommunicationIdentifier transferee = null, CommunicationIdentifier transferTarget = null) { - var internalEvent = new CallTransferAcceptedInternal( - operationContext, - resultInformation, - transferTarget == null ? null : CommunicationIdentifierSerializer.Serialize(transferTarget), - transferee == null ? null : CommunicationIdentifierSerializer.Serialize(transferee), + var internalEvent = new CallTransferAcceptedInternal( callConnectionId, serverCallId, - correlationId + correlationId, + operationContext, + resultInformation, + transferTarget: transferTarget == null ? null : CommunicationIdentifierSerializer.Serialize(transferTarget), + transferee: transferee == null ? null : CommunicationIdentifierSerializer.Serialize(transferee) ); return new CallTransferAccepted(internalEvent); } @@ -258,17 +261,17 @@ public static CancelAddParticipantSucceeded CancelAddParticipantSucceeded( string serverCallId = default, string correlationId = default, string invitationId = default, - CommunicationIdentifier participant = default, string operationContext = default, - ResultInformation resultInformation = default) + ResultInformation resultInformation = null) { var internalObject = new CancelAddParticipantSucceededInternal( - invitationId, - operationContext, - resultInformation, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + invitationId: invitationId, + resultInformation: resultInformation + ); return new CancelAddParticipantSucceeded(internalObject); } @@ -285,34 +288,14 @@ public static CancelAddParticipantFailed CancelAddParticipantFailed( string operationContext = default) { var internalObject = new CancelAddParticipantFailedInternal( - operationContext, - resultInformation, - invitationId, callConnectionId, serverCallId, - correlationId); - - return new CancelAddParticipantFailed(internalObject); - } - - /// - /// Initializes a new instance of create call failed event. - /// - public static CreateCallFailed CreateCallFailed( - string callConnectionId = default, - string serverCallId = default, - string correlationId = default, - ResultInformation resultInformation = default, - string operationContext = default) - { - var internalObject = new CreateCallFailedInternal( + correlationId, operationContext, resultInformation, - callConnectionId, - serverCallId, - correlationId); + invitationId: invitationId); - return new CreateCallFailed(internalObject); + return new CancelAddParticipantFailed(internalObject); } /// @@ -326,11 +309,11 @@ public static AnswerFailed AnswerFailed( string operationContext = default) { var internalObject = new AnswerFailedInternal( - operationContext, - resultInformation, callConnectionId, serverCallId, - correlationId); + correlationId, + operationContext, + resultInformation); return new AnswerFailed(internalObject); } @@ -339,84 +322,100 @@ public static AnswerFailed AnswerFailed( /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Used by customers to set the context for creating a new call. This property will be null for answering a call. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) + public static CallConnected CallConnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new CallConnected(operationContext, callConnectionId, serverCallId, correlationId); + return new CallConnected(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } + ///// Initializes a new instance of CallConnected. + ///// Call connection ID. + ///// Server call ID. + ///// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + ///// Used by customers to set the context for creating a new call. This property will be null for answering a call. + ///// /// Contains the resulting SIP code, sub-code and message. + ///// A new instance for mocking. + //public static ConnectFailed ConnectFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) + //{ + // return new ConnectFailed(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + //} + /// Initializes a new instance of CallDisconnected. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Used by customers to set the context for creating a new call. This property will be null for answering a call. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) + public static CallDisconnected CallDisconnected(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new CallDisconnected(operationContext, callConnectionId, serverCallId, correlationId); + return new CallDisconnected(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Initializes a new instance of CallTransferFailed. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. public static CallTransferFailed CallTransferFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new CallTransferFailed(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new CallTransferFailed(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Initializes a new instance of ContinuousDtmfRecognitionStopped. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. public static ContinuousDtmfRecognitionStopped ContinuousDtmfRecognitionStopped(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new ContinuousDtmfRecognitionStopped(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + return new ContinuousDtmfRecognitionStopped(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Initializes a new instance of ContinuousDtmfRecognitionToneFailed. - /// Result information defines the code, subcode and message. - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Contains the resulting SIP code, sub-code and message. + /// Used by customers when calling mid-call actions to correlate the request to the response event. /// A new instance for mocking. public static ContinuousDtmfRecognitionToneFailed ContinuousDtmfRecognitionToneFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, ResultInformation resultInformation = null, string operationContext = null) { - return new ContinuousDtmfRecognitionToneFailed(resultInformation, operationContext, callConnectionId, serverCallId, correlationId); + return new ContinuousDtmfRecognitionToneFailed(callConnectionId, serverCallId, correlationId, resultInformation, operationContext); } /// Initializes a new instance of ContinuousDtmfRecognitionToneReceived. - /// Result information defines the code, subcode and message. - /// Define the information for a tone. - /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. + /// /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// + /// Correlation ID for event to call correlation. Also called ChainId or skype chain ID. + /// Contains the resulting SIP code, sub-code and message. + /// Used by customers when calling mid-call actions to correlate the request to the response event. /// A new instance for mocking. public static ContinuousDtmfRecognitionToneReceived ContinuousDtmfRecognitionToneReceived(int? sequenceId = null, DtmfTone? tone = null, string callConnectionId = null, string serverCallId = null, string correlationId = null, ResultInformation resultInformation = null, string operationContext = null) { - return new ContinuousDtmfRecognitionToneReceived(resultInformation, sequenceId, tone, operationContext, callConnectionId, serverCallId, correlationId); + return new ContinuousDtmfRecognitionToneReceived(sequenceId, tone, callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Initializes a new instance of PlayCompleted. - /// Result information defines the code, subcode and message. - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. public static PlayCompleted PlayCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new PlayCompleted(resultInformation, operationContext, callConnectionId, serverCallId, correlationId); + var internalObject = new PlayCompletedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + + return new PlayCompleted(internalObject); } /// Initializes a new instance of PlayFailed. @@ -425,32 +424,49 @@ public static PlayCompleted PlayCompleted(string callConnectionId = null, string /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// A new instance for mocking. - public static PlayFailed PlayFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) + public static PlayFailed PlayFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null, int? failedPlaySourceIndex = null) { - return new PlayFailed(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + var internalObject = new PlayFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation, failedPlaySourceIndex); + + return new PlayFailed(internalObject); } + ///// Initializes a new instance of PlayFailed. + ///// Used by customers when calling mid-call actions to correlate the request to the response event. + ///// Contains the resulting SIP code, sub-code and message. + ///// Call connection ID. + ///// Server call ID. + ///// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + ///// A new instance for mocking. + //public static PlayStarted PlayStarted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) + //{ + // return new PlayStarted(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + //} + /// Initializes a new instance of PlayCanceled. - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static PlayCanceled PlayCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) + public static PlayCanceled PlayCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new PlayCanceled(operationContext, callConnectionId, serverCallId, correlationId); + return new PlayCanceled(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Initializes a new instance of RecognizeCanceled. - /// Used by customers when calling mid-call actions to correlate the request to the response event. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static RecognizeCanceled RecognizeCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null) + public static RecognizeCanceled RecognizeCanceled(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new RecognizeCanceled(operationContext, callConnectionId, serverCallId, correlationId); + return new RecognizeCanceled(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); } /// Initializes a new instance of RecognizeFailed. @@ -459,64 +475,94 @@ public static RecognizeCanceled RecognizeCanceled(string callConnectionId = null /// Call connection ID. /// Server call ID. /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. /// A new instance for mocking. - public static RecognizeFailed RecognizeFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) + public static RecognizeFailed RecognizeFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null, int? failedPlaySourceIndex = null) { - return new RecognizeFailed(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + var internalObject = new RecognizeFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation, failedPlaySourceIndex); + + return new RecognizeFailed(internalObject); } /// Initializes a new instance of RecordingStateChanged. + /// Call connection ID. + /// Server call ID. + /// Correlation ID for event to call correlation. /// The call recording id. /// /// The time of the recording started. /// - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. - public static RecordingStateChanged RecordingStateChanged(string callConnectionId = null, string serverCallId = null, string correlationId = null, string recordingId = null, RecordingState state = default, DateTimeOffset? startDateTime = null, RecordingKind? recordingKind = null) + public static RecordingStateChanged RecordingStateChanged(string callConnectionId = null, string serverCallId = null, string correlationId = null, string recordingId = null, RecordingState state = default, DateTimeOffset? startDateTime = null, RecordingKind? recordingKind = null, ResultInformation resultInformation = null) { - return new RecordingStateChanged(recordingId, state, startDateTime, recordingKind, callConnectionId, serverCallId, correlationId); + return new RecordingStateChanged(callConnectionId, serverCallId, correlationId, recordingId, state: state, startDateTime: startDateTime, recordingKind, resultInformation); + } + + /// Initializes a new instance of RecordingStateResult. + /// + /// + /// + /// A new instance for mocking. + public static RecordingStateResult RecordingStateResult(string recordingId = null, RecordingState? recordingState = null, RecordingKind? recordingKind = null) + { + return new RecordingStateResult(recordingId: recordingId, recordingState: recordingState, recordingKind: recordingKind); } /// Initializes a new instance of SendDtmfTonesCompleted. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. public static SendDtmfTonesCompleted SendDtmfTonesCompleted(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - var internalObject = new SendDtmfTonesCompletedInternal(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + var internalObject = new SendDtmfTonesCompletedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); return new SendDtmfTonesCompleted(internalObject); } /// Initializes a new instance of SendDtmfTonesFailed. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. public static SendDtmfTonesFailed SendDtmfTonesFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - var internalObject = new SendDtmfTonesFailedInternal(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + var internalObject = new SendDtmfTonesFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); return new SendDtmfTonesFailed(internalObject); } /// Initializes a new instance of HoldFailed. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code, sub-code and message. /// Call connection ID. /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. + /// Correlation ID for event to call correlation. + /// Used by customers when calling mid-call actions to correlate the request to the response event. + /// Contains the resulting SIP code, sub-code and message. /// A new instance for mocking. public static HoldFailed HoldFailed(string callConnectionId = null, string serverCallId = null, string correlationId = null, string operationContext = null, ResultInformation resultInformation = null) { - return new HoldFailed(operationContext, resultInformation, callConnectionId, serverCallId, correlationId); + var internalObject = new HoldFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + + return new HoldFailed(internalObject); + } + + /// + /// Initializes a new instance of create call failed event. + /// + public static CreateCallFailed CreateCallFailed( + string callConnectionId = default, + string serverCallId = default, + string correlationId = default, + ResultInformation resultInformation = default, + string operationContext = default) + { + var createdCallFailedInternal = new CreateCallFailedInternal(callConnectionId, serverCallId, correlationId, operationContext, resultInformation); + return new CreateCallFailed(createdCallFailedInternal); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallConnectionProperties.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallConnectionProperties.cs index cb2b5800decc..0b002c74f7d5 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallConnectionProperties.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallConnectionProperties.cs @@ -19,9 +19,10 @@ internal CallConnectionProperties( CommunicationIdentifier source, PhoneNumberIdentifier sourceCallerIdNumber, string sourceDisplayName, - string mediaSubscriptionId, - string dataSubscriptionId, - CommunicationUserIdentifier answeredBy + MediaStreamingSubscription mediaStreamingSubscription, + TranscriptionSubscription transcriptionSubscription, + CommunicationUserIdentifier answeredBy, + PhoneNumberIdentifier answeredFor ) { CallConnectionId = callConnectionId; @@ -32,9 +33,10 @@ CommunicationUserIdentifier answeredBy Source = source; SourceCallerIdNumber = sourceCallerIdNumber; SourceDisplayName = sourceDisplayName; - MediaSubscriptionId = mediaSubscriptionId; - DataSubscriptionId = dataSubscriptionId; + MediaStreamingSubscription = mediaStreamingSubscription; + TranscriptionSubscription = transcriptionSubscription; AnsweredBy = answeredBy; + AnsweredFor = answeredFor; } internal CallConnectionProperties(CallConnectionPropertiesInternal callConnectionPropertiesDtoInternal) @@ -43,7 +45,7 @@ internal CallConnectionProperties(CallConnectionPropertiesInternal callConnectio ServerCallId = callConnectionPropertiesDtoInternal.ServerCallId; Targets = callConnectionPropertiesDtoInternal.Targets.Select(t => CommunicationIdentifierSerializer.Deserialize(t)).ToList(); - if (callConnectionPropertiesDtoInternal.CallConnectionState == null || callConnectionPropertiesDtoInternal.CallConnectionState == default(CallConnectionState)) + if (callConnectionPropertiesDtoInternal.CallConnectionState == null || callConnectionPropertiesDtoInternal.CallConnectionState == default(CallConnectionState)) { CallConnectionState = CallConnectionState.Unknown; } @@ -53,17 +55,32 @@ internal CallConnectionProperties(CallConnectionPropertiesInternal callConnectio } CallbackUri = new Uri(callConnectionPropertiesDtoInternal.CallbackUri); - MediaSubscriptionId = callConnectionPropertiesDtoInternal.MediaSubscriptionId; - DataSubscriptionId = callConnectionPropertiesDtoInternal.DataSubscriptionId; - Source = callConnectionPropertiesDtoInternal.Source == null? null : CommunicationIdentifierSerializer.Deserialize(callConnectionPropertiesDtoInternal.Source); + MediaStreamingSubscription = callConnectionPropertiesDtoInternal.MediaStreamingSubscription != null ? + new MediaStreamingSubscription( + callConnectionPropertiesDtoInternal.MediaStreamingSubscription.Id, + callConnectionPropertiesDtoInternal.MediaStreamingSubscription.State, + callConnectionPropertiesDtoInternal.MediaStreamingSubscription.SubscribedContentTypes) + : null; + TranscriptionSubscription = callConnectionPropertiesDtoInternal.TranscriptionSubscription != null ? + new TranscriptionSubscription( + callConnectionPropertiesDtoInternal.TranscriptionSubscription.Id, + callConnectionPropertiesDtoInternal.TranscriptionSubscription.State, + callConnectionPropertiesDtoInternal.TranscriptionSubscription.SubscribedResultTypes) + : null; + Source = callConnectionPropertiesDtoInternal.Source == null ? null : CommunicationIdentifierSerializer.Deserialize(callConnectionPropertiesDtoInternal.Source); SourceDisplayName = callConnectionPropertiesDtoInternal.SourceDisplayName; CorrelationId = callConnectionPropertiesDtoInternal.CorrelationId; - AnsweredBy = callConnectionPropertiesDtoInternal.AnsweredBy == null? null : new CommunicationUserIdentifier(callConnectionPropertiesDtoInternal.AnsweredBy.Id); + AnsweredBy = callConnectionPropertiesDtoInternal.AnsweredBy == null ? null : new CommunicationUserIdentifier(callConnectionPropertiesDtoInternal.AnsweredBy.Id); if (callConnectionPropertiesDtoInternal.SourceCallerIdNumber != null) { SourceCallerIdNumber = new PhoneNumberIdentifier(callConnectionPropertiesDtoInternal.SourceCallerIdNumber.Value); } + + if (callConnectionPropertiesDtoInternal.AnsweredFor != null) + { + AnsweredFor = new PhoneNumberIdentifier(callConnectionPropertiesDtoInternal.AnsweredFor.Value); + } } /// The call connection id. @@ -77,9 +94,9 @@ internal CallConnectionProperties(CallConnectionPropertiesInternal callConnectio /// The callback URI. public Uri CallbackUri { get; } /// SubscriptionId for media streaming. - public string MediaSubscriptionId { get; } + public MediaStreamingSubscription MediaStreamingSubscription { get; } /// SubscriptionId for transcription. - public string DataSubscriptionId { get; } + public TranscriptionSubscription TranscriptionSubscription { get; } /// /// Caller ID phone number to appear on the invitee. /// @@ -102,5 +119,10 @@ internal CallConnectionProperties(CallConnectionPropertiesInternal callConnectio /// Identity of the answering entity. Only populated when identity is provided in the request. /// public CommunicationUserIdentifier AnsweredBy { get; } + + /// + /// Identity of the original Pstn target of an incoming Call. Only populated when the original target is a Pstn number. + /// + public PhoneNumberIdentifier AnsweredFor { get; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallInvite.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallInvite.cs index 0546eb7207a5..940dad387e2d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallInvite.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallInvite.cs @@ -12,6 +12,7 @@ public class CallInvite { /// /// Creates a new CallInvite object. + /// When the source of the call is a Teams App source, callerIdNumber is not supported and should be null. /// /// /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallLocatorSerializer.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallLocatorSerializer.cs index b5fa5f59f2ce..7aea6e214fa5 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallLocatorSerializer.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallLocatorSerializer.cs @@ -21,6 +21,11 @@ internal static CallLocatorInternal Serialize(CallLocator identifier) GroupCallId = groupCallLocator.Id, Kind = CallLocatorKindInternal.GroupCallLocator, }, + RoomCallLocator roomCallLocator => new CallLocatorInternal + { + RoomId = roomCallLocator.Id, + Kind = CallLocatorKindInternal.RoomCallLocator, + }, _ => throw new NotSupportedException(), }; @@ -37,6 +42,9 @@ public static CallLocator Deserialize(CallLocatorInternal identifier) if (identifier.Kind.Value == CallLocatorKindInternal.GroupCallLocator) return new GroupCallLocator(AssertNotNull(identifier.GroupCallId, nameof(identifier.GroupCallId), nameof(identifier.GroupCallId))); + if (identifier.Kind.Value == CallLocatorKindInternal.RoomCallLocator) + return new RoomCallLocator(AssertNotNull(identifier.RoomId, nameof(identifier.RoomId), nameof(identifier.RoomId))); + throw new JsonException("Unknown type present in CallLocatorModel"); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallMediaRecognizeOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallMediaRecognizeOptions.cs index 613d85059f6b..d94e34dfacdd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallMediaRecognizeOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CallMediaRecognizeOptions.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; namespace Azure.Communication.CallAutomation { @@ -43,6 +44,11 @@ protected CallMediaRecognizeOptions(RecognizeInputType inputType, CommunicationI /// public PlaySource Prompt { get; set; } + /// + /// PlaySource objects representing the sources to play. + /// + public IList PlayPrompts { get; set; } + /// /// Determines if we interrupt the prompt and start recognizing. /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectCallOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectCallOptions.cs new file mode 100644 index 000000000000..6fb9dc41aeb7 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectCallOptions.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Options for creating a call. + /// + public class ConnectCallOptions + { + /// + /// Creates a new instance of ConnectOptions. + /// + /// + /// + public ConnectCallOptions(CallLocator callLocator, Uri callbackUri) + { + CallLocator = callLocator; + CallbackUri = callbackUri; + } + + /// + /// Either a GroupCallLocator or ServerCallLocator or RoomCallLocator for locating the call. + /// + public CallLocator CallLocator { get; } + + /// + /// The callback URL. + /// + public Uri CallbackUri { get; } + + /// + /// Used by customers to correlate the request to the response event. + /// + public string OperationContext { get; set; } + + /// + /// Media Streaming Configuration. + /// + public MediaStreamingOptions MediaStreamingOptions { get; set; } + + /// + /// Live Transcription Configuration. + /// + public TranscriptionOptions TranscriptionOptions { get; set; } + + /// + /// AI options for the call. + /// + public CallIntelligenceOptions CallIntelligenceOptions { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectCallResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectCallResult.cs new file mode 100644 index 000000000000..dfdc42c4ce7e --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectCallResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.Communication.CallAutomation +{ + /// The result from connect request. + public class ConnectCallResult + { + private CallAutomationEventProcessor _evHandler; + private string _callConnectionId; + + internal ConnectCallResult(CallConnectionProperties callConnectionProperties, CallConnection callConnection) + { + CallConnectionProperties = callConnectionProperties; + CallConnection = callConnection; + } + + internal void SetEventProcessor(CallAutomationEventProcessor evHandler, string callConnectionId) + { + _evHandler = evHandler; + _callConnectionId = callConnectionId; + } + + /// CallConnection instance. + public CallConnection CallConnection { get; } + + /// Properties of the call. + public CallConnectionProperties CallConnectionProperties { get; } + + /// + /// This is blocking call. Wait for using . + /// + /// Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor. + /// Returns which contains event. + public ConnectCallEventResult WaitForEventProcessor(CancellationToken cancellationToken = default) + { + if (_evHandler is null) + { + throw new NullReferenceException(nameof(_evHandler)); + } + + var returnedEvent = _evHandler.WaitForEventProcessor(filter + => filter.CallConnectionId == _callConnectionId + && (filter.GetType() == typeof(ConnectFailed)), + cancellationToken); + + return SetReturnedEvent(returnedEvent); + } + + /// + /// Wait for using . + /// + /// Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor. + /// Returns which contains event. + public async Task WaitForEventProcessorAsync(CancellationToken cancellationToken = default) + { + if (_evHandler is null) + { + throw new NullReferenceException(nameof(_evHandler)); + } + + var returnedEvent = await _evHandler.WaitForEventProcessorAsync(filter + => filter.CallConnectionId == _callConnectionId + && (filter.GetType() == typeof(ConnectFailed)), + cancellationToken).ConfigureAwait(false); + + return SetReturnedEvent(returnedEvent); + } + + private static ConnectCallEventResult SetReturnedEvent(CallAutomationEventBase returnedEvent) + { + return new ConnectCallEventResult(true, (ConnectFailed)returnedEvent, (CallConnected)returnedEvent); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectFailed.cs new file mode 100644 index 000000000000..fa49385465f5 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectFailed.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The Connect Failed event. + /// + [CodeGenModel("ConnectFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + public partial class ConnectFailed : CallAutomationEventBase + { + /// + /// Deserialize event. + /// + /// The json content. + /// The new object. + public static ConnectFailed Deserialize(string content) + { + using var document = JsonDocument.Parse(content); + JsonElement element = document.RootElement; + + // return DeserializeConnectFailed(element); + return null; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectRequestInternal.cs new file mode 100644 index 000000000000..55c02b468bc1 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/ConnectRequestInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("ConnectRequest")] + internal partial class ConnectRequestInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateCallOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateCallOptions.cs index ae413ec225a0..3c7891858d5a 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateCallOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateCallOptions.cs @@ -49,5 +49,12 @@ public CreateCallOptions(CallInvite callInvite, Uri callbackUri) /// AI options for the call such as endpoint URI of the Azure Cognitive Services resource /// public CallIntelligenceOptions CallIntelligenceOptions { get; set; } + + /// + /// Overrides default client source by a MicrosoftTeamsAppIdentifier type source. + /// Required for creating call with Teams resource account ID. + /// This is per-operation setting and does not change the client's default source. + /// + public MicrosoftTeamsAppIdentifier TeamsAppSource { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateGroupCallOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateGroupCallOptions.cs index c473fd7bdfc9..edf4aa3a8934 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateGroupCallOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CreateGroupCallOptions.cs @@ -66,5 +66,12 @@ public CreateGroupCallOptions(IEnumerable targets, Uri /// The Custom Context which contains SIP and voip headers. /// public CustomCallingContext CustomCallingContext { get; } + + /// + /// Overrides default client source by a MicrosoftTeamsAppIdentifier type source. + /// Required for creating call with Teams resource account ID. + /// This is per-operation setting and does not change the client's default source. + /// + public MicrosoftTeamsAppIdentifier TeamsAppSource { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CustomCallingContextInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CustomCallingContextInternal.cs index 03383a8306e1..03310ccb122c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/CustomCallingContextInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/CustomCallingContextInternal.cs @@ -7,7 +7,7 @@ namespace Azure.Communication.CallAutomation { - [CodeGenModel("CustomCallingContext")] + [CodeGenModel("CustomCallingContext", Usage = new string[] { "output" }, Formats = new string[] { "json" })] internal partial class CustomCallingContextInternal { public CustomCallingContextInternal(IDictionary sipHeaders, IDictionary voipHeaders) diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallAutomationEventParser.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallAutomationEventParser.cs index fef569f85263..3c512788c273 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallAutomationEventParser.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CallAutomationEventParser.cs @@ -98,6 +98,8 @@ private static CallAutomationEventBase Deserialize(string eventData, string type return AddParticipantSucceeded.Deserialize(eventData); case nameof(CallConnected): return CallConnected.Deserialize(eventData); + case nameof(ConnectFailed): + return ConnectFailed.Deserialize(eventData); case nameof(CallDisconnected): return CallDisconnected.Deserialize(eventData); case nameof(CallTransferAccepted): @@ -146,6 +148,8 @@ private static CallAutomationEventBase Deserialize(string eventData, string type return TranscriptionStopped.Deserialize(eventData); case nameof(TranscriptionFailed): return TranscriptionFailed.Deserialize(eventData); + case nameof(PlayStarted): + return PlayStarted.Deserialize(eventData); case nameof(AnswerFailed): return AnswerFailed.Deserialize(eventData); case nameof(CreateCallFailed): @@ -178,6 +182,10 @@ private static CallAutomationEventBase Deserialize(string eventData, string type case nameof(DialogUpdated): return DialogUpdated.Deserialize(eventData); #endregion + #region Incoming Call + case nameof(IncomingCall): + return IncomingCall.Deserialize(eventData); + #endregion default: return null; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CollectTonesResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CollectTonesResult.cs deleted file mode 100644 index 5037871e2d4d..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/CollectTonesResult.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.Communication.CallAutomation -{ - [CodeGenModel("CollectTonesResult", Usage = new string[] { "output" }, Formats = new string[] { "json" })] - public partial class CollectTonesResult : RecognizeResult - { - /// - /// The Tones colelcted. - /// - [CodeGenMember("Tones")] - public IReadOnlyList Tones { get; } - - /// - /// The RecognizeResultType of this RecognizeResult. - /// - public override RecognizeResultType ResultType => RecognizeResultType.CollectTonesResult; - - /// - /// Convert the collection of tones to a string like "12345#". - /// - public string ConvertToString() - { - return string.Join("", Tones.Select(x => x.ToChar())); - } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailed.cs index 8e0839ace51b..9449ca356ffc 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailed.cs @@ -9,7 +9,6 @@ namespace Azure.Communication.CallAutomation /// /// The Hold Failed event. /// - [CodeGenModel("HoldFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class HoldFailed : CallAutomationEventBase { /// @@ -18,19 +17,15 @@ public partial class HoldFailed : CallAutomationEventBase public MediaEventReasonCode ReasonCode { get; internal set; } /// Initializes a new instance of HoldFailed. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. - internal HoldFailed(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// HoldFailedInternal event. + internal HoldFailed(HoldFailedInternal internalEvent) { - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; - OperationContext = operationContext; - ResultInformation = resultInformation; - ReasonCode = new MediaEventReasonCode(resultInformation.SubCode.ToString()); + CallConnectionId = internalEvent.CallConnectionId; + ServerCallId = internalEvent.ServerCallId; + CorrelationId = internalEvent.CorrelationId; + OperationContext = internalEvent.OperationContext; + ResultInformation = internalEvent.ResultInformation; + ReasonCode = new MediaEventReasonCode(ResultInformation.SubCode.ToString()); } /// @@ -43,7 +38,7 @@ public static HoldFailed Deserialize(string content) using var document = JsonDocument.Parse(content); JsonElement element = document.RootElement; - return DeserializeHoldFailed(element); + return new HoldFailed(HoldFailedInternal.DeserializeHoldFailedInternal(element)); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailedInternal.cs new file mode 100644 index 000000000000..4e1888b6efbf --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/HoldFailedInternal.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The recognize completed event internal. + /// + [CodeGenModel("HoldFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + internal partial class HoldFailedInternal : CallAutomationEventBase + { + /// + /// Reason code. + /// + public MediaEventReasonCode ReasonCode { get; internal set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCall.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCall.cs new file mode 100644 index 000000000000..ee51109282c4 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCall.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The add participant failed event. + /// + public class IncomingCall : CallAutomationEventBase + { + /// Initializes a new instance of . + internal IncomingCall() + { + } + + /// Initializes a new instance of . + /// Internal Representation of the IncomingCall. + internal IncomingCall(IncomingCallInternal internalEvent) + { + To = CommunicationIdentifierSerializer.Deserialize(internalEvent.To); + From = CommunicationIdentifierSerializer.Deserialize(internalEvent.From); + ServerCallId = internalEvent.ServerCallId; + CallerDisplayName = internalEvent.CallerDisplayName; + CustomContext = new CustomCallingContext(internalEvent.CustomContext.SipHeaders, internalEvent.CustomContext.VoipHeaders); + IncomingCallContext = internalEvent.IncomingCallContext; + + if (internalEvent.OnBehalfOfCallee != null) + { + OnBehalfOfCallee = CommunicationIdentifierSerializer.Deserialize(internalEvent.OnBehalfOfCallee); + } + + CorrelationId = internalEvent.CorrelationId; + } + + /// The communication identifier of the target user. + public CommunicationIdentifier To { get; } + /// The communication identifier of the user who initiated the call. + public CommunicationIdentifier From { get; } + /// Display name of caller. + public string CallerDisplayName { get; } + /// Custom Context of Incoming Call. + public CustomCallingContext CustomContext { get; } + /// Incoming call context. + public string IncomingCallContext { get; } + /// The communication identifier of the user on behalf of whom the call is made. + public CommunicationIdentifier OnBehalfOfCallee { get; } + + /// + /// Deserialize event. + /// + /// The json content. + /// The new object. + public static IncomingCall Deserialize(string content) + { + using var document = JsonDocument.Parse(content); + JsonElement element = document.RootElement; + + var internalEvent = IncomingCallInternal.DeserializeIncomingCallInternal(element); + return new IncomingCall(internalEvent); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCallInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCallInternal.cs new file mode 100644 index 000000000000..249bfe0f9fb7 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/IncomingCallInternal.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The incoming call event internal. + /// + [CodeGenModel("IncomingCall", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + internal partial class IncomingCallInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompleted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompleted.cs index e3b0b52db6a9..235c2097a344 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompleted.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompleted.cs @@ -9,7 +9,6 @@ namespace Azure.Communication.CallAutomation /// /// The play completed event. /// - [CodeGenModel("PlayCompleted", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class PlayCompleted : CallAutomationEventBase { /// @@ -18,19 +17,15 @@ public partial class PlayCompleted : CallAutomationEventBase public MediaEventReasonCode ReasonCode { get; internal set; } /// Initializes a new instance of PlayCompleted. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. - internal PlayCompleted(ResultInformation resultInformation, string operationContext, string callConnectionId, string serverCallId, string correlationId) + /// PlayCompletedInternal event. + internal PlayCompleted(PlayCompletedInternal internalEvent) { - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; - OperationContext = operationContext; - ResultInformation = resultInformation; - ReasonCode = new MediaEventReasonCode(resultInformation.SubCode.ToString()); + CallConnectionId = internalEvent.CallConnectionId; + ServerCallId = internalEvent.ServerCallId; + CorrelationId = internalEvent.CorrelationId; + OperationContext = internalEvent.OperationContext; + ResultInformation = internalEvent.ResultInformation; + ReasonCode = new MediaEventReasonCode(ResultInformation.SubCode.ToString()); } /// @@ -43,7 +38,7 @@ public static PlayCompleted Deserialize(string content) using var document = JsonDocument.Parse(content); JsonElement element = document.RootElement; - return DeserializePlayCompleted(element); + return new PlayCompleted(PlayCompletedInternal.DeserializePlayCompletedInternal(element)); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompletedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompletedInternal.cs new file mode 100644 index 000000000000..a7a9872ee338 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayCompletedInternal.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The recognize completed event internal. + /// + [CodeGenModel("PlayCompleted", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + internal partial class PlayCompletedInternal : CallAutomationEventBase + { + /// + /// Reason code. + /// + public MediaEventReasonCode ReasonCode { get; internal set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailed.cs index fe40d5f574d0..22d639ee2c9c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailed.cs @@ -9,7 +9,6 @@ namespace Azure.Communication.CallAutomation /// /// The Play Failed event. /// - [CodeGenModel("PlayFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class PlayFailed : CallAutomationEventBase { /// @@ -17,20 +16,20 @@ public partial class PlayFailed : CallAutomationEventBase /// public MediaEventReasonCode ReasonCode { get; internal set; } + /// Contains the index of the failed play source. + public int? FailedPlaySourceIndex { get; internal set; } + /// Initializes a new instance of PlayFailed. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. - internal PlayFailed(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// PlayFailedInternal event. + internal PlayFailed(PlayFailedInternal internalEvent) { - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; - OperationContext = operationContext; - ResultInformation = resultInformation; - ReasonCode = new MediaEventReasonCode(resultInformation.SubCode.ToString()); + CallConnectionId = internalEvent.CallConnectionId; + ServerCallId = internalEvent.ServerCallId; + CorrelationId = internalEvent.CorrelationId; + OperationContext = internalEvent.OperationContext; + ResultInformation = internalEvent.ResultInformation; + ReasonCode = new MediaEventReasonCode(ResultInformation.SubCode.ToString()); + FailedPlaySourceIndex = internalEvent.FailedPlaySourceIndex; } /// @@ -43,7 +42,7 @@ public static PlayFailed Deserialize(string content) using var document = JsonDocument.Parse(content); JsonElement element = document.RootElement; - return DeserializePlayFailed(element); + return new PlayFailed(PlayFailedInternal.DeserializePlayFailedInternal(element)); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailedInternal.cs new file mode 100644 index 000000000000..980f2440aad2 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayFailedInternal.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The recognize completed event internal. + /// + [CodeGenModel("PlayFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + internal partial class PlayFailedInternal : CallAutomationEventBase + { + /// + /// Reason code. + /// + public MediaEventReasonCode ReasonCode { get; internal set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayStarted.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayStarted.cs new file mode 100644 index 000000000000..3fc5a141ac8a --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/PlayStarted.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The Play Started event. + /// + [CodeGenModel("PlayStarted", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + public partial class PlayStarted : CallAutomationEventBase + { + /// + /// Deserialize event. + /// + /// The json content. + /// The new object. + public static PlayStarted Deserialize(string content) + { + using var document = JsonDocument.Parse(content); + JsonElement element = document.RootElement; + + return DeserializePlayStarted(element); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailed.cs index a94ba4d6fb90..2e063d8583ed 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailed.cs @@ -9,7 +9,6 @@ namespace Azure.Communication.CallAutomation /// /// The Recognize failed event. /// - [CodeGenModel("RecognizeFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class RecognizeFailed : CallAutomationEventBase { /// @@ -17,20 +16,20 @@ public partial class RecognizeFailed : CallAutomationEventBase /// public MediaEventReasonCode ReasonCode { get; internal set; } + /// Contains the index of the failed play source. + public int? FailedPlaySourceIndex { get; internal set; } + /// Initializes a new instance of RecognizeFailed. - /// Call connection ID. - /// Server call ID. - /// Correlation ID for event to call correlation. Also called ChainId for skype chain ID. - /// Used by customers when calling mid-call actions to correlate the request to the response event. - /// Contains the resulting SIP code/sub-code and message from NGC services. - internal RecognizeFailed(string operationContext, ResultInformation resultInformation, string callConnectionId, string serverCallId, string correlationId) + /// RecognizeFailedInternal event + internal RecognizeFailed(RecognizeFailedInternal internalEvent) { - CallConnectionId = callConnectionId; - ServerCallId = serverCallId; - CorrelationId = correlationId; - OperationContext = operationContext; - ResultInformation = resultInformation; - ReasonCode = new MediaEventReasonCode(resultInformation.SubCode.ToString()); + CallConnectionId = internalEvent.CallConnectionId; + ServerCallId = internalEvent.ServerCallId; + CorrelationId = internalEvent.CorrelationId; + OperationContext = internalEvent.OperationContext; + ResultInformation = internalEvent.ResultInformation; + ReasonCode = new MediaEventReasonCode(ResultInformation.SubCode.ToString()); + FailedPlaySourceIndex = internalEvent.FailedPlaySourceIndex; } /// @@ -43,7 +42,7 @@ public static RecognizeFailed Deserialize(string content) using var document = JsonDocument.Parse(content); JsonElement element = document.RootElement; - return DeserializeRecognizeFailed(element); + return new RecognizeFailed(RecognizeFailedInternal.DeserializeRecognizeFailedInternal(element)); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailedInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailedInternal.cs new file mode 100644 index 000000000000..3453a083beae --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/RecognizeFailedInternal.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The recognize completed event internal. + /// + [CodeGenModel("RecognizeFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + internal partial class RecognizeFailedInternal : CallAutomationEventBase + { + /// + /// Reason code. + /// + public MediaEventReasonCode ReasonCode { get; internal set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/TranscriptionFailed.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/TranscriptionFailed.cs index 9b5dd5baa4e2..54ab3e315b2d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/TranscriptionFailed.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Events/TranscriptionFailed.cs @@ -13,6 +13,11 @@ namespace Azure.Communication.CallAutomation [CodeGenModel("TranscriptionFailed", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class TranscriptionFailed : CallAutomationEventBase { + /// + /// Reason code. + /// + public MediaEventReasonCode ReasonCode { get; internal set; } + /// /// Deserialize event. /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldOptions.cs index bfaec92d42f6..e0abe4cd6b53 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldOptions.cs @@ -26,7 +26,7 @@ public HoldOptions(CommunicationIdentifier targetParticipant) /// /// Prompt to play while on hold. /// - public PlaySource PlaySourceInfo { get; set; } + public PlaySource PlaySource { get; set; } /// /// The operation context to correlate the request to the response event. diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldResult.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldResult.cs new file mode 100644 index 000000000000..6f299ff1c513 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/HoldResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using System; +using System.Threading; + +namespace Azure.Communication.CallAutomation +{ + /// The result from playing audio. + public class HoldResult + { + private CallAutomationEventProcessor _evHandler; + private string _callConnectionId; + private string _operationContext; + + internal HoldResult() + { + } + + internal void SetEventProcessor(CallAutomationEventProcessor evHandler, string callConnectionId, string operationContext) + { + _evHandler = evHandler; + _callConnectionId = callConnectionId; + _operationContext = operationContext; + } + + /// + /// This is blocking call. Wait for using . + /// + /// Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor. + /// Returns which contains either event or event. + public HoldEventResult WaitForEventProcessor(CancellationToken cancellationToken = default) + { + if (_evHandler is null) + { + throw new NullReferenceException(nameof(_evHandler)); + } + + var returnedEvent = _evHandler.WaitForEventProcessor(filter + => filter.CallConnectionId == _callConnectionId + && (filter.OperationContext == _operationContext || _operationContext is null) + && (filter.GetType() == typeof(HoldFailed)), + cancellationToken); + + return SetReturnedEvent(returnedEvent); + } + + /// + /// Wait for using . + /// + /// Cancellation Token can be used to set timeout or cancel this WaitForEventProcessor. + /// Returns which contains event. + public async Task WaitForEventProcessorAsync(CancellationToken cancellationToken = default) + { + if (_evHandler is null) + { + throw new NullReferenceException(nameof(_evHandler)); + } + + var returnedEvent = await _evHandler.WaitForEventProcessorAsync(filter + => filter.CallConnectionId == _callConnectionId + && (filter.OperationContext == _operationContext || _operationContext is null) + && (filter.GetType() == typeof(HoldFailed)), + cancellationToken).ConfigureAwait(false); + + return SetReturnedEvent(returnedEvent); + } + + private static HoldEventResult SetReturnedEvent(CallAutomationEventBase returnedEvent) + { + HoldEventResult result = default; + switch (returnedEvent) + { + case HoldFailed: + result = new HoldEventResult(false, (HoldFailed)returnedEvent); + break; + default: + throw new NotSupportedException(returnedEvent.GetType().Name); + } + + return result; + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/InterruptAudioAndAnnounceRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/InterruptAudioAndAnnounceRequestInternal.cs new file mode 100644 index 000000000000..e1375cf90f40 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/InterruptAudioAndAnnounceRequestInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("InterruptAudioAndAnnounceRequest")] + internal partial class InterruptAudioAndAnnounceRequestInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingConfiguration.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingConfiguration.cs deleted file mode 100644 index 5a6fb4056a93..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; - -namespace Azure.Communication.CallAutomation -{ - /// The MediaStreamingConfiguration. - public class MediaStreamingConfiguration - { - /// Initializes a new instance of MediaStreamingConfiguration. - public MediaStreamingConfiguration(Uri transportUrl, MediaStreamingTransport transportType, - MediaStreamingContent contentType, MediaStreamingAudioChannel audioChannelType) - { - TransportUrl = transportUrl; - TransportType = transportType; - ContentType = contentType; - AudioChannelType = audioChannelType; - } - - /// Transport URL for media streaming. - public Uri TransportUrl { get; } - /// The type of tranport to be used for media streaming, eg. Websocket. - public MediaStreamingTransport TransportType { get; } - /// Content type to stream, eg. audio, audio/video. - public MediaStreamingContent ContentType { get; } - /// Audio channel type to stream, eg. unmixed audio, mixed audio. - public MediaStreamingAudioChannel AudioChannelType { get; } - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingContent.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingContent.cs index 89234cc8b867..a4d674d8c911 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingContent.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingContent.cs @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Communication.CallAutomation { - /// - /// The states of a call. - /// - [CodeGenModel("MediaStreamingContentType", Usage = new string[] { "input" }, Formats = new string[] { "json" })] - public readonly partial struct MediaStreamingContent + [CodeGenModel("MediaStreamingContentType", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + [JsonConverter(typeof(EquatableEnumJsonConverter))] + public readonly partial struct MediaStreamingContent : IEquatable { } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptions.cs index a6725f3cbcf5..ca3beaa2dc5b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptions.cs @@ -9,13 +9,14 @@ namespace Azure.Communication.CallAutomation public class MediaStreamingOptions { /// Initializes a new instance of MediaStreamingOptions. - public MediaStreamingOptions(Uri transportUri, MediaStreamingTransport transportType, - MediaStreamingContent contentType, MediaStreamingAudioChannel audioChannelType) + public MediaStreamingOptions(Uri transportUri, + MediaStreamingContent contentType, MediaStreamingAudioChannel audioChannelType, MediaStreamingTransport transportType = default, bool? startMediaStreaming = null) { TransportUri = transportUri; MediaStreamingTransport = transportType; MediaStreamingContent = contentType; MediaStreamingAudioChannel = audioChannelType; + StartMediaStreaming = startMediaStreaming; } /// Transport URL for media streaming. @@ -26,5 +27,11 @@ public MediaStreamingOptions(Uri transportUri, MediaStreamingTransport transport public MediaStreamingContent MediaStreamingContent { get; } /// Audio channel type to stream, eg. unmixed audio, mixed audio. public MediaStreamingAudioChannel MediaStreamingAudioChannel { get; } + /// Determines if the media streaming should be started immediately after call is answered or not. + public bool? StartMediaStreaming { get; set; } + /// A value indicating whether bidirectional streaming is enabled. + public bool? EnableBidirectional { get; set; } + /// Specifies the audio format used for encoding, including sample rate and channel type. + public AudioFormat? AudioFormat { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptionsInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptionsInternal.cs index a316fd34c49c..cc3594cf3d56 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptionsInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingOptionsInternal.cs @@ -5,7 +5,7 @@ namespace Azure.Communication.CallAutomation { - [CodeGenModel("MediaStreamingConfiguration")] + [CodeGenModel("MediaStreamingOptions")] internal partial class MediaStreamingOptionsInternal { } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscription.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscription.cs new file mode 100644 index 000000000000..8d010a4b771e --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscription.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.CallAutomation +{ + /// The MediaStreamingSubscription. + public class MediaStreamingSubscription + { + /// Initializes a new instance of . + /// Gets or Sets subscription Id. + /// Gets or Sets media streaming subscription state. + /// Gets or Sets the subscribed media streaming content types. + public MediaStreamingSubscription(string id, MediaStreamingSubscriptionState? state, IReadOnlyList subscribedContentTypes) + { + Id = id; + State = state; + SubscribedContentTypes = subscribedContentTypes; + } + + /// Gets or Sets subscription Id. + public string Id { get; } + /// Gets or Sets media streaming subscription state. + public MediaStreamingSubscriptionState? State { get; } + /// Gets or Sets the subscribed media streaming content types. + public IReadOnlyList SubscribedContentTypes { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscriptionInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscriptionInternal.cs new file mode 100644 index 000000000000..5b2349783807 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscriptionInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("MediaStreamingSubscription")] + internal partial class MediaStreamingSubscriptionInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscriptionState.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscriptionState.cs new file mode 100644 index 000000000000..93319cf11ca0 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/MediaStreamingSubscriptionState.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("MediaStreamingSubscriptionState", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + [JsonConverter(typeof(EquatableEnumJsonConverter))] + public readonly partial struct MediaStreamingSubscriptionState : IEquatable + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/RecognizeRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/RecognizeRequestInternal.cs index 18389273af11..3c3f95d20ae4 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/RecognizeRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/RecognizeRequestInternal.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Collections.Generic; using Azure.Core; namespace Azure.Communication.CallAutomation @@ -8,5 +9,7 @@ namespace Azure.Communication.CallAutomation [CodeGenModel("RecognizeRequest")] internal partial class RecognizeRequestInternal { + [CodeGenMember("PlayPrompts")] + public IList PlayPrompts { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/RoomCallLocator.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/RoomCallLocator.cs new file mode 100644 index 000000000000..0acbeaf062ad --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/RoomCallLocator.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + /// The room call locator. + public class RoomCallLocator : CallLocator + { + /// + /// Initializes a new instance of . + /// + /// The room call id. + /// + /// Thrown when the is null. + /// + /// + /// Thrown when the is empty. + /// + public RoomCallLocator(string id) + { + Argument.AssertNotNullOrEmpty(id, nameof(id)); + Id = id; + } + + /// + public override string ToString() => Id; + + /// + public override int GetHashCode() => Id.GetHashCode(); + + /// + public override bool Equals(CallLocator other) + => other is RoomCallLocator otherId && otherId.Id == Id; + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartMediaStreamingOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartMediaStreamingOptions.cs new file mode 100644 index 000000000000..9736523b3e3d --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartMediaStreamingOptions.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Options for the Start Media Streaming Request. + /// + public class StartMediaStreamingOptions + { + /// + /// Set a callback Uri that overrides the default callback Uri set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public Uri OperationCallbackUri { get; set; } + + /// The value to identify context of the operation. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartTranscriptionOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartTranscriptionOptions.cs index 7c88f00a3c0b..c0ff74711ea2 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartTranscriptionOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StartTranscriptionOptions.cs @@ -13,8 +13,14 @@ public class StartTranscriptionOptions { /// Defines Locale for the transcription e,g en-US. public string Locale { get; set; } - + /// Endpoint where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } /// The value to identify context of the operation. public string OperationContext { get; set; } + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public string OperationCallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopMediaStreamingOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopMediaStreamingOptions.cs new file mode 100644 index 000000000000..75d30ed3f5cc --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopMediaStreamingOptions.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Options for the Stop Media Streaming Request. + /// + public class StopMediaStreamingOptions + { + /// + /// Set a callback Uri that overrides the default callback Uri set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public Uri OperationCallbackUri { get; set; } + + /// The value to identify context of the operation. + public string OperationContext { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopTranscriptionOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopTranscriptionOptions.cs index 7973652d6a58..5bb98b762797 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopTranscriptionOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/StopTranscriptionOptions.cs @@ -13,5 +13,13 @@ public class StopTranscriptionOptions { /// The value to identify context of the operation. public string OperationContext { get; set; } + + /// Endpoint where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public string OperationCallbackUri { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioChannel.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioChannel.cs new file mode 100644 index 000000000000..e2e4c0cbfb37 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioChannel.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Specifies the Audio Channels + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum AudioChannel + { + /// + /// Unknown Audio channel type + /// + Unknown = 0, + + /// + /// Audio channel type + /// F + Mono = 1, + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioData.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioData.cs index fa9ee97eb31e..f8fc678fa696 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioData.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioData.cs @@ -10,33 +10,45 @@ namespace Azure.Communication.CallAutomation /// public class AudioData : StreamingData { - internal AudioData(string data, DateTime timestamp, string participantId, bool silent) + /// + /// The audio data, encoded as a base64 string + /// + /// + public AudioData(byte[] data) { Data = data; + } + + internal AudioData(string data, DateTime timestamp, string participantId, bool silent) + { + Data = !string.IsNullOrWhiteSpace(data) ? Convert.FromBase64String(data) : default; Timestamp = timestamp; if (participantId != null) { - Participant = CommunicationIdentifier.FromRawId(participantId);; + Participant = CommunicationIdentifier.FromRawId(participantId); } IsSilent = silent; } /// - /// The audio data in base64 string. + /// The audio data in base64 byte. /// - public string Data { get; } + public byte[] Data { get; } /// - /// The timestamp of thwn the media was sourced. + /// The timestamp indicating when the media content was received by the bot, + /// or if the bot is sending media, the timestamp of when the media was sourced. + /// The format is ISO 8601 (yyyy-mm-ddThh:mm). /// - public DateTime Timestamp { get; } + public DateTimeOffset Timestamp { get; } + /// - /// Participant ID + /// The raw ID of the participant. /// public CommunicationIdentifier Participant { get; } /// - /// Indicates if the received audio buffer contains only silence. + /// Indicates whether the received audio buffer contains only silence. /// public bool IsSilent { get; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadata.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadata.cs index 015ac85f9632..552fa8756cbf 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadata.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadata.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System.Text.Json.Serialization; - namespace Azure.Communication.CallAutomation { /// @@ -10,31 +8,36 @@ namespace Azure.Communication.CallAutomation /// public class AudioMetadata : StreamingData { + internal AudioMetadata(AudioMetadataInternal audioMetadataInternal) + { + MediaSubscriptionId = audioMetadataInternal.MediaSubscriptionId; + Encoding = audioMetadataInternal.Encoding; + SampleRate = audioMetadataInternal.SampleRate; + Channels = (AudioChannel)audioMetadataInternal.Channels; + Length = audioMetadataInternal.Length; + } + /// - /// Subscription Id. + /// A unique identifier for the media subscription. /// - [JsonPropertyName("subscriptionId")] public string MediaSubscriptionId { get; set; } /// - /// The Encoding. + /// The format used to encode the audio. Currently, only "pcm" (Pulse Code Modulation) is supported. /// - [JsonPropertyName("encoding")] public string Encoding { get; set; } /// - /// Sample Rate. + /// The number of samples per second in the audio. Supported values are 16kHz or 24kHz. /// - [JsonPropertyName("sampleRate")] public int SampleRate { get; set; } /// - /// Channels. + /// Specifies the number of audio channels in the audio configuration. + /// Currently, only "mono" (single channel) is supported. /// - [JsonPropertyName("channels")] - public int Channels { get; set; } + public AudioChannel Channels { get; set; } /// - /// Length. + /// The size of the audio data being sent, based on the sample rate and duration. /// - [JsonPropertyName("length")] public int Length { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadataInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadataInternal.cs new file mode 100644 index 000000000000..b34de464cdbc --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/AudioMetadataInternal.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Internal Metadata model for Audio Streaming. + /// + internal class AudioMetadataInternal + { + /// + /// A unique identifier for the media subscription. + /// + [JsonPropertyName("subscriptionId")] + public string MediaSubscriptionId { get; set; } + + /// + /// The format used to encode the audio. Currently, only "pcm" (Pulse Code Modulation) is supported. + /// + [JsonPropertyName("encoding")] + public string Encoding { get; set; } + /// + /// The number of samples per second in the audio. Supported values are 16kHz or 24kHz. + /// + [JsonPropertyName("sampleRate")] + public int SampleRate { get; set; } + /// + /// Specifies the number of audio channels in the audio configuration. + /// Currently, only "mono" (single channel) is supported. + /// + [JsonPropertyName("channels")] + public int Channels { get; set; } + /// + /// The size of the audio data being sent, based on the sample rate and duration. + /// + [JsonPropertyName("length")] + public int Length { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/MediaKind.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/MediaKind.cs new file mode 100644 index 000000000000..574c5d61d9bb --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/MediaKind.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Messages sent from websocket server + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum MediaKind + { + /// + /// Audio data type + /// F + AudioData, + /// + /// stop audio data type + /// + StopAudio + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/StopAudio.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/StopAudio.cs new file mode 100644 index 000000000000..1c4ae59012c6 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Media/StopAudio.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.CallAutomation +{ + /// + /// Stop Streaming Audio. + /// + public class StopAudio + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/OutStreamingData.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/OutStreamingData.cs new file mode 100644 index 000000000000..b3818f20b308 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/OutStreamingData.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Base class for Out Streaming Data + /// + public class OutStreamingData + { + /// + /// Create the new instance of outstreamingdata with kind + /// + /// + internal OutStreamingData(MediaKind kind) + { + this.Kind = kind; + } + + /// + /// Out streaming data kind ex. StopAudio, AudioData + /// + public MediaKind Kind { get; } + + /// + /// Out streaming Audio Data + /// + public AudioData AudioData { get; internal set; } + + /// + /// Out streaming Stop Audio Data + /// s + public StopAudio StopAudio { get; internal set; } + + /// + /// Get the streaming data for outbound + /// + /// + /// the string of outstreaming data + public static string GetAudioDataForOutbound(byte[] audioData) + { + // Create a ServerAudioData object for this chunk + var audio = new OutStreamingData(MediaKind.AudioData) + { + AudioData = new AudioData(audioData) + }; + // Serialize the JSON object to a string + return JsonSerializer.Serialize(audio); + } + + /// + /// Get the stop audiofor outbound + /// + /// the string of outstreaming data with the stop audio. + public static string GetStopAudioForOutbound() + { + var jsonObject = new OutStreamingData(MediaKind.StopAudio) + { + StopAudio = new StopAudio() + }; + + // Serialize the JSON object to a string + return JsonSerializer.Serialize(jsonObject); + } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingData.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingData.cs index 63ca3a12d21b..532a3672ec27 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingData.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingData.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; +using System.Text.Json; + namespace Azure.Communication.CallAutomation { /// @@ -8,5 +11,83 @@ namespace Azure.Communication.CallAutomation /// public abstract class StreamingData { + /// + /// Kind of the streaming data ex.AudioData, AudioMetadata, TranscriptionData, TranscriptionMetadata. + /// + public static StreamingDataKind Kind { get; internal set; } + + /// + /// Parses a base64 encoded string into a StreamingData object, + /// which can be one of the following subtypes: AudioData, AudioMetadata, TranscriptionData, or TranscriptionMetadata. + /// + /// The base64 string represents streaming data that will be converted into the appropriate subtype of StreamingData. + /// the type of StreamingData. + /// Throws a NotSupportedException if the provided base64 string does not correspond + /// to a supported data type for the specified Kind. + public static StreamingData Parse(string data) + { + return ParseStreamingData(data); + } + + /// + /// Parses a base64 encoded string into a StreamingData object, + /// which can be one of the following subtypes: AudioData, AudioMetadata, TranscriptionData, or TranscriptionMetadata. + /// + /// Subtypes of StreamingData -> AudioData, AudioMetadata, TranscriptionData, or TranscriptionMetadata + /// The base64 string represents streaming data that will be converted into the appropriate subtype of StreamingData. + /// the type of StreamingData. + /// Throws a NotSupportedException if the provided base64 string does not correspond + /// to a supported data type for the specified Kind. + public static T Parse(string data) where T : StreamingData + { + return (T)ParseStreamingData(data); + } + + private static StreamingData ParseStreamingData(string base64Data) + { + JsonElement streamingData = JsonDocument.Parse(base64Data).RootElement; + + string kind = streamingData.GetProperty("kind").ToString(); + Kind = (StreamingDataKind)Enum.Parse(typeof(StreamingDataKind), kind); + + switch (kind) + { + #region Audio + case "AudioMetadata": + var audioMetadataInternal = JsonSerializer.Deserialize(streamingData.GetProperty("audioMetadata").ToString()); + return new AudioMetadata(audioMetadataInternal); + + case "AudioData": + AudioDataInternal audioInternal = JsonSerializer.Deserialize(streamingData.GetProperty("audioData").ToString()); + return new AudioData( + audioInternal.Data, audioInternal.Timestamp, audioInternal.ParticipantRawId, audioInternal.Silent); + + #endregion + + #region Transcription + case "TranscriptionMetadata": + return JsonSerializer.Deserialize(streamingData.GetProperty("transcriptionMetadata").ToString()); + + case "TranscriptionData": + TranscriptionDataInternal transcriptionDataInternal = JsonSerializer.Deserialize( + streamingData.GetProperty("transcriptionData").ToString() + ); + return new TranscriptionData( + transcriptionDataInternal.Text, + transcriptionDataInternal.Format, + transcriptionDataInternal.Confidence, + transcriptionDataInternal.Offset, + transcriptionDataInternal.Duration, + transcriptionDataInternal.Words, + transcriptionDataInternal.ParticipantRawID, + transcriptionDataInternal.ResultState + ); + + #endregion + + default: + throw new NotSupportedException($"The provided base64 string does not correspond to a supported data type for the Kind: {Kind}"); + } + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataKind.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataKind.cs new file mode 100644 index 000000000000..9c33e973a5d8 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataKind.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +namespace Azure.Communication.CallAutomation +{ + /// + /// Kind of streaming data when websocket receives the data + /// + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum StreamingDataKind + { + /// + /// Audio data type + /// + AudioData, + /// + /// Audio metadata type + /// + AudioMetadata, + /// + /// Transcription data type + /// + TranscriptionData, + /// + /// Transcription metadata type + /// + TranscriptionMetadata + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataParser.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataParser.cs index c544fb05716e..33708357369d 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataParser.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/StreamingDataParser.cs @@ -16,11 +16,11 @@ public static class StreamingDataParser /// /// Parsing a MediaStreaming package from BinaryData. /// - /// + /// /// - public static StreamingData Parse(BinaryData json) + public static StreamingData Parse(BinaryData binaryData) { - return Parse(json.ToString()); + return Parse(binaryData.ToString()); } /// @@ -74,10 +74,10 @@ public static StreamingData Parse(string stringJson) transcriptionDataInternal.Duration, transcriptionDataInternal.Words, transcriptionDataInternal.ParticipantRawID, - transcriptionDataInternal.ResultStatus + transcriptionDataInternal.ResultState ); - #endregion + #endregion default: throw new NotSupportedException(stringJson); diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/ResultStatus.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/ResultStatus.cs deleted file mode 100644 index 54387c86fef2..000000000000 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/ResultStatus.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.Communication.CallAutomation -{ - /// - /// The status of the result of transcription - /// - public enum ResultStatus - { - /// - /// Intermediate result - /// - Intermediate, - - /// - /// Final result - /// - Final - } -} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionData.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionData.cs index 6b6cd4ee4276..c875122cbd59 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionData.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionData.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.Communication.CallAutomation { @@ -11,19 +12,19 @@ namespace Azure.Communication.CallAutomation /// public class TranscriptionData : StreamingData { - internal TranscriptionData(string text, string format, double confidence, ulong offset, ulong duration, IEnumerable words, string participantRawID, string resultStatus) + internal TranscriptionData(string text, string format, double confidence, long offset, long duration, IEnumerable words, string participantRawID, TranscriptionResultState resultState) { Text = text; Format = ConvertToTextFormatEnum(format); Confidence = confidence; - Offset = offset; - Duration = duration; - Words = words; + Offset = TimeSpan.FromTicks(offset); + Duration = TimeSpan.FromTicks(duration); + Words = ConvertToWordData(words); if (participantRawID != null) { Participant = CommunicationIdentifier.FromRawId(participantRawID); } - ResultStatus = ConvertToResultStatusEnum(resultStatus); + ResultState = resultState; } /// @@ -45,12 +46,12 @@ internal TranscriptionData(string text, string format, double confidence, ulong /// The position of this payload /// - public ulong Offset { get; set; } + public TimeSpan Offset { get; set; } /// /// Duration in ticks. 1 tick = 100 nanoseconds. /// - public ulong Duration { get; set; } + public TimeSpan Duration { get; set; } /// /// The result for each word of the phrase @@ -65,24 +66,19 @@ internal TranscriptionData(string text, string format, double confidence, ulong /// /// Status of the result of transcription /// - public ResultStatus ResultStatus { get; set; } - - private static ResultStatus ConvertToResultStatusEnum(string resultStatus) - { - if ("Intermediate".Equals(resultStatus, StringComparison.OrdinalIgnoreCase)) - return ResultStatus.Intermediate; - else if ("Final".Equals(resultStatus, StringComparison.OrdinalIgnoreCase)) - return ResultStatus.Final; - else - throw new NotSupportedException(resultStatus); - } + public TranscriptionResultState ResultState { get; set; } private static TextFormat ConvertToTextFormatEnum(string format) { - if ("Display".Equals(format, StringComparison.OrdinalIgnoreCase)) + if (TextFormat.Display.ToString().Equals(format, StringComparison.OrdinalIgnoreCase)) return TextFormat.Display; else throw new NotSupportedException(format); } + + private static IEnumerable ConvertToWordData(IEnumerable wordData) + { + return wordData.Select(w => new WordData(w.Text, w.Offset, w.Duration)); + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionDataInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionDataInternal.cs index 9e37c5c6a273..c0f5572db0e7 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionDataInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/TranscriptionDataInternal.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -34,19 +35,19 @@ internal class TranscriptionDataInternal /// [JsonPropertyName("offset")] - public ulong Offset { get; set; } + public long Offset { get; set; } /// /// Duration in ticks. 1 tick = 100 nanoseconds. /// [JsonPropertyName("duration")] - public ulong Duration { get; set; } + public long Duration { get; set; } /// /// The result for each word of the phrase /// [JsonPropertyName("words")] - public IEnumerable Words { get; set; } + public IEnumerable Words { get; set; } /// /// The identified speaker based on participant raw ID @@ -58,6 +59,6 @@ internal class TranscriptionDataInternal /// Status of the result of transcription /// [JsonPropertyName("resultStatus")] - public string ResultStatus { get; set; } + public TranscriptionResultState ResultState { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordData.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordData.cs index df490a3799bf..61eb609ce12c 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordData.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordData.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Text.Json.Serialization; namespace Azure.Communication.CallAutomation @@ -10,6 +11,19 @@ namespace Azure.Communication.CallAutomation /// public class WordData { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + internal WordData(string text, long offset, long duration) + { + Text = text; + Offset = TimeSpan.FromTicks(offset); + Duration = TimeSpan.FromTicks(duration); + } + /// /// Text in the phrase. /// @@ -19,12 +33,12 @@ public class WordData /// The word's position within the phrase. /// [JsonPropertyName("offset")] - public ulong Offset { get; set; } + public TimeSpan Offset { get; set; } /// /// Duration in ticks. 1 tick = 100 nanoseconds. /// [JsonPropertyName("duration")] - public ulong Duration { get; set; } + public TimeSpan Duration { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordDataInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordDataInternal.cs new file mode 100644 index 000000000000..c0f138b71b21 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Streaming/Transcription/WordDataInternal.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json.Serialization; + +namespace Azure.Communication.CallAutomation +{ + /// + /// The result for each word of the phrase + /// + internal class WordDataInternal + { + /// + /// Text in the phrase. + /// + [JsonPropertyName("text")] + public string Text { get; set; } + /// + /// The word's position within the phrase. + /// + [JsonPropertyName("offset")] + public long Offset { get; set; } + + /// + /// Duration in ticks. 1 tick = 100 nanoseconds. + /// + [JsonPropertyName("duration")] + public long Duration { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptions.cs index 28f5687b881f..25fd37a98a0f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptions.cs @@ -15,17 +15,17 @@ public partial class TranscriptionOptions { /// Initializes a new instance of TranscriptionOptions. /// Transport URL for live transcription. - /// The type of transport to be used for live transcription, eg. Websocket. /// Defines the locale for the data e.g en-CA, en-AU. /// Determines if the transcription should be started immediately after call is answered or not. + /// The type of transport to be used for live transcription, eg. Websocket. /// or is null. - public TranscriptionOptions(Uri transportUri, TranscriptionTransport transportType, string locale, bool startTranscription) + public TranscriptionOptions(Uri transportUri, string locale, bool? startTranscription = null, TranscriptionTransport transcriptionTransport = default) { Argument.AssertNotNull(transportUri, nameof(transportUri)); Argument.AssertNotNull(locale, nameof(locale)); TransportUrl = transportUri; - TranscriptionTransport = transportType; + TranscriptionTransport = transcriptionTransport; Locale = locale; StartTranscription = startTranscription; } @@ -37,6 +37,10 @@ public TranscriptionOptions(Uri transportUri, TranscriptionTransport transportTy /// Defines the locale for the data e.g en-CA, en-AU. public string Locale { get; } /// Determines if the transcription should be started immediately after call is answered or not. - public bool StartTranscription { get; } + public bool? StartTranscription { get; } + /// Endpoint where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } + /// Enables intermediate results for the transcribed speech. + public bool? EnableIntermediateResults { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptionsInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptionsInternal.cs index 4832ba8e5fcb..5e19efdd11f9 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptionsInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionOptionsInternal.cs @@ -5,7 +5,7 @@ namespace Azure.Communication.CallAutomation { - [CodeGenModel("TranscriptionConfiguration")] + [CodeGenModel("TranscriptionOptions")] internal partial class TranscriptionOptionsInternal { } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionResultState.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionResultState.cs new file mode 100644 index 000000000000..1b0634b1e85a --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionResultState.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("TranscriptionResultType", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + [JsonConverter(typeof(EquatableEnumJsonConverter))] + public readonly partial struct TranscriptionResultState : IEquatable + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscription.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscription.cs new file mode 100644 index 000000000000..3cb87c1ad50b --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscription.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.CallAutomation +{ + /// The TranscriptionSubscription. + public class TranscriptionSubscription + { + /// Initializes a new instance of . + /// Gets or Sets subscription Id. + /// Gets or Sets media streaming subscription state. + /// Gets or Sets the subscribed media streaming content types. + internal TranscriptionSubscription(string id, TranscriptionSubscriptionState? state, IReadOnlyList subscribedResultStates) + { + Id = id; + State = state; + SubscribedResultStates = subscribedResultStates; + } + + /// Gets or Sets subscription Id. + public string Id { get; } + /// Gets or Sets transcription subscription state. + public TranscriptionSubscriptionState? State { get; } + /// Gets or Sets the subscribed transcription result types. + public IReadOnlyList SubscribedResultStates { get; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscriptionInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscriptionInternal.cs new file mode 100644 index 000000000000..a289488d8020 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscriptionInternal.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("TranscriptionSubscription")] + internal partial class TranscriptionSubscriptionInternal + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscriptionState.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscriptionState.cs new file mode 100644 index 000000000000..4b1d9bc489e5 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TranscriptionSubscriptionState.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Communication.CallAutomation +{ + [CodeGenModel("TranscriptionSubscriptionState", Usage = new string[] { "output" }, Formats = new string[] { "json" })] + [JsonConverter(typeof(EquatableEnumJsonConverter))] + public readonly partial struct TranscriptionSubscriptionState : IEquatable + { + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs index c00016e2e881..4bfe94d1ed39 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs @@ -41,6 +41,16 @@ public TransferToParticipantOptions(MicrosoftTeamsUserIdentifier targetIdentity) CustomCallingContext = new CustomCallingContext(sipHeaders: null, voipHeaders: new Dictionary()); } + /// + /// Creates a new TransferToParticipantOptions object. + /// + /// The target to transfer the call to. + public TransferToParticipantOptions(MicrosoftTeamsAppIdentifier targetIdentity) + { + Target = targetIdentity; + CustomCallingContext = new CustomCallingContext(sipHeaders: null, voipHeaders: new Dictionary()); + } + /// /// The target callee. /// diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/UpdateTranscriptionOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UpdateTranscriptionOptions.cs new file mode 100644 index 000000000000..390c688cbd79 --- /dev/null +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/UpdateTranscriptionOptions.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Communication.CallAutomation +{ + /// + /// Options for the stop transcription Request. + /// + public class UpdateTranscriptionOptions + { + /// + /// Options for the Update Transcription operation. + /// + public UpdateTranscriptionOptions(string locale) + { + this.Locale = locale; + } + + /// Defines Locale for the transcription e,g en-US. + internal string Locale { get; set; } + + /// The value to identify context of the operation. + public string OperationContext { get; set; } + + /// Endpoint where the custom model was deployed. + public string SpeechRecognitionModelEndpointId { get; set; } + /// + /// Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. + /// This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used. + /// + public string OperationCallbackUri { get; set; } + } +} diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md index 1375dcb6ca1d..6a75a032bd25 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md @@ -7,10 +7,10 @@ From Folder that contains autorest.md, Run `dotnet msbuild /t:GenerateCode` to g ```yaml model-namespace: false -tag: package-2023-10-03-preview +tag: package-2024-09-01-preview require: - - https://github.com/Azure/azure-rest-api-specs/blob/be2a0fa68829fcb15c4e6b47aa6bc4bdd566c1cf/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/691fea3efb9ff22b20904e92d5116223f452a3b1/specification/communication/data-plane/CallAutomation/readme.md title: Azure Communication Services diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs index f19cd590a0e8..d8f1083ef801 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientAutomatedLiveTests.cs @@ -32,14 +32,14 @@ public async Task CreateCallToACSGetCallAndHangUpCallTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -84,7 +84,7 @@ public async Task CreateCallToACSGetCallAndHangUpCallTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -102,14 +102,14 @@ public async Task CreateCallAndReject() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions( @@ -130,6 +130,11 @@ public async Task CreateCallAndReject() // check reject response Assert.IsFalse(rejectResponse.IsError); + var createCallFailedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(createCallFailedEvent); + Assert.IsTrue(createCallFailedEvent is CreateCallFailed); + Assert.AreEqual(callConnectionId, ((CreateCallFailed)createCallFailedEvent!).CallConnectionId); + try { // test get properties @@ -155,7 +160,205 @@ public async Task CreateCallAndReject() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task CreateCallToAcsConnectCallAndHangupForEveryoneTest() + { + /* Tests: CreateCall, AnswerCall, Connect call, Hangup(true), GetCallConnectionProperties, CallConnectedEvent, CallDisconnectedEvent + * Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. create a call from source to one ACS target. + * 3. connect call. + * 4. get updated call properties and check for the connected state. + * 5. hang up the call. + * 6. once call is hung up, verify disconnected event + */ + + // create caller and receiver + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + CreateCallResult response = await client.CreateCallAsync(createCallOptions).ConfigureAwait(false); + callConnectionId = response.CallConnectionProperties.CallConnectionId; + Assert.IsNotEmpty(response.CallConnectionProperties.CallConnectionId); + + // wait for incomingcall context + string? incomingCallContext = await WaitForIncomingCallContext(uniqueId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(incomingCallContext); + + // answer the call + var answerCallOptions = new AnswerCallOptions(incomingCallContext, new Uri(TestEnvironment.DispatcherCallback)); + AnswerCallResult answerResponse = await targetClient.AnswerCallAsync(answerCallOptions); + + // wait for callConnected + var connectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(connectedEvent); + Assert.IsTrue(connectedEvent is CallConnected); + Assert.AreEqual(callConnectionId, ((CallConnected)connectedEvent!).CallConnectionId); + + // server call locator for connect call. + CallLocator callLocator = new ServerCallLocator(connectedEvent.ServerCallId); + + // connect call. + ConnectCallResult connectCallResult = await client.ConnectCallAsync(callLocator, new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + var connectCallConnectionId = connectCallResult.CallConnectionProperties.CallConnectionId.ToString(); + + // wait for connect call connected. + var connectCallConnectedEvent = await WaitForEvent(connectCallConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(connectCallConnectedEvent); + Assert.IsTrue(connectCallConnectedEvent is CallConnected); + Assert.AreEqual(connectCallConnectionId, ((CallConnected)connectCallConnectedEvent!).CallConnectionId); + + CallConnection ConnectCallConnection = connectCallResult.CallConnection; + + // test get properties + Response properties = await ConnectCallConnection.GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.AreEqual(CallConnectionState.Connected, properties.Value.CallConnectionState); + + // try hangup + await connectCallResult.CallConnection.HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(connectCallConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(connectCallConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + connectCallConnectionId = null; + + // try hangup + try + { + await answerResponse.CallConnection.HangUpAsync(true).ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + Assert.AreEqual(ex.Status, 404); + } + + callConnectionId = null; + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task CreateCallToAcsConnectCallAndHangupTest() + { + /* Tests: CreateCall, AnswerCall, Connect call, Hangup(true), GetCallConnectionProperties, CallConnectedEvent, CallDisconnectedEvent + * Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. create a call from source to one ACS target. + * 3. connect call. + * 4. get updated call properties and check for the connected state. + * 5. hang up the call. + * 6. once call is hung up, verify disconnected event + */ + + // create caller and receiver + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + CreateCallResult response = await client.CreateCallAsync(createCallOptions).ConfigureAwait(false); + callConnectionId = response.CallConnectionProperties.CallConnectionId; + Assert.IsNotEmpty(response.CallConnectionProperties.CallConnectionId); + + // wait for incomingcall context + string? incomingCallContext = await WaitForIncomingCallContext(uniqueId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(incomingCallContext); + + // answer the call + var answerCallOptions = new AnswerCallOptions(incomingCallContext, new Uri(TestEnvironment.DispatcherCallback)); + AnswerCallResult answerResponse = await targetClient.AnswerCallAsync(answerCallOptions); + + // wait for callConnected + var connectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(connectedEvent); + Assert.IsTrue(connectedEvent is CallConnected); + Assert.AreEqual(callConnectionId, ((CallConnected)connectedEvent!).CallConnectionId); + + // server call locator for connect call. + CallLocator callLocator = new ServerCallLocator(connectedEvent.ServerCallId); + + // connect call. + ConnectCallResult connectCallResult = await client.ConnectCallAsync(callLocator, new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + var connectCallConnectionId = connectCallResult.CallConnectionProperties.CallConnectionId.ToString(); + + // wait for connect call connected. + var connectCallConnectedEvent = await WaitForEvent(connectCallConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(connectCallConnectedEvent); + Assert.IsTrue(connectCallConnectedEvent is CallConnected); + Assert.AreEqual(connectCallConnectionId, ((CallConnected)connectCallConnectedEvent!).CallConnectionId); + + CallConnection ConnectCallConnection = connectCallResult.CallConnection; + + // test get properties + Response properties = await ConnectCallConnection.GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.AreEqual(CallConnectionState.Connected, properties.Value.CallConnectionState); + + // try hangup + await connectCallResult.CallConnection.HangUpAsync(false).ConfigureAwait(false); + var disconnectedConnectEvent = await WaitForEvent(connectCallConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedConnectEvent); + Assert.IsTrue(disconnectedConnectEvent is CallDisconnected); + Assert.AreEqual(connectCallConnectionId, ((CallDisconnected)disconnectedConnectEvent!).CallConnectionId); + connectCallConnectionId = null; + + // try to hangup for anwercall + await answerResponse.CallConnection.HangUpAsync(false).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + callConnectionId = null; + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientTests.cs index 01d53df712a8..bd82262fb103 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallAutomationClients/CallAutomationClientTests.cs @@ -14,15 +14,15 @@ public class CallAutomationClientTests : CallAutomationTestBase { private readonly MediaStreamingOptions _mediaStreamingConfiguration = new MediaStreamingOptions( new Uri("https://websocket"), - MediaStreamingTransport.Websocket, MediaStreamingContent.Audio, - MediaStreamingAudioChannel.Mixed); + MediaStreamingAudioChannel.Mixed, + MediaStreamingTransport.Websocket); private readonly TranscriptionOptions _transcriptionConfiguration = new TranscriptionOptions( new Uri("https://websocket"), - TranscriptionTransport.Websocket, "en-CA", - true); + true, + TranscriptionTransport.Websocket); [TestCaseSource(nameof(TestData_AnswerCall))] public async Task AnswerCallAsync_200OK(string incomingCallContext, Uri callbackUri) @@ -33,8 +33,8 @@ public async Task AnswerCallAsync_200OK(string incomingCallContext, Uri callback Assert.NotNull(response); Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); verifyCallConnectionProperties(response.Value.CallConnectionProperties); - Assert.Null(response.Value.CallConnectionProperties.MediaSubscriptionId); - Assert.Null(response.Value.CallConnectionProperties.DataSubscriptionId); + Assert.Null(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.Null(response.Value.CallConnectionProperties.TranscriptionSubscription); Assert.AreEqual(CallConnectionId, response.Value.CallConnection.CallConnectionId); } @@ -47,8 +47,8 @@ public void AnswerCall_200OK(string incomingCallContext, Uri callbackUri) Assert.NotNull(response); Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); verifyCallConnectionProperties(response.Value.CallConnectionProperties); - Assert.Null(response.Value.CallConnectionProperties.MediaSubscriptionId); - Assert.Null(response.Value.CallConnectionProperties.DataSubscriptionId); + Assert.Null(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.Null(response.Value.CallConnectionProperties.TranscriptionSubscription); Assert.AreEqual(CallConnectionId, response.Value.CallConnection.CallConnectionId); } @@ -68,8 +68,8 @@ public async Task AnswerCallWithOptionsAsync_200OK(string incomingCallContext, U Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); verifyCallConnectionProperties(response.Value.CallConnectionProperties); Assert.AreEqual(CallConnectionId, response.Value.CallConnection.CallConnectionId); - Assert.AreEqual("mediaSubscriptionId", response.Value.CallConnectionProperties.MediaSubscriptionId); - Assert.AreEqual("dataSubscriptionId", response.Value.CallConnectionProperties.DataSubscriptionId); + Assert.NotNull(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.NotNull(response.Value.CallConnectionProperties.TranscriptionSubscription); } [TestCaseSource(nameof(TestData_AnswerCall))] @@ -87,8 +87,8 @@ public void AnswerCallWithOptions_200OK(string incomingCallContext, Uri callback Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); verifyCallConnectionProperties(response.Value.CallConnectionProperties); Assert.AreEqual(CallConnectionId, response.Value.CallConnection.CallConnectionId); - Assert.AreEqual("mediaSubscriptionId", response.Value.CallConnectionProperties.MediaSubscriptionId); - Assert.AreEqual("dataSubscriptionId", response.Value.CallConnectionProperties.DataSubscriptionId); + Assert.NotNull(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.NotNull(response.Value.CallConnectionProperties.TranscriptionSubscription); } [TestCaseSource(nameof(TestData_AnswerCall))] @@ -136,7 +136,7 @@ public void RedirectCallAsync_404NotFound(string incomingCallContext, CallInvite { CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(404); - RequestFailedException? ex = Assert.ThrowsAsync(async() => await callAutomationClient.RedirectCallAsync(incomingCallContext, callInvite).ConfigureAwait(false)); + RequestFailedException? ex = Assert.ThrowsAsync(async () => await callAutomationClient.RedirectCallAsync(incomingCallContext, callInvite).ConfigureAwait(false)); Assert.NotNull(ex); Assert.AreEqual(ex?.Status, 404); } @@ -185,7 +185,7 @@ public void RejectCallAsync_404NotFound(string incomingCallContext, CallRejectRe RejectCallOptions rejectOption = new RejectCallOptions(incomingCallContext); rejectOption.CallRejectReason = reason; - RequestFailedException? ex = Assert.ThrowsAsync(async() => await callAutomationClient.RejectCallAsync(rejectOption).ConfigureAwait(false)); + RequestFailedException? ex = Assert.ThrowsAsync(async () => await callAutomationClient.RejectCallAsync(rejectOption).ConfigureAwait(false)); Assert.NotNull(ex); Assert.AreEqual(ex?.Status, 404); } @@ -214,8 +214,8 @@ public async Task CreateCallAsync_201Created(CallInvite target, Uri callbackUri) Assert.NotNull(result); Assert.AreEqual((int)HttpStatusCode.Created, response.GetRawResponse().Status); verifyCallConnectionProperties(result.CallConnectionProperties); - Assert.Null(result.CallConnectionProperties.MediaSubscriptionId); - Assert.Null(result.CallConnectionProperties.DataSubscriptionId); + Assert.Null(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.Null(response.Value.CallConnectionProperties.TranscriptionSubscription); Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); } @@ -230,85 +230,91 @@ public void CreateCall_201Created(CallInvite target, Uri callbackUri) Assert.NotNull(result); Assert.AreEqual((int)HttpStatusCode.Created, response.GetRawResponse().Status); verifyCallConnectionProperties(result.CallConnectionProperties); - Assert.Null(result.CallConnectionProperties.MediaSubscriptionId); - Assert.Null(result.CallConnectionProperties.DataSubscriptionId); + Assert.Null(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.Null(response.Value.CallConnectionProperties.TranscriptionSubscription); Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); } [TestCaseSource(nameof(TestData_CreateCall))] - public async Task CreateCallWithOPSSourceAsync_201Created(CallInvite target, Uri callbackUri) + public async Task CreateCallWithOptionsAsync_201Created(CallInvite target, Uri callbackUri) { - CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionPayloadForOPSCall, isOPSCall:true); + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionAndTranscriptionPayload); + CreateCallOptions options = new CreateCallOptions( + callInvite: target, + callbackUri: callbackUri) + { + MediaStreamingOptions = _mediaStreamingConfiguration, + TranscriptionOptions = _transcriptionConfiguration + }; - var options = new CreateCallOptions(target, callbackUri); var response = await callAutomationClient.CreateCallAsync(options).ConfigureAwait(false); CreateCallResult result = (CreateCallResult)response; Assert.NotNull(result); Assert.AreEqual((int)HttpStatusCode.Created, response.GetRawResponse().Status); - verifyOPSCallConnectionProperties(result.CallConnectionProperties); - Assert.Null(result.CallConnectionProperties.MediaSubscriptionId); - Assert.Null(result.CallConnectionProperties.DataSubscriptionId); + verifyCallConnectionProperties(result.CallConnectionProperties); Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); + Assert.NotNull(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.NotNull(response.Value.CallConnectionProperties.TranscriptionSubscription); } [TestCaseSource(nameof(TestData_CreateCall))] - public void CreateCallWithOPSSource_201Created(CallInvite target, Uri callbackUri) + public void CreateCallWithOptions_201Created(CallInvite target, Uri callbackUri) { - CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionPayloadForOPSCall, isOPSCall: true); + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionAndTranscriptionPayload); + CreateCallOptions options = new CreateCallOptions( + callInvite: target, + callbackUri: callbackUri) + { + MediaStreamingOptions = _mediaStreamingConfiguration, + TranscriptionOptions = _transcriptionConfiguration + }; - var options = new CreateCallOptions(target, callbackUri); var response = callAutomationClient.CreateCall(options); CreateCallResult result = (CreateCallResult)response; Assert.NotNull(result); Assert.AreEqual((int)HttpStatusCode.Created, response.GetRawResponse().Status); - verifyOPSCallConnectionProperties(result.CallConnectionProperties); - Assert.Null(result.CallConnectionProperties.MediaSubscriptionId); - Assert.Null(result.CallConnectionProperties.DataSubscriptionId); + verifyCallConnectionProperties(result.CallConnectionProperties); Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); + Assert.NotNull(response.Value.CallConnectionProperties.MediaStreamingSubscription); + Assert.NotNull(response.Value.CallConnectionProperties.TranscriptionSubscription); } [TestCaseSource(nameof(TestData_CreateCall))] - public async Task CreateCallWithOptionsAsync_201Created(CallInvite target, Uri callbackUri) + public async Task CreateCallWithTeamsAppSourceAsync_201Created(CallInvite target, Uri callbackUri) { - CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionAndTranscriptionPayload); + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionPayloadWithTeamsAppSource); CreateCallOptions options = new CreateCallOptions( callInvite: target, callbackUri: callbackUri) { - MediaStreamingOptions = _mediaStreamingConfiguration, - TranscriptionOptions = _transcriptionConfiguration + TeamsAppSource = new MicrosoftTeamsAppIdentifier("teamsAppId") }; var response = await callAutomationClient.CreateCallAsync(options).ConfigureAwait(false); CreateCallResult result = (CreateCallResult)response; Assert.NotNull(result); Assert.AreEqual((int)HttpStatusCode.Created, response.GetRawResponse().Status); - verifyCallConnectionProperties(result.CallConnectionProperties); + verifyOPSCallConnectionProperties(result.CallConnectionProperties); Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); - Assert.AreEqual("mediaSubscriptionId", result.CallConnectionProperties.MediaSubscriptionId); - Assert.AreEqual("dataSubscriptionId", result.CallConnectionProperties.DataSubscriptionId); } [TestCaseSource(nameof(TestData_CreateCall))] - public void CreateCallWithOptions_201Created(CallInvite target, Uri callbackUri) + public void CreateCallWithTeamsAppSource_201Created(CallInvite target, Uri callbackUri) { - CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionAndTranscriptionPayload); + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(201, CreateOrAnswerCallOrGetCallConnectionPayloadWithTeamsAppSource); CreateCallOptions options = new CreateCallOptions( callInvite: target, callbackUri: callbackUri) { - MediaStreamingOptions = _mediaStreamingConfiguration, - TranscriptionOptions = _transcriptionConfiguration + TeamsAppSource = new MicrosoftTeamsAppIdentifier("teamsAppId") }; var response = callAutomationClient.CreateCall(options); CreateCallResult result = (CreateCallResult)response; Assert.NotNull(result); Assert.AreEqual((int)HttpStatusCode.Created, response.GetRawResponse().Status); - verifyCallConnectionProperties(result.CallConnectionProperties); + verifyOPSCallConnectionProperties(result.CallConnectionProperties); Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); - Assert.AreEqual("mediaSubscriptionId", result.CallConnectionProperties.MediaSubscriptionId); - Assert.AreEqual("dataSubscriptionId", result.CallConnectionProperties.DataSubscriptionId); } [TestCaseSource(nameof(TestData_CreateCall))] @@ -331,6 +337,60 @@ public void CreateCall_404NotFound(CallInvite target, Uri callbackUri) Assert.AreEqual(ex?.Status, 404); } + [TestCaseSource(nameof(TestData_ConnectCall))] + public async Task ConnectCallAsync_200OK(CallLocator callLocator, Uri callbackUri) + { + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(200, DummyConnectPayload); + + var response = await callAutomationClient.ConnectCallAsync(callLocator, callbackUri).ConfigureAwait(false); + ConnectCallResult result = (ConnectCallResult)response; + Assert.NotNull(result); + Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); + verifyCallConnectionProperties(result.CallConnectionProperties, isConnectApi: true); + Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); + } + + [TestCaseSource(nameof(TestData_ConnectCall))] + public void ConnectCall_200OK(CallLocator callLocator, Uri callbackUri) + { + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(200, DummyConnectPayload); + + var response = callAutomationClient.ConnectCall(callLocator, callbackUri); + ConnectCallResult result = (ConnectCallResult)response; + Assert.NotNull(result); + Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); + verifyCallConnectionProperties(result.CallConnectionProperties, isConnectApi: true); + Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); + } + + [TestCaseSource(nameof(TestData_ConnectCall))] + public async Task ConnectCallWithOptionsAsync_200OK(CallLocator callLocator, Uri callbackUri) + { + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(200, DummyConnectPayload); + + var options = new ConnectCallOptions(callLocator, callbackUri); + var response = await callAutomationClient.ConnectCallAsync(options).ConfigureAwait(false); + ConnectCallResult result = (ConnectCallResult)response; + Assert.NotNull(result); + Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); + verifyCallConnectionProperties(result.CallConnectionProperties, isConnectApi: true); + Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); + } + + [TestCaseSource(nameof(TestData_ConnectCall))] + public void ConnectCallWithOptions_200OK(CallLocator callLocator, Uri callbackUri) + { + CallAutomationClient callAutomationClient = CreateMockCallAutomationClient(200, DummyConnectPayload); + + var options = new ConnectCallOptions(callLocator, callbackUri); + var response = callAutomationClient.ConnectCall(options); + ConnectCallResult result = (ConnectCallResult)response; + Assert.NotNull(result); + Assert.AreEqual((int)HttpStatusCode.OK, response.GetRawResponse().Status); + verifyCallConnectionProperties(result.CallConnectionProperties, isConnectApi: true); + Assert.AreEqual(CallConnectionId, result.CallConnection.CallConnectionId); + } + [TestCaseSource(nameof(TestData_GetCallConnection))] public void GetCallConnection(string callConnectionId) { @@ -366,8 +426,8 @@ public async Task CreateGroupCallAsync_201Created(IEnumerable TestData_CreateOPSCall() - { - return new[] - { - new object?[] - { - new CallInvite(new MicrosoftTeamsAppIdentifier("28:acs:12345")), + new CallInvite(new CommunicationUserIdentifier("12345")), new Uri("https://bot.contoso.com/callback") }, }; @@ -522,5 +570,16 @@ private static void ValidateCallConnectionProperties(CallConnectionProperties pr }, }; } + private static IEnumerable TestData_ConnectCall() + { + return new[] + { + new object?[] + { + _serverCallLocator, + new Uri("https://bot.contoso.com/callback") + }, + }; + } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs index 42eaa5750e70..b70482618f33 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionAutomatedLiveTests.cs @@ -32,14 +32,14 @@ public async Task RemoveAUserCallTest() CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -98,7 +98,7 @@ public async Task RemoveAUserCallTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -121,12 +121,12 @@ public async Task CancelAddParticipantTest() var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); var client = CreateInstrumentedCallAutomationClientWithConnectionString(user); var targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -182,7 +182,7 @@ public async Task CancelAddParticipantTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionTests.cs index fafda426262e..1e4f61456c79 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallConnections/CallConnectionTests.cs @@ -132,6 +132,16 @@ public async Task TransferCallToParticipantAsync_simpleMethod_202Accepted(CallIn verifyOperationContext(response); } + [TestCaseSource(nameof(TestData_TransferCallToParticipant_MicrosoftTeamsAppTarget))] + public async Task TransferCallToParticipantAsync_simpleMethod_MicrosoftTeamsAppAsTarget_202Accepted(CallInvite callInvite) + { + var callConnection = CreateMockCallConnection(202, OperationContextPayload); + + var response = await callConnection.TransferCallToParticipantAsync(callInvite.Target).ConfigureAwait(false); + Assert.AreEqual((int)HttpStatusCode.Accepted, response.GetRawResponse().Status); + verifyOperationContext(response); + } + [TestCaseSource(nameof(TestData_TransferCallToParticipant))] public async Task TransferCallToParticipantAsync_202Accepted(CallInvite callInvite) { @@ -555,6 +565,19 @@ private CallConnection CreateMockCallConnection(int responseCode, string? respon }; } + private static IEnumerable TestData_TransferCallToParticipant_MicrosoftTeamsAppTarget() + { + var callInvite = new CallInvite(new MicrosoftTeamsAppIdentifier("userId")); + callInvite.CustomCallingContext.AddVoip("key1", "value1"); + return new[] + { + new object?[] + { + callInvite + }, + }; + } + private static IEnumerable TestData_GetParticipant() { return new[] diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs index ede9d47614d0..21927ea59bdc 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallDialogs/CallDialogAutomatedLiveTests.cs @@ -13,6 +13,7 @@ namespace Azure.Communication.CallAutomation.Tests.CallDialogs { + [Ignore("Dialog Bot disabled")] internal class CallDialogAutomatedLiveTests : CallAutomationClientAutomatedLiveTestsBase { private const string dialogId = "92e08834-b6ee-4ede-8956-9fefa27a691c"; @@ -38,29 +39,12 @@ public async Task DialogOperationsTest() CommunicationIdentifier target; // when in playback, use Sanatized values - if (Mode == RecordedTestMode.Playback) - { - sourcePhone = new PhoneNumberIdentifier("Sanitized"); - target = new PhoneNumberIdentifier("Sanitized"); - } - else - { - PhoneNumbersClient phoneNumbersClient = new PhoneNumbersClient(TestEnvironment.LiveTestStaticConnectionString); - var purchasedPhoneNumbers = phoneNumbersClient.GetPurchasedPhoneNumbersAsync(); - List phoneNumbers = new List(); - await foreach (var phoneNumber in purchasedPhoneNumbers) - { - phoneNumbers.Add(phoneNumber.PhoneNumber); - Console.WriteLine($"Phone number: {phoneNumber.PhoneNumber}, monthly cost: {phoneNumber.Cost}"); - } - target = new PhoneNumberIdentifier(phoneNumbers[1]); - sourcePhone = new PhoneNumberIdentifier(phoneNumbers[0]); - } + GetPhoneNumbers(out sourcePhone, out target); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); // setup service bus - var uniqueId = await ServiceBusWithNewCall(sourcePhone, target); + string uniqueId = await ServiceBusWithNewCall(sourcePhone, target); // create call and assert response CallInvite invite = new CallInvite((PhoneNumberIdentifier)target, (PhoneNumberIdentifier)sourcePhone); @@ -125,7 +109,7 @@ public async Task DialogOperationsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -169,7 +153,7 @@ public async Task DifferingConcurrentDialogsTest() CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); // setup service bus - var uniqueId = await ServiceBusWithNewCall(sourcePhone, target); + string uniqueId = await ServiceBusWithNewCall(sourcePhone, target); // create call and assert response CallInvite invite = new CallInvite((PhoneNumberIdentifier)target, (PhoneNumberIdentifier)sourcePhone); @@ -246,7 +230,7 @@ public async Task DifferingConcurrentDialogsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -290,7 +274,7 @@ public async Task DialogOperationsTest_AzureOpenAI() CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); // setup service bus - var uniqueId = await ServiceBusWithNewCall(sourcePhone, target); + string uniqueId = await ServiceBusWithNewCall(sourcePhone, target); // create call and assert response CallInvite invite = new CallInvite((PhoneNumberIdentifier)target, (PhoneNumberIdentifier)sourcePhone); @@ -357,7 +341,7 @@ public async Task DialogOperationsTest_AzureOpenAI() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -402,7 +386,7 @@ public async Task IdenticalDialogsTest() CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); // setup service bus - var uniqueId = await ServiceBusWithNewCall(sourcePhone, target); + string uniqueId = await ServiceBusWithNewCall(sourcePhone, target); // create call and assert response CallInvite invite = new CallInvite((PhoneNumberIdentifier)target, (PhoneNumberIdentifier)sourcePhone); @@ -468,7 +452,7 @@ public async Task IdenticalDialogsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -512,7 +496,7 @@ public async Task SubsequentDialogsTest() CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); // setup service bus - var uniqueId = await ServiceBusWithNewCall(sourcePhone, target); + string uniqueId = await ServiceBusWithNewCall(sourcePhone, target); // create call and assert response CallInvite invite = new CallInvite((PhoneNumberIdentifier)target, (PhoneNumberIdentifier)sourcePhone); @@ -591,7 +575,7 @@ public async Task SubsequentDialogsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -635,7 +619,7 @@ public async Task StopNonexistingDialogTest() CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); // setup service bus - var uniqueId = await ServiceBusWithNewCall(sourcePhone, target); + string uniqueId = await ServiceBusWithNewCall(sourcePhone, target); // create call and assert response CallInvite invite = new CallInvite((PhoneNumberIdentifier)target, (PhoneNumberIdentifier)sourcePhone); @@ -678,7 +662,7 @@ public async Task StopNonexistingDialogTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs index 0854c0b49654..67425198303f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaAutomatedLiveTests.cs @@ -2,13 +2,13 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Threading.Tasks; -using NUnit.Framework; using Azure.Communication.CallAutomation.Tests.Infrastructure; +using Azure.Communication.PhoneNumbers; using Azure.Core.TestFramework; using Microsoft.AspNetCore.Http; -using Azure.Communication.PhoneNumbers; -using System.Collections.Generic; +using NUnit.Framework; namespace Azure.Communication.CallAutomation.Tests.CallMedias { @@ -138,8 +138,2780 @@ public async Task continuousDtmfDetectionAndSendDtmfTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayMultipleFilesSourcesWithPlayMediaTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // multiple File Source + var playFileSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ) + }; + + PlayOptions options = new PlayOptions(playFileSources, new List() { target }) { OperationContext = "context" }; + + // Assert the Play with multiple File Sources + await callConnection.GetCallMedia().PlayAsync(options).ConfigureAwait(false); + var playCompletedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playCompletedEvent); + Assert.IsTrue(playCompletedEvent is PlayCompleted); + Assert.AreEqual(callConnectionId, ((PlayCompleted)playCompletedEvent!).CallConnectionId); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayMultipleFilesSourcesWithPlayMediaAllTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // multiple File Source + var playFileSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ) + }; + + PlayToAllOptions options = new PlayToAllOptions(playFileSources) { OperationContext = "context" }; + + // Assert the Play with multiple File Sources + await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false); + var playCompletedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playCompletedEvent); + Assert.IsTrue(playCompletedEvent is PlayCompleted); + Assert.AreEqual(callConnectionId, ((PlayCompleted)playCompletedEvent!).CallConnectionId); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayMultipleTextSourcesWithPlayMediaTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // multiple Text Source + var playTextSources = new List() { + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" }, + new TextSource("Test prompt2") { VoiceName = "en-US-NancyNeural" }, + new TextSource("Test prompt3") { VoiceName = "en-US-NancyNeural" } + }; + + PlayOptions options = new PlayOptions(playTextSources, new List() { target }) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayAsync(options).ConfigureAwait(false); + var playCompletedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playCompletedEvent); + Assert.IsTrue(playCompletedEvent is PlayCompleted); + Assert.AreEqual(callConnectionId, ((PlayCompleted)playCompletedEvent!).CallConnectionId); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayMultipleTextSourcesWithPlayMediaAllTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // multiple Text Source + var playTextSources = new List() { + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" }, + new TextSource("Test prompt2") { VoiceName = "en-US-NancyNeural" }, + new TextSource("Test prompt3") { VoiceName = "en-US-NancyNeural" } + }; + + PlayToAllOptions options = new PlayToAllOptions(playTextSources) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false); + var playCompletedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playCompletedEvent); + Assert.IsTrue(playCompletedEvent is PlayCompleted); + Assert.AreEqual(callConnectionId, ((PlayCompleted)playCompletedEvent!).CallConnectionId); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayCombinedTextAndFileSourcesWithPlayMediaTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // multiple Sources + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" } + }; + + PlayOptions options = new PlayOptions(playMultipleSources, new List() { target }) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayAsync(options).ConfigureAwait(false); + var playCompletedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playCompletedEvent); + Assert.IsTrue(playCompletedEvent is PlayCompleted); + Assert.AreEqual(callConnectionId, ((PlayCompleted)playCompletedEvent!).CallConnectionId); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayCombinedTextAndFileSourcesWithPlayMediaAllTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // multiple Sources + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" } + }; + + PlayToAllOptions options = new PlayToAllOptions(playMultipleSources) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false); + var playCompletedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playCompletedEvent); + Assert.IsTrue(playCompletedEvent is PlayCompleted); + Assert.AreEqual(callConnectionId, ((PlayCompleted)playCompletedEvent!).CallConnectionId); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayInvalidFileSourceWithPlayMediaTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // Assert multiple Text Source with wrong file source play failed event + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + PlayOptions options = new PlayOptions(playMultipleSources, new List() { target }) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayAsync(options).ConfigureAwait(false); + var playFailedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playFailedEvent); + Assert.IsTrue(playFailedEvent is PlayFailed); + Assert.AreEqual(callConnectionId, ((PlayFailed)playFailedEvent!).CallConnectionId); + Assert.AreEqual(0, ((PlayFailed)playFailedEvent!).FailedPlaySourceIndex); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayInvalidAndValidFileSourceWithPlayMediaTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // Assert multiple Text Source with wrong file source play failed event + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + PlayOptions options = new PlayOptions(playMultipleSources, new List() { target }) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayAsync(options).ConfigureAwait(false); + var playFailedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playFailedEvent); + Assert.IsTrue(playFailedEvent is PlayFailed); + Assert.AreEqual(callConnectionId, ((PlayFailed)playFailedEvent!).CallConnectionId); + Assert.AreEqual(1, ((PlayFailed)playFailedEvent!).FailedPlaySourceIndex); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayInvalidFileSourceWithPlayMediaAllTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // Assert multiple Text Source with wrong file source play failed event + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + PlayToAllOptions options = new PlayToAllOptions(playMultipleSources) { OperationContext = "context" }; + + // Assert the Play with invalid file source + await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false); + var playFailedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playFailedEvent); + Assert.IsTrue(playFailedEvent is PlayFailed); + Assert.AreEqual(callConnectionId, ((PlayFailed)playFailedEvent!).CallConnectionId); + Assert.AreEqual(0, ((PlayFailed)playFailedEvent!).FailedPlaySourceIndex); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task PlayInvalidAndInvalidFileSourceWithPlayMediaAllTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, false); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // Assert multiple Text Source with wrong file source play failed event + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl) ), + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + PlayToAllOptions options = new PlayToAllOptions(playMultipleSources) { OperationContext = "context" }; + + // Assert the Play with multiple Text Sources + await callConnection.GetCallMedia().PlayToAllAsync(options).ConfigureAwait(false); + var playFailedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(playFailedEvent); + Assert.IsTrue(playFailedEvent is PlayFailed); + Assert.AreEqual(callConnectionId, ((PlayFailed)playFailedEvent!).CallConnectionId); + Assert.AreEqual(1, ((PlayFailed)playFailedEvent!).FailedPlaySourceIndex); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task DtmfRecognizeWithMultipleFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Dtmf; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new FileSource(new Uri(TestEnvironment.FileSourceUrl)) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task DtmfRecognizeWithMultipleTextSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.Dtmf; + + // Assert multiple Text Sources + var playTextSources = new List() { + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice }, + new TextSource("Test prompt2") { VoiceName = SpeechToTextVoice }, + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playTextSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task DtmfRecognizeWithCombinationOfTextAndFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.Dtmf; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task DtmfRecognizeWithInvalidFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Dtmf; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task DtmfRecognizeWithInvalidFileSourceWithValidSourceTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Dtmf; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")), + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechRecognizeWithMultipleFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Speech; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new FileSource(new Uri(TestEnvironment.FileSourceUrl)) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechRecognizeWithMultipleTextSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.Speech; + + // Assert multiple Text Sources + var playTextSources = new List() { + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice }, + new TextSource("Test prompt2") { VoiceName = SpeechToTextVoice }, + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playTextSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechRecognizeWithCombinationOfTextAndFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.Speech; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechRecognizeWithInvalidFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Speech; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechRecognizeWithInvalidFileSourceWithValidSourceTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Speech; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")), + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task ChoiceRecognizeWithMultipleFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Choices; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new FileSource(new Uri(TestEnvironment.FileSourceUrl)) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task ChoiceRecognizeWithMultipleTextSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.Choices; + + // Assert multiple Text Sources + var playTextSources = new List() { + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice }, + new TextSource("Test prompt2") { VoiceName = SpeechToTextVoice }, + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playTextSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task ChoiceRecognizeWithCombinationOfTextAndFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.Choices; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task ChoiceRecognizeWithInvalidFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Choices; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task ChoiceRecognizeWithInvalidFileSourceWithValidSourceTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.Choices; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")), + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechOrDtmfRecognizeWithMultipleFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.SpeechOrDtmf; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new FileSource(new Uri(TestEnvironment.FileSourceUrl)) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechOrDtmfRecognizeWithMultipleTextSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.SpeechOrDtmf; + + // Assert multiple Text Sources + var playTextSources = new List() { + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice }, + new TextSource("Test prompt2") { VoiceName = SpeechToTextVoice }, + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playTextSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechOrDtmfRecognizeWithCombinationOfTextAndFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + string SpeechToTextVoice = "en-US-NancyNeural"; + RecognizeInputType recognizeInputType = RecognizeInputType.SpeechOrDtmf; + + // Assert combination of text and file source + var playMultipleSources = new List() { + new FileSource(new Uri(TestEnvironment.FileSourceUrl)), + new TextSource("Test prompt1") { VoiceName = SpeechToTextVoice } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechOrDtmfRecognizeWithInvalidFileSourcesTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.SpeechOrDtmf; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")) + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task SpeechOrDtmfRecognizeWithInvalidFileSourceWithValidSourceTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId, true); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + RecognizeInputType recognizeInputType = RecognizeInputType.SpeechOrDtmf; + + // Assert multiple Text Source with wrong file source + var playMultipleSources = new List() { + new FileSource(new Uri("https://dummy.com/dummyurl.wav")), + new TextSource("Test prompt1") { VoiceName = "en-US-NancyNeural" } + }; + + await VerifyRecognizeFailedEventForMultipleSources(callConnectionId, client, playMultipleSources, target, recognizeInputType, null, true); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task HoldUnholdParticipantInACallTest() + { + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + var result = await CreateAndAnswerCall(client, targetClient, target, uniqueId); + callConnectionId = result.CallerCallConnectionId; + var participantToAdd = await CreateIdentityUserAsync().ConfigureAwait(false); + var callConnection = client.GetCallConnection(callConnectionId); + + // wait for callConnected + var addParticipantSucceededEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(addParticipantSucceededEvent); + Assert.IsTrue(addParticipantSucceededEvent is ParticipantsUpdated); + Assert.IsTrue(((ParticipantsUpdated)addParticipantSucceededEvent!).CallConnectionId == callConnectionId); + + // Assert the participant hold + await callConnection.GetCallMedia().HoldAsync(target).ConfigureAwait(false); + await Task.Delay(1000); + var participantResult = await callConnection.GetParticipantAsync(target).ConfigureAwait(false); + Assert.IsNotNull(participantResult); + Assert.IsTrue(participantResult.Value.IsOnHold); + + // Assert the participant unhold + await callConnection.GetCallMedia().UnholdAsync(target).ConfigureAwait(false); + + await Task.Delay(1000); + + participantResult = await callConnection.GetParticipantAsync(target).ConfigureAwait(false); + Assert.IsNotNull(participantResult); + Assert.IsFalse(participantResult.Value.IsOnHold); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task CreateCallWithMediaStreamingTest() + { + /* Tests: CreateCall, Media Streaming + * Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. Start Media Streaming and Stop Media Streaming + * 3. See Media Streaming started and stopped in call + */ + + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + MediaStreamingOptions mediaStreamingOptions = new MediaStreamingOptions( + new Uri(TestEnvironment.TransportUrl), + MediaStreamingContent.Audio, + MediaStreamingAudioChannel.Mixed, + MediaStreamingTransport.Websocket, + false); + + var result = await CreateAndAnswerCallWithMediaOrTranscriptionOptions(client, targetClient, target, uniqueId, true, + mediaStreamingOptions, transcriptionOptions: null); + callConnectionId = result.CallerCallConnectionId; + await VerifyMediaStreaming(client, result.CallerCallConnectionId); + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task AnswerCallWithMediaStreamingTest() + { + /* Tests: CreateCall, Media Streaming + * Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. Start Media Streaming and Stop Media Streaming + * 3. See Media Streaming started and stopped in call + */ + + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + MediaStreamingOptions mediaStreamingOptions = new MediaStreamingOptions( + new Uri(TestEnvironment.TransportUrl), + MediaStreamingContent.Audio, + MediaStreamingAudioChannel.Mixed, + MediaStreamingTransport.Websocket, + false); + + var result = await CreateAndAnswerCallWithMediaOrTranscriptionOptions(client, targetClient, target, uniqueId, false, + mediaStreamingOptions, transcriptionOptions: null); + callConnectionId = result.TargetCallConnectionId; + await VerifyMediaStreaming(targetClient, result.TargetCallConnectionId); + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task AnswerCallWithMediaStreamingUnmixedTest() + { + /* Tests: CreateCall, Media Streaming + * Test case: ACS to ACS call + * 1. create a CallAutomationClient. + * 2. Start Media Streaming and Stop Media Streaming + * 3. See Media Streaming started and stopped in call + */ + + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + MediaStreamingOptions mediaStreamingOptions = new MediaStreamingOptions( + new Uri(TestEnvironment.TransportUrl), + MediaStreamingContent.Audio, + MediaStreamingAudioChannel.Unmixed, + MediaStreamingTransport.Websocket, + false); + + var result = await CreateAndAnswerCallWithMediaOrTranscriptionOptions(client, targetClient, target, uniqueId, false, + mediaStreamingOptions, transcriptionOptions: null); + callConnectionId = result.TargetCallConnectionId; + await VerifyMediaStreaming(targetClient, result.TargetCallConnectionId); + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task CreateCallAndTranscriptionTest() + { + /* Tests: CreateCall, Transcription + * Test case: ACS to ACS call + * 1. create a call with transcription options + * 2. Answer a call + * 3. Start Transcription and Stop Transcription + * 3. See Transcription started and stopped event triggerred + */ + + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + TranscriptionOptions transcriptionOptions = new TranscriptionOptions( + new Uri(TestEnvironment.TransportUrl), + "en-CA", + false); + var result = await CreateAndAnswerCallWithMediaOrTranscriptionOptions(client, targetClient, target, uniqueId, true, + null, transcriptionOptions); + callConnectionId = result.CallerCallConnectionId; + await VerifyTranscription(targetClient, result.CallerCallConnectionId); + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + [RecordedTest] + public async Task AnswerCallAndTranscriptionTest() + { + /* Tests: CreateCall, Transcription + * Test case: ACS to ACS call + * 1. create a call + * 2. Answer a call with transcription options + * 3. Start Transcription and Stop Transcription + * 3. See Transcription started and stopped event triggerred + */ + + // create caller and receiver + CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); + CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false); + CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); + CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); + string? callConnectionId = null, uniqueId = null; + + try + { + try + { + // setup service bus + uniqueId = await ServiceBusWithNewCall(user, target); + + // create call and assert response + TranscriptionOptions transcriptionOptions = new TranscriptionOptions( + new Uri(TestEnvironment.TransportUrl), + "en-CA", + false); + var result = await CreateAndAnswerCallWithMediaOrTranscriptionOptions(client, targetClient, target, uniqueId, false, + null, transcriptionOptions); + callConnectionId = result.TargetCallConnectionId; + await VerifyTranscription(targetClient, result.TargetCallConnectionId); + try + { + // test get properties + Response properties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (ex.Status == 404) + { + callConnectionId = null; + return; + } + } + } + catch (Exception) + { + throw; + } + } + catch (Exception ex) + { + Assert.Fail($"Unexpected error: {ex}"); + } + finally + { + await CleanUpCall(client, callConnectionId, uniqueId); + } + } + + public async Task<(string CallerCallConnectionId, string TargetCallConnectionId)> CreateAndAnswerCall(CallAutomationClient client, + CallAutomationClient targetClient, + CommunicationUserIdentifier target, + string uniqueId, + bool createCallWithCogService = false) + { + try + { + // create call and assert response + var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + if (createCallWithCogService) + { + createCallOptions.CallIntelligenceOptions = new CallIntelligenceOptions() { CognitiveServicesEndpoint = new Uri(TestEnvironment.CognitiveServiceEndpoint) }; + } + CreateCallResult response = await client.CreateCallAsync(createCallOptions).ConfigureAwait(false); + var callerCallConnectionId = response.CallConnectionProperties.CallConnectionId; + Assert.IsNotEmpty(response.CallConnectionProperties.CallConnectionId); + + // wait for incomingcall context + string? incomingCallContext = await WaitForIncomingCallContext(uniqueId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(incomingCallContext); + + // answer the call + var answerCallOptions = new AnswerCallOptions(incomingCallContext, new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + AnswerCallResult answerResponse = await targetClient.AnswerCallAsync(answerCallOptions); + + var targetCallConnectionId = answerResponse.CallConnectionProperties.CallConnectionId; + // wait for callConnected + + var connectedEvent = await WaitForEvent(targetCallConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(connectedEvent); + Assert.IsTrue(connectedEvent is CallConnected); + Assert.AreEqual(targetCallConnectionId, ((CallConnected)connectedEvent!).CallConnectionId); + return (callerCallConnectionId, targetCallConnectionId); + } + catch (Exception) + { + throw; + } + } + private async Task<(string CallerCallConnectionId, string TargetCallConnectionId)> CreateAndAnswerCallWithMediaOrTranscriptionOptions( + CallAutomationClient client, + CallAutomationClient targetClient, + CommunicationUserIdentifier target, + string uniqueId, + bool isOutboundValidation, + MediaStreamingOptions? mediaStreamingOptions, + TranscriptionOptions? transcriptionOptions + ) + { + try + { + // create call and assert response + var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + if (isOutboundValidation) + { + if (mediaStreamingOptions != null) + { + createCallOptions.MediaStreamingOptions = mediaStreamingOptions; + } + if (transcriptionOptions != null) + { + createCallOptions.TranscriptionOptions = transcriptionOptions; + createCallOptions.CallIntelligenceOptions = new CallIntelligenceOptions() + { + CognitiveServicesEndpoint = new Uri(TestEnvironment.CognitiveServiceEndpoint) + }; + } + } + CreateCallResult response = await client.CreateCallAsync(createCallOptions).ConfigureAwait(false); + var callerCallConnectionId = response.CallConnectionProperties.CallConnectionId; + Assert.IsNotEmpty(response.CallConnectionProperties.CallConnectionId); + + // wait for incomingcall context + string? incomingCallContext = await WaitForIncomingCallContext(uniqueId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(incomingCallContext); + + // answer the call + var answerCallOptions = new AnswerCallOptions(incomingCallContext, new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); + if (!isOutboundValidation) + { + if (mediaStreamingOptions != null) + { + answerCallOptions.MediaStreamingOptions = mediaStreamingOptions; + } + if (transcriptionOptions != null) + { + answerCallOptions.TranscriptionOptions = transcriptionOptions; + answerCallOptions.CallIntelligenceOptions = new CallIntelligenceOptions() + { + CognitiveServicesEndpoint = new Uri(TestEnvironment.CognitiveServiceEndpoint) + }; + } + } + AnswerCallResult answerResponse = await targetClient.AnswerCallAsync(answerCallOptions); + + var targetCallConnectionId = answerResponse.CallConnectionProperties.CallConnectionId; + // wait for callConnected + + var connectedEvent = await WaitForEvent(targetCallConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(connectedEvent); + Assert.IsTrue(connectedEvent is CallConnected); + Assert.AreEqual(targetCallConnectionId, ((CallConnected)connectedEvent!).CallConnectionId); + return (callerCallConnectionId, targetCallConnectionId); + } + catch (Exception) + { + throw; + } + } + + private async Task VerifyMediaStreaming(CallAutomationClient client, + string callConnectionId) + { + //Start media streaming + StartMediaStreamingOptions startMediaStreamingOptions = new StartMediaStreamingOptions() + { + OperationContext = "startMediaStreamingContext" + }; + + var callerMedia = client.GetCallConnection(callConnectionId).GetCallMedia(); + await callerMedia.StartMediaStreamingAsync(startMediaStreamingOptions); + + // wait for callConnected + var mediaStreamingStartedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(mediaStreamingStartedEvent); + Assert.IsTrue(mediaStreamingStartedEvent is MediaStreamingStarted); + + // Assert call connection properties + var connectionProperties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.IsNotNull(connectionProperties); + Assert.IsNotNull(connectionProperties.Value.MediaStreamingSubscription); + Assert.AreEqual(connectionProperties.Value.MediaStreamingSubscription.State, MediaStreamingSubscriptionState.Active); + + //Stop media streaming + StopMediaStreamingOptions stopMediaStreamingOptions = new StopMediaStreamingOptions(); + + await callerMedia.StopMediaStreamingAsync(stopMediaStreamingOptions); + + // wait for callConnected + var stopMediaStreamingEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(stopMediaStreamingEvent); + Assert.IsTrue(stopMediaStreamingEvent is MediaStreamingStopped); + + // Assert call connection properties + connectionProperties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.IsNotNull(connectionProperties); + Assert.IsNotNull(connectionProperties.Value.MediaStreamingSubscription); + Assert.AreEqual(connectionProperties.Value.MediaStreamingSubscription.State, MediaStreamingSubscriptionState.Inactive); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + } + + private async Task VerifyTranscription(CallAutomationClient client, string callConnectionId) + { + //Start Transcription + StartTranscriptionOptions startTranscriptionOptions = new StartTranscriptionOptions() + { + Locale = "en-CA", + OperationContext = "StartTranscription" + }; + + var callerMedia = client.GetCallConnection(callConnectionId).GetCallMedia(); + var startTranscriptionResponse = await callerMedia.StartTranscriptionAsync(startTranscriptionOptions); + var startTranscriptionEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(startTranscriptionEvent); + Assert.IsTrue(startTranscriptionEvent is TranscriptionStarted); + + var source = new TextSource("Hello, this is live test", "en-US-ElizabethNeural"); + var options = new PlayToAllOptions(source) { OperationContext = "playalloptionduringtranscription" }; + callerMedia.PlayToAll(options); + + // test get properties + var connectionProperties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.IsNotNull(connectionProperties); + Assert.IsNotNull(connectionProperties.Value.TranscriptionSubscription); + Assert.AreEqual(connectionProperties.Value.TranscriptionSubscription.State, TranscriptionSubscriptionState.Active); + + // Update Transcription + UpdateTranscriptionOptions updateTranscriptionOptions = new UpdateTranscriptionOptions("en-US") { OperationContext = "UpdateTranscription" }; + var updateTranscriptionResponse = await callerMedia.UpdateTranscriptionAsync(updateTranscriptionOptions); + var updateTranscriptionEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(updateTranscriptionEvent); + Assert.IsTrue(updateTranscriptionEvent is TranscriptionUpdated); + + connectionProperties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.IsNotNull(connectionProperties); + Assert.IsNotNull(connectionProperties.Value.TranscriptionSubscription); + Assert.AreEqual(connectionProperties.Value.TranscriptionSubscription.State, TranscriptionSubscriptionState.Active); + + //Stop Transcription + StopTranscriptionOptions stopTranscriptionOptions = new StopTranscriptionOptions() { OperationContext = "StopTranscription" }; + var stopTranscriptionResponse = await callerMedia.StopTranscriptionAsync(stopTranscriptionOptions); + + var stopTranscriptionEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(stopTranscriptionEvent); + Assert.IsTrue(stopTranscriptionEvent is TranscriptionStopped); + + connectionProperties = await client.GetCallConnection(callConnectionId).GetCallConnectionPropertiesAsync().ConfigureAwait(false); + Assert.IsNotNull(connectionProperties); + Assert.IsNotNull(connectionProperties.Value.TranscriptionSubscription); + Assert.AreEqual(connectionProperties.Value.TranscriptionSubscription.State, TranscriptionSubscriptionState.Inactive); + + // try hangup + await client.GetCallConnection(callConnectionId).HangUpAsync(true).ConfigureAwait(false); + var disconnectedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(disconnectedEvent); + Assert.IsTrue(disconnectedEvent is CallDisconnected); + Assert.AreEqual(callConnectionId, ((CallDisconnected)disconnectedEvent!).CallConnectionId); + } + + private async Task VerifyRecognizeFailedEventForMultipleSources(string callConnectionId, + CallAutomationClient client, List playMultipleSources, + CommunicationUserIdentifier target, + RecognizeInputType recognizeInputType, + PlaySource? playSource = null, + bool isInvalidSourceCheck = false, + bool expectedBadRequestCheck = false) + { + // Assert the playall with multiple Text Sources + var recognizeOptions = GetRecognizeOptions(playMultipleSources, target, recognizeInputType, playSource); + Assert.IsNotNull(recognizeOptions); + + var callConnection = client.GetCallConnection(callConnectionId); + + try + { + await callConnection.GetCallMedia().StartRecognizingAsync(recognizeOptions).ConfigureAwait(false); + } + catch (RequestFailedException ex) + { + if (expectedBadRequestCheck) + { + if (ex.Status == 400) + { + return; + } + } + } + + // Assert the playall with multiple Text Sources + var recognizeFailedEvent = await WaitForEvent(callConnectionId, TimeSpan.FromSeconds(20)); + Assert.IsNotNull(recognizeFailedEvent); + Assert.IsTrue(recognizeFailedEvent is RecognizeFailed); + Assert.AreEqual(callConnectionId, ((RecognizeFailed)recognizeFailedEvent!).CallConnectionId); + if (expectedBadRequestCheck) + { + Assert.AreEqual(MediaEventReasonCode.PlayInvalidFileFormat, ((RecognizeFailed)recognizeFailedEvent!).ReasonCode); + } + else if (isInvalidSourceCheck) + { + Assert.AreEqual(0, ((RecognizeFailed)recognizeFailedEvent!).FailedPlaySourceIndex); + } + else + { + Assert.AreEqual(MediaEventReasonCode.RecognizeInitialSilenceTimedOut, ((RecognizeFailed)recognizeFailedEvent!).ReasonCode); + if (recognizeInputType != RecognizeInputType.Dtmf) + Assert.IsNull(((RecognizeFailed)recognizeFailedEvent!).FailedPlaySourceIndex); + } + } + + private CallMediaRecognizeOptions? GetRecognizeOptions(List playSources, + CommunicationUserIdentifier target, + RecognizeInputType type, + PlaySource? playSource = null) + { + CallMediaRecognizeOptions? recognizeOptions = type.ToString() switch + { + "dtmf" => new CallMediaRecognizeDtmfOptions(targetParticipant: target, 2) + { + InterruptPrompt = false, + InitialSilenceTimeout = TimeSpan.FromSeconds(5), + PlayPrompts = playSources, + Prompt = playSource ?? null, + OperationContext = "dtmfContext", + InterToneTimeout = TimeSpan.FromSeconds(5) + }, + "choices" => new CallMediaRecognizeChoiceOptions(targetParticipant: target, GetChoices()) + { + InterruptCallMediaOperation = false, + InterruptPrompt = false, + InitialSilenceTimeout = TimeSpan.FromSeconds(5), + Prompt = playSource ?? null, + PlayPrompts = playSources, + OperationContext = "choiceContext" + }, + "speech" => new CallMediaRecognizeSpeechOptions(target) + { + Prompt = playSource ?? null, + PlayPrompts = playSources, + EndSilenceTimeout = TimeSpan.FromMilliseconds(1000), + OperationContext = "speechContext" + }, + "speechOrDtmf" => new CallMediaRecognizeSpeechOrDtmfOptions(target, 2) + { + PlayPrompts = playSources, + Prompt = playSource ?? null, + EndSilenceTimeout = TimeSpan.FromMilliseconds(1000), + InitialSilenceTimeout = TimeSpan.FromSeconds(10), + InterruptPrompt = true, + OperationContext = "speechordtmfContext" + }, + _ => null + }; + + return recognizeOptions; + } + + private List GetChoices() + { + return new List { + new RecognitionChoice("Confirm", new List { + "Confirm", + "First", + "One" + }) { + Tone = DtmfTone.One + }, + new RecognitionChoice("Cancel", new List { + "Cancel", + "Second", + "Two" + }) { + Tone = DtmfTone.Two } + }; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs index c81a7f59b54e..5ec9e51ce66b 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallMedias/CallMediaTests.cs @@ -89,6 +89,17 @@ public class CallMediaTests : CallAutomationTestBase Prompt = new FileSource(new Uri("https://localhost")) }; + private static readonly CallMediaRecognizeOptions _dmtfRecognizeOptionsWithMultiplePlaySources = new CallMediaRecognizeDtmfOptions(new CommunicationUserIdentifier("targetUserId"), maxTonesToCollect: 5) + { + InterruptCallMediaOperation = true, + InterToneTimeout = TimeSpan.FromSeconds(10), + StopTones = new DtmfTone[] { DtmfTone.Pound }, + InitialSilenceTimeout = TimeSpan.FromSeconds(5), + InterruptPrompt = true, + OperationContext = "operationContext", + PlayPrompts = new List { new FileSource(new Uri("https://localhost")), new TextSource("Multiple Play Prompt Test") } + }; + private static CallMediaRecognizeOptions _choiceRecognizeOptions = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("targetUserId"), s_recognizeChoices) { InterruptCallMediaOperation = true, @@ -105,11 +116,10 @@ public class CallMediaTests : CallAutomationTestBase SpeechModelEndpointId = "customModelEndpointId" }; - private static CallMediaRecognizeSpeechOptions _speechRecognizeOptions = new CallMediaRecognizeSpeechOptions(new CommunicationUserIdentifier("targetUserId")) + private static CallMediaRecognizeOptions _choiceRecognizeOptionsWithMultiplePlaySources = new CallMediaRecognizeChoiceOptions(new CommunicationUserIdentifier("targetUserId"), s_recognizeChoices) { InterruptCallMediaOperation = true, InitialSilenceTimeout = TimeSpan.FromSeconds(5), - EndSilenceTimeout = TimeSpan.FromMilliseconds(500), InterruptPrompt = true, OperationContext = "operationContext", Prompt = new TextSource("PlayTTS test text.") @@ -119,10 +129,11 @@ public class CallMediaTests : CallAutomationTestBase VoiceName = "LULU" }, SpeechLanguage = "en-US", - SpeechModelEndpointId = "customModelEndpointId" + SpeechModelEndpointId = "customModelEndpointId", + PlayPrompts = new List { new FileSource(new Uri("https://localhost")), new TextSource("Multiple Play Prompt Test") } }; - private static CallMediaRecognizeSpeechOrDtmfOptions _speechOrDtmfRecognizeOptions = new CallMediaRecognizeSpeechOrDtmfOptions(new CommunicationUserIdentifier("targetUserId"), 10) + private static CallMediaRecognizeSpeechOptions _speechRecognizeOptions = new CallMediaRecognizeSpeechOptions(new CommunicationUserIdentifier("targetUserId")) { InterruptCallMediaOperation = true, InitialSilenceTimeout = TimeSpan.FromSeconds(5), @@ -135,32 +146,69 @@ public class CallMediaTests : CallAutomationTestBase VoiceKind = VoiceKind.Female, VoiceName = "LULU" }, - SpeechLanguage= "en-US", + SpeechLanguage = "en-US", SpeechModelEndpointId = "customModelEndpointId" }; - private static readonly CallMediaRecognizeOptions _emptyRecognizeOptions = new CallMediaRecognizeDtmfOptions(new CommunicationUserIdentifier("targetUserId"), maxTonesToCollect: 1); - - private static readonly StartHoldMusicOptions _startHoldMusicOptions = new StartHoldMusicOptions(new CommunicationUserIdentifier("targetUserId"), _textSource) + private static CallMediaRecognizeSpeechOptions _speechRecognizeOptionsWithMultiplePlaySources = new CallMediaRecognizeSpeechOptions(new CommunicationUserIdentifier("targetUserId")) { + InterruptCallMediaOperation = true, + InitialSilenceTimeout = TimeSpan.FromSeconds(5), + EndSilenceTimeout = TimeSpan.FromMilliseconds(500), + InterruptPrompt = true, OperationContext = "operationContext", + Prompt = new TextSource("PlayTTS test text.") + { + SourceLocale = "en-US", + VoiceKind = VoiceKind.Female, + VoiceName = "LULU" + }, + SpeechLanguage = "en-US", + SpeechModelEndpointId = "customModelEndpointId", + PlayPrompts = new List { new FileSource(new Uri("https://localhost")), new TextSource("Multiple Play Prompt Test") } }; - private static readonly StopHoldMusicOptions _stopHoldMusicOptions = new StopHoldMusicOptions(new CommunicationUserIdentifier("targetUserId")) + private static CallMediaRecognizeSpeechOrDtmfOptions _speechOrDtmfRecognizeOptions = new CallMediaRecognizeSpeechOrDtmfOptions(new CommunicationUserIdentifier("targetUserId"), 10) { - OperationContext = "operationContext" + InterruptCallMediaOperation = true, + InitialSilenceTimeout = TimeSpan.FromSeconds(5), + EndSilenceTimeout = TimeSpan.FromMilliseconds(500), + InterruptPrompt = true, + OperationContext = "operationContext", + Prompt = new TextSource("PlayTTS test text.") + { + SourceLocale = "en-US", + VoiceKind = VoiceKind.Female, + VoiceName = "LULU" + }, + SpeechLanguage = "en-US", + SpeechModelEndpointId = "customModelEndpointId" }; - private static readonly HoldOptions _holdOptions = new HoldOptions(new CommunicationUserIdentifier("targetUserId")) + private static CallMediaRecognizeSpeechOrDtmfOptions _speechOrDtmfRecognizeOptionsWithMultiplePlaySources = new CallMediaRecognizeSpeechOrDtmfOptions(new CommunicationUserIdentifier("targetUserId"), 10) { + InterruptCallMediaOperation = true, + InitialSilenceTimeout = TimeSpan.FromSeconds(5), + EndSilenceTimeout = TimeSpan.FromMilliseconds(500), + InterruptPrompt = true, OperationContext = "operationContext", - PlaySourceInfo = _textSource, - OperationCallbackUri = new Uri("https://localhost") + Prompt = new TextSource("PlayTTS test text.") + { + SourceLocale = "en-US", + VoiceKind = VoiceKind.Female, + VoiceName = "LULU" + }, + SpeechLanguage = "en-US", + SpeechModelEndpointId = "customModelEndpointId", + PlayPrompts = new List { new FileSource(new Uri("https://localhost")), new TextSource("Multiple Play Prompt Test") } }; - private static readonly HoldOptions _holdOptionsNoMusic = new HoldOptions(new CommunicationUserIdentifier("targetUserId")) + private static readonly CallMediaRecognizeOptions _emptyRecognizeOptions = new CallMediaRecognizeDtmfOptions(new CommunicationUserIdentifier("targetUserId"), maxTonesToCollect: 1); + + private static readonly HoldOptions _holdOptions = new HoldOptions(new CommunicationUserIdentifier("targetUserId")) { OperationContext = "operationContext", + PlaySource = _textSource, OperationCallbackUri = new Uri("https://localhost") }; @@ -264,6 +312,24 @@ public async Task UpdateTranscriptionOperationsAsync_Return202Accepted(Func> operation) + { + _callMedia = GetCallMedia(202); + var result = await operation(_callMedia); + Assert.IsNotNull(result); + Assert.AreEqual((int)HttpStatusCode.Accepted, result.Status); + } + + [TestCaseSource(nameof(TestData_StopMediaStreamingOperationsAsync))] + public async Task StopMediaStreamingOperationsAsync_Return202Accepted(Func> operation) + { + _callMedia = GetCallMedia(202); + var result = await operation(_callMedia); + Assert.IsNotNull(result); + Assert.AreEqual((int)HttpStatusCode.Accepted, result.Status); + } + [TestCaseSource(nameof(TestData_PlayOperations))] public void MediaOperations_Return202Accepted(Func> operation) { @@ -354,6 +420,24 @@ public void UpdateTranscriptionOperations_Return202Accepted(Func operation) + { + _callMedia = GetCallMedia(202); + var result = operation(_callMedia); + Assert.IsNotNull(result); + Assert.AreEqual((int)HttpStatusCode.Accepted, result.Status); + } + + [TestCaseSource(nameof(TestData_StopMediaStreamingOperations))] + public void StopMediaStreamingOperations_Return202Accepted(Func operation) + { + _callMedia = GetCallMedia(202); + var result = operation(_callMedia); + Assert.IsNotNull(result); + Assert.AreEqual((int)HttpStatusCode.Accepted, result.Status); + } + [TestCaseSource(nameof(TestData_PlayOperationsAsync))] public void PlayOperationsAsync_Return404NotFound(Func>> operation) { @@ -444,6 +528,26 @@ public void StopTranscriptionOperationsAsync_Return404NotFound(Func> operation) + { + _callMedia = GetCallMedia(404); + RequestFailedException? ex = Assert.ThrowsAsync( + async () => await operation(_callMedia)); + Assert.NotNull(ex); + Assert.AreEqual(ex?.Status, 404); + } + + [TestCaseSource(nameof(TestData_StopMediaStreamingOperationsAsync))] + public void StopMediaStreamingOperationsAsync_Return404NotFound(Func> operation) + { + _callMedia = GetCallMedia(404); + RequestFailedException? ex = Assert.ThrowsAsync( + async () => await operation(_callMedia)); + Assert.NotNull(ex); + Assert.AreEqual(ex?.Status, 404); + } + [TestCaseSource(nameof(TestData_PlayOperations))] public void PlayOperations_Return404NotFound(Func> operation) { @@ -562,6 +666,26 @@ public void HoldMusicOperations_Return200Ok(Func operation) Assert.AreEqual((int)HttpStatusCode.OK, result.Status); } + [TestCaseSource(nameof(TestData_StartMediaStreamingOperations))] + public void StartMediaStreamingOperations_Return404NotFound(Func operation) + { + _callMedia = GetCallMedia(404); + RequestFailedException? ex = Assert.Throws( + () => operation(_callMedia)); + Assert.NotNull(ex); + Assert.AreEqual(ex?.Status, 404); + } + + [TestCaseSource(nameof(TestData_StopMediaStreamingOperations))] + public void StopMediaStreamingOperations_Return404NotFound(Func operation) + { + _callMedia = GetCallMedia(404); + RequestFailedException? ex = Assert.Throws( + () => operation(_callMedia)); + Assert.NotNull(ex); + Assert.AreEqual(ex?.Status, 404); + } + private static IEnumerable TestData_PlayOperationsAsync() { return new[] @@ -641,16 +765,32 @@ public void HoldMusicOperations_Return200Ok(Func operation) callMedia => callMedia.StartRecognizingAsync(_dmtfRecognizeOptions) }, new Func>>?[] + { + callMedia => callMedia.StartRecognizingAsync(_dmtfRecognizeOptionsWithMultiplePlaySources) + }, + new Func>>?[] { callMedia => callMedia.StartRecognizingAsync(_choiceRecognizeOptions) + }, + new Func>>?[] + { + callMedia => callMedia.StartRecognizingAsync(_choiceRecognizeOptionsWithMultiplePlaySources) }, new Func>>?[] { callMedia => callMedia.StartRecognizingAsync(_speechRecognizeOptions) }, new Func>>?[] + { + callMedia => callMedia.StartRecognizingAsync(_speechRecognizeOptionsWithMultiplePlaySources) + }, + new Func>>?[] { callMedia => callMedia.StartRecognizingAsync(_speechOrDtmfRecognizeOptions) + }, + new Func>>?[] + { + callMedia => callMedia.StartRecognizingAsync(_speechOrDtmfRecognizeOptionsWithMultiplePlaySources) }, new Func>>?[] { @@ -805,19 +945,11 @@ public void HoldMusicOperations_Return200Ok(Func operation) { return new[] { - new Func>?[] - { - callMedia => callMedia.StartHoldMusicAsync(_startHoldMusicOptions) - }, new Func>?[] { callMedia => callMedia.HoldAsync(_holdOptions) }, new Func>?[] - { - callMedia => callMedia.HoldAsync(_holdOptionsNoMusic) - }, - new Func>?[] { callMedia => callMedia.UnholdAsync(_unholdOptions) } @@ -829,19 +961,11 @@ public void HoldMusicOperations_Return200Ok(Func operation) { return new[] { - new Func?[] - { - callMedia => callMedia.StartHoldMusic(_startHoldMusicOptions) - }, new Func?[] { callMedia => callMedia.Hold(_holdOptions) }, new Func?[] - { - callMedia => callMedia.Hold(_holdOptionsNoMusic) - }, - new Func?[] { callMedia => callMedia.Unhold(_unholdOptions) } @@ -910,6 +1034,54 @@ public void HoldMusicOperations_Return200Ok(Func operation) new Func>?[] { callMedia => callMedia.UpdateTranscriptionAsync("locale") + }, + new Func>?[] + { + callMedia => callMedia.UpdateTranscriptionAsync(new UpdateTranscriptionOptions("locale"){SpeechRecognitionModelEndpointId = "customEndpoint", OperationContext="context" }) + } + }; + } + + private static IEnumerable TestData_StartMediaStreamingOperations() + { + return new[] + { + new Func?[] + { + callMedia => callMedia.StartMediaStreaming() + } + }; + } + + private static IEnumerable TestData_StartMediaStreamingOperationsAsync() + { + return new[] + { + new Func>?[] + { + callMedia => callMedia.StartMediaStreamingAsync(new StartMediaStreamingOptions(){OperationCallbackUri = new Uri("https://localhost"), OperationContext = "OperationContext"}) + } + }; + } + + private static IEnumerable TestData_StopMediaStreamingOperations() + { + return new[] + { + new Func?[] + { + callMedia => callMedia.StopMediaStreaming() + } + }; + } + + private static IEnumerable TestData_StopMediaStreamingOperationsAsync() + { + return new[] + { + new Func>?[] + { + callMedia => callMedia.StopMediaStreamingAsync(new StopMediaStreamingOptions(){ OperationCallbackUri = new Uri("https://localhost")}) } }; } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs index 4d0c83e66829..c99756590a88 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/CallRecordings/CallRecordingAutomatedLiveTests.cs @@ -31,7 +31,7 @@ public async Task RecordingOperationsTest() bool stopRecording = false; // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + string uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -111,7 +111,7 @@ public async Task RecordingOperationsTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -134,14 +134,14 @@ public async Task CreateACSCallAndUnmixedAudioTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -209,7 +209,7 @@ public async Task CreateACSCallAndUnmixedAudioTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } @@ -231,14 +231,14 @@ public async Task CreateACSCallUnmixedAudioAffinityTest() CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false); CallAutomationClient client = CreateInstrumentedCallAutomationClientWithConnectionString(user); CallAutomationClient targetClient = CreateInstrumentedCallAutomationClientWithConnectionString(target); - string? callConnectionId = null; + string? callConnectionId = null, uniqueId = null; try { try { // setup service bus - var uniqueId = await ServiceBusWithNewCall(user, target); + uniqueId = await ServiceBusWithNewCall(user, target); // create call and assert response var createCallOptions = new CreateCallOptions(new CallInvite(target), new Uri(TestEnvironment.DispatcherCallback + $"?q={uniqueId}")); @@ -309,7 +309,7 @@ public async Task CreateACSCallUnmixedAudioAffinityTest() } finally { - await CleanUpCall(client, callConnectionId); + await CleanUpCall(client, callConnectionId, uniqueId); } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs index d68039e99f48..d91089a40d73 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/EventCatcher/EventRecordPlayer.cs @@ -25,7 +25,7 @@ internal class EventRecordPlayer : IDisposable, IAsyncDisposable public bool IsRecording { get; private set; } public IEnumerable Entries => _recording.Entries; - public List KeysToSanitize { get; } = new List() { "rawId", "id", "botAppId", "ivrContext" }; + public List KeysToSanitize { get; } = new List() { "rawId", "id", "botAppId", "ivrContext", "callerDisplayName", "incomingCallContext" }; public EventRecordPlayer(string sessionFilePath) { @@ -151,7 +151,14 @@ private string SanitizeRecordedEvent(string message) var result = new Dictionary(); while (objEnumerator.MoveNext()) { - result.Add(objEnumerator.Current.Name, Scrub(objEnumerator.Current.Value, 0, MaxDepth)); + if (KeysToSanitize.Contains(objEnumerator.Current.Name)) + { + result.Add(objEnumerator.Current.Name, "Sanitized"); + } + else + { + result.Add(objEnumerator.Current.Name, Scrub(objEnumerator.Current.Value, 0, MaxDepth)); + } } var resultAsString = JsonSerializer.Serialize(result); diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/AttachEventProcessorTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/AttachEventProcessorTests.cs index d15f89a8f080..66b587ebeb96 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/AttachEventProcessorTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/AttachEventProcessorTests.cs @@ -25,7 +25,7 @@ public void OnGoingHandlerAttach() handler.AttachOngoingEventProcessor(CallConnectionId, passedEvent => callConnectionIdPassedFromOngoingEventProcessor = passedEvent.CallConnectionId); // Create and send event to event processor first - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); // Assert if the delegate was also called Assert.AreEqual(CallConnectionId, callConnectionIdPassedFromOngoingEventProcessor); @@ -46,7 +46,7 @@ public void OnGoingHandlerDetach() handler.DetachOngoingEventProcessor(CallConnectionId); // Create and send event to event processor first - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); // Assert if the delegate didnt get called Assert.AreEqual(ServerCallId, callConnectionIdPassedFromOngoingEventProcessor); @@ -66,7 +66,7 @@ public void ReplaceExistingOnGoingHandler() // Then replace with correct one handler.AttachOngoingEventProcessor(CallConnectionId, passedEvent => callConnectionIdPassedFromOngoingEventProcessor = passedEvent.CallConnectionId); - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); // Assert if the delegate was also called Assert.AreEqual(CallConnectionId, callConnectionIdPassedFromOngoingEventProcessor); @@ -82,7 +82,7 @@ public void EventMismatch() // Add delegate for call connected event handler.AttachOngoingEventProcessor(CallConnectionId, passedEvent => callConnectionIdPassedFromOngoingEventProcessor = passedEvent.CallConnectionId); - var internalEvent = new CallTransferAcceptedInternal(null, null, null, null, CallConnectionId, ServerCallId, CorelationId); + var internalEvent = new CallTransferAcceptedInternal(CallConnectionId, ServerCallId, CorelationId, null, null, null, null); // Create and send event to event processor first SendAndProcessEvent(handler, new CallTransferAccepted(internalEvent)); @@ -103,9 +103,9 @@ public void CheckIfOngoingProcessorIsDetachedAfterCallDisconnect() handler.AttachOngoingEventProcessor(CallConnectionId, passedEvent => callConnectionIdPassedFromOngoingEventProcessor = passedEvent.CallConnectionId); // Create and send event to event processor first - SendAndProcessEvent(handler, new CallDisconnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallDisconnected(CallConnectionId, ServerCallId, CorelationId, null, null)); - SendAndProcessEvent(handler, new CallConnected(null,CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); // Assert if the delegate was never called Assert.AreEqual(ServerCallId, callConnectionIdPassedFromOngoingEventProcessor); diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/EventProcessorAsyncTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/EventProcessorAsyncTests.cs index 831f0906c845..1b92dfe0d5eb 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/EventProcessorAsyncTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/EventProcessorAsyncTests.cs @@ -26,7 +26,7 @@ public async Task ProcessEventAndWaitForIt() && ev.GetType() == typeof(CallConnected)); // Create and send event to event processor - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); CallAutomationEventBase returnedBaseEvent = await baseEventTask; @@ -44,10 +44,10 @@ public async Task ProcessEventFirstThenWaitForIt() CallAutomationEventProcessor handler = callAutomationClient.GetEventProcessor(); // Create and send event to event processor first - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); // Wait for Event after - CallAutomationEventBase returnedBaseEvent = await handler.WaitForEventProcessorAsync(ev + CallAutomationEventBase returnedBaseEvent = await handler.WaitForEventProcessorAsync(ev => ev.CallConnectionId == CallConnectionId && ev.GetType() == typeof(CallConnected)); @@ -79,7 +79,7 @@ public async Task NoMatchTimeOutException() }; // Create and send event to event processor - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); try { @@ -108,7 +108,7 @@ public async Task WaitForMultipleEventsInSequence() var task = handler.WaitForEventProcessorAsync(ev => ev.CallConnectionId == CallConnectionId && ev.GetType() == typeof(CallConnected)); - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); // assert CallAutomationEventBase returnedBaseEvent = await task; @@ -133,7 +133,7 @@ public async Task WaitForMultipleEventsSentAllAtOnce() // Create and send multiple events to event processor AT ONCE for (int i = 0; i < eventsSent; i++) { - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); } // Wait for event in sequence diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/ResultWithEventProcessorAsyncTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/ResultWithEventProcessorAsyncTests.cs index 396bc43ab288..88150a36a328 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/ResultWithEventProcessorAsyncTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/EventProcessors/ResultWithEventProcessorAsyncTests.cs @@ -31,7 +31,7 @@ public async Task CreateCallEventResultSuccessTest() Assert.AreEqual(successCode, response.GetRawResponse().Status); // Create and send event to event processor - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); CreateCallEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -48,20 +48,16 @@ public async Task CreateCallEventResultFailedTest() { // Failed with operation mismatch int successCode = (int)HttpStatusCode.Created; - CallAutomationClient callAutomationClient = CreateMockCallAutomationClient( responseCode: successCode, responseContent: CreateOrAnswerCallOrGetCallConnectionPayload, options: new CallAutomationClientOptions() { Source = new CommunicationUserIdentifier("12345") }); CallAutomationEventProcessor handler = callAutomationClient.GetEventProcessor(); - var response = callAutomationClient.CreateCall(new CreateCallOptions(CreateMockInvite(), new Uri(CallBackUri))); Assert.AreEqual(successCode, response.GetRawResponse().Status); - - SendAndProcessEvent(handler, new CreateCallFailed(new CreateCallFailedInternal("mismatchedOperationId", null, CallConnectionId, ServerCallId, CorelationId))); - + var createCallFailedInternalEvent = new CreateCallFailedInternal(CallConnectionId, ServerCallId, CorelationId, "mismatchedOperationId", null); + SendAndProcessEvent(handler, new CreateCallFailed(createCallFailedInternalEvent)); CreateCallEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); - // Assert Assert.NotNull(returnedResult); Assert.AreEqual(false, returnedResult.IsSuccess); @@ -86,7 +82,7 @@ public async Task AnswerCallEventResultSuccessTest() Assert.AreEqual(successCode, response.GetRawResponse().Status); // Create and send event to event processor - SendAndProcessEvent(handler, new CallConnected(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallConnected(CallConnectionId, ServerCallId, CorelationId, null, null)); AnswerCallEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -98,35 +94,6 @@ public async Task AnswerCallEventResultSuccessTest() Assert.AreEqual(CallConnectionId, returnedResult.SuccessResult.CallConnectionId); } - [Test] - public async Task AnswerCallEventResultFailedTest() - { - int successCode = (int)HttpStatusCode.OK; - - // Failed with operation mismatch - CallAutomationClient callAutomationClient = CreateMockCallAutomationClient( - responseCode: successCode, - responseContent: CreateOrAnswerCallOrGetCallConnectionPayload, - options: new CallAutomationClientOptions() { Source = new CommunicationUserIdentifier("12345") }); - CallAutomationEventProcessor handler = callAutomationClient.GetEventProcessor(); - - var response = callAutomationClient.AnswerCall("incomingCallContext", new Uri(CallBackUri)); - Assert.AreEqual(successCode, response.GetRawResponse().Status); - - // Create and send event to event processor - SendAndProcessEvent(handler, new AnswerFailed(new AnswerFailedInternal("mismatchedOperationId", null, CallConnectionId, ServerCallId, CorelationId))); - - AnswerCallEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); - - // Assert - Assert.NotNull(returnedResult); - Assert.AreEqual(false, returnedResult.IsSuccess); - Assert.NotNull(returnedResult.FailureResult); - Assert.IsNull(returnedResult.SuccessResult); - Assert.AreEqual(typeof(AnswerFailed), returnedResult.FailureResult.GetType()); - Assert.AreEqual(CallConnectionId, returnedResult.FailureResult.CallConnectionId); - } - [Test] public async Task TransferCallEventResultSuccessTest() { @@ -145,7 +112,7 @@ public async Task TransferCallEventResultSuccessTest() var transferTarget = new CommunicationIdentifierModel(); transferTarget.CommunicationUser = new CommunicationUserIdentifierModel(TargetUser); transferTarget.RawId = TargetUser; - var internalEvent = new CallTransferAcceptedInternal(response.Value.OperationContext, null, transferTarget, transferee, CallConnectionId, ServerCallId, CorelationId); + var internalEvent = new CallTransferAcceptedInternal(CallConnectionId, ServerCallId, CorelationId, response.Value.OperationContext, null, transferTarget, transferee); // Create and send event to event processor SendAndProcessEvent(handler, new CallTransferAccepted(internalEvent)); @@ -177,7 +144,7 @@ public async Task TransferCallEventResultFailedTest() Assert.AreEqual(successCode, response.GetRawResponse().Status); // Create and send event to event processor - SendAndProcessEvent(handler, new CallTransferFailed(response.Value.OperationContext, null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new CallTransferFailed(CallConnectionId, ServerCallId, CorelationId, response.Value.OperationContext, null)); TransferCallToParticipantEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -256,8 +223,10 @@ public async Task PlayEventResultSuccessTest() var response = callConnection.GetCallMedia().PlayToAll(new PlayToAllOptions(new FileSource(new Uri(CallBackUri))) { OperationContext = OperationContext }); Assert.AreEqual(successCode, response.GetRawResponse().Status); + var internalEvent = new PlayCompletedInternal(CallConnectionId, ServerCallId, CorelationId, OperationContext, new ResultInformation() { }); + // Create and send event to event processor - SendAndProcessEvent(handler, new PlayCompleted(new ResultInformation() { }, OperationContext, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new PlayCompleted(internalEvent)); PlayEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -282,8 +251,10 @@ public async Task PlayEventResultFailedTest() var response = callConnection.GetCallMedia().PlayToAll(new PlayToAllOptions(new FileSource(new Uri(CallBackUri))) { OperationContext = OperationContext }); Assert.AreEqual(successCode, response.GetRawResponse().Status); + var internalEvent = new PlayFailedInternal(CallConnectionId, ServerCallId, CorelationId, OperationContext, new ResultInformation() { }, null); + // Create and send event to event processor - SendAndProcessEvent(handler, new PlayFailed(OperationContext, new ResultInformation() { }, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new PlayFailed(internalEvent)); PlayEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -309,7 +280,7 @@ public async Task CancelMediaEventResultPlayCancelTest() Assert.AreEqual(successCode, response.GetRawResponse().Status); // Create and send event to event processor - SendAndProcessEvent(handler, new PlayCanceled(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new PlayCanceled(CallConnectionId, ServerCallId, CorelationId, null, null)); CancelAllMediaOperationsEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -334,7 +305,7 @@ public async Task CancelMediaEventResultRecognizeCancelTest() Assert.AreEqual(successCode, response.GetRawResponse().Status); // Create and send event to event processor - SendAndProcessEvent(handler, new RecognizeCanceled(null, CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new RecognizeCanceled(CallConnectionId, ServerCallId, CorelationId, null, null)); CancelAllMediaOperationsEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -384,8 +355,10 @@ public async Task RecognizeEventResultFailedTest() var response = callConnection.GetCallMedia().StartRecognizing(new CallMediaRecognizeDtmfOptions(new CommunicationUserIdentifier(TargetId), 1) { OperationContext = OperationContext }); Assert.AreEqual(successCode, response.GetRawResponse().Status); + var internalEvent = new RecognizeFailedInternal(CallConnectionId, ServerCallId, CorelationId, OperationContext, new ResultInformation() { }, null); + // Create and send event to event processor - SendAndProcessEvent(handler, new RecognizeFailed(OperationContext, new ResultInformation(), CallConnectionId, ServerCallId, CorelationId)); + SendAndProcessEvent(handler, new RecognizeFailed(internalEvent)); StartRecognizingEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); @@ -511,82 +484,6 @@ public async Task SendDtmfEventResultFailedTest() Assert.AreEqual(OperationContext, returnedResult.FailureResult.OperationContext); } - [Test] - public async Task StartDialogEventResultSuccessTest() - { - int successCode = (int)HttpStatusCode.Created; - - var callConnection = CreateMockCallConnection(successCode, DialogPayload); - CallAutomationEventProcessor handler = callConnection.EventProcessor; - - var dialogContext = new Dictionary(); - var startDialogOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", dialogContext)) - { - OperationContext = OperationContext - }; - - var response = callConnection.GetCallDialog().StartDialog(startDialogOptions); - Assert.AreEqual(successCode, response.GetRawResponse().Status); - - // Create and send event to event processor - SendAndProcessEvent(handler, new DialogStarted(CallConnectionId, ServerCallId, CorelationId, OperationContext, new ResultInformation(), "dialogId", DialogInputType.PowerVirtualAgents)); - - DialogEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); - - // Assert - Assert.NotNull(returnedResult); - Assert.AreEqual(true, returnedResult.IsSuccess); - Assert.NotNull(returnedResult.DialogStartedSuccessEvent); - Assert.IsNull(returnedResult.DialogCompletedSuccessResult); - Assert.IsNull(returnedResult.DialogConsentSuccessEvent); - Assert.IsNull(returnedResult.DialogHangupSuccessEvent); - Assert.IsNull(returnedResult.DialogLanguageChangeEvent); - Assert.IsNull(returnedResult.DialogSensitivityUpdateEvent); - Assert.IsNull(returnedResult.DialogTransferSuccessEvent); - Assert.IsNull(returnedResult.FailureResult); - Assert.AreEqual(typeof(DialogStarted), returnedResult.DialogStartedSuccessEvent.GetType()); - Assert.AreEqual(CallConnectionId, returnedResult.DialogStartedSuccessEvent.CallConnectionId); - Assert.AreEqual(OperationContext, returnedResult.DialogStartedSuccessEvent.OperationContext); - } - - [Test] - public async Task StartDialogEventResultFailedTest() - { - int successCode = (int)HttpStatusCode.Created; - - var callConnection = CreateMockCallConnection(successCode, DialogPayload); - CallAutomationEventProcessor handler = callConnection.EventProcessor; - - var dialogContext = new Dictionary(); - var startDialogOptions = new StartDialogOptions(new PowerVirtualAgentsDialog("botAppId", dialogContext)) - { - OperationContext = OperationContext - }; - - var response = callConnection.GetCallDialog().StartDialog(startDialogOptions); - Assert.AreEqual(successCode, response.GetRawResponse().Status); - - // Create and send event to event processor - SendAndProcessEvent(handler, new DialogFailed(CallConnectionId, ServerCallId, CorelationId, OperationContext, new ResultInformation(), "dialogId", DialogInputType.PowerVirtualAgents)); - - DialogEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); - - // Assert - Assert.NotNull(returnedResult); - Assert.AreEqual(false, returnedResult.IsSuccess); - Assert.IsNull(returnedResult.DialogStartedSuccessEvent); - Assert.IsNull(returnedResult.DialogCompletedSuccessResult); - Assert.IsNull(returnedResult.DialogConsentSuccessEvent); - Assert.IsNull(returnedResult.DialogHangupSuccessEvent); - Assert.IsNull(returnedResult.DialogLanguageChangeEvent); - Assert.IsNull(returnedResult.DialogSensitivityUpdateEvent); - Assert.IsNull(returnedResult.DialogTransferSuccessEvent); - Assert.NotNull(returnedResult.FailureResult); - Assert.AreEqual(typeof(DialogFailed), returnedResult.FailureResult.GetType()); - Assert.AreEqual(CallConnectionId, returnedResult.FailureResult.CallConnectionId); - Assert.AreEqual(OperationContext, returnedResult.FailureResult.OperationContext); - } - [Test] public async Task CancelAddParticipantSucceededEventResultFailedTest() { @@ -636,7 +533,6 @@ public async Task CancelAddParticipantSucceededEventResultSuccessTest() ServerCallId, CorelationId, invitationId, - callInvite.Target, OperationContext)); CancelAddParticipantEventResult returnedResult = await response.Value.WaitForEventProcessorAsync(); diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs index 846753527958..a8b8e6c6f3f5 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Events/CallAutomationEventParserTests.cs @@ -268,6 +268,35 @@ public void CallConnectedEventParsed_Test() } } + //[Test] + //public void ConnectFailedEventParsed_Test() + //{ + // // arrange + // var callConnectionId = "callConnectionId"; + // var serverCallId = "serverCallId"; + // var correlationId = "correlationId"; + // var @event = CallAutomationModelFactory.ConnectFailed(callConnectionId, serverCallId, correlationId); + // JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + // string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); + + // // act + // var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.ConnectFailed"); + + // // assert + // if (parsedEvent is ConnectFailed connectFailed) + // { + // Assert.AreEqual(callConnectionId, connectFailed.CallConnectionId); + // Assert.AreEqual(serverCallId, connectFailed.ServerCallId); + // Assert.AreEqual(correlationId, connectFailed.CorrelationId); + // Assert.IsNull(connectFailed.OperationContext); + // Assert.IsNull(connectFailed.ResultInformation); + // } + // else + // { + // Assert.Fail("Event parsed wrongfully"); + // } + //} + [Test] public void CallDisconnectedEventParsed_Test() { @@ -472,6 +501,30 @@ public void PlayFailedEventParsed_Test() } } + //[Test] + //public void PlayStartedEventParsed_Test() + //{ + // PlayStarted @event = CallAutomationModelFactory.PlayStarted( + // callConnectionId: "callConnectionId", + // serverCallId: "serverCallId", + // correlationId: "correlationId", + // operationContext: "operationContext", + // resultInformation: new ResultInformation(code: 200, subCode: 0, message: "Action completed successfully")); + // JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + // string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); + // var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.PlayStarted"); + // if (parsedEvent is PlayStarted playStarted) + // { + // Assert.AreEqual("correlationId", playStarted.CorrelationId); + // Assert.AreEqual("serverCallId", playStarted.ServerCallId); + // Assert.AreEqual(200, playStarted.ResultInformation?.Code); + // } + // else + // { + // Assert.Fail("Event parsed wrongfully"); + // } + //} + [Test] public void PlayCanceledEventParsed_Test() { @@ -635,7 +688,7 @@ public void GetRecognizeResultFromRecognizeCompletedWithChoice_Test() Assert.AreEqual("correlationId", recognizeCompleted.CorrelationId); Assert.AreEqual("correlationId", recognizeCompleted.CorrelationId); Assert.AreEqual("serverCallId", recognizeCompleted.ServerCallId); - // Assert.AreEqual(200, recognizeCompleted.ResultInformation?.Code); + // Assert.AreEqual(200, recognizeCompleted.ResultInformation?.Code); if (recognizeResult is ChoiceResult choiceRecongizedResult) { Assert.AreEqual("testLabel", choiceRecongizedResult.Label); @@ -895,7 +948,6 @@ public void CancelAddParticipantSucceededEventParsed_Test() serverCallId: "serverCallId", correlationId: "correlationId", invitationId: "invitationId", - participant: new CommunicationUserIdentifier("8:acs:12345"), operationContext: "operationContext"); JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); @@ -956,7 +1008,6 @@ public void CreateCallFailedEventParsed_Test() JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.CreateCallFailed"); - if (parsedEvent is CreateCallFailed createCallFailed) { Assert.AreEqual("operationContext", createCallFailed.OperationContext); @@ -971,33 +1022,6 @@ public void CreateCallFailedEventParsed_Test() } } - [Test] - public void AnswerFailedEventParsed_Test() - { - AnswerFailed @event = CallAutomationModelFactory.AnswerFailed( - callConnectionId: "callConnectionId", - serverCallId: "serverCallId", - correlationId: "correlationId", - resultInformation: new ResultInformation(code: 400, subCode: 8510, message: "Action failed, some error."), - operationContext: "operationContext"); - JsonSerializerOptions jsonOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - string jsonEvent = JsonSerializer.Serialize(@event, jsonOptions); - var parsedEvent = CallAutomationEventParser.Parse(jsonEvent, "Microsoft.Communication.AnswerFailed"); - - if (parsedEvent is AnswerFailed answerFailed) - { - Assert.AreEqual("operationContext", answerFailed.OperationContext); - Assert.AreEqual("callConnectionId", answerFailed.CallConnectionId); - Assert.AreEqual("correlationId", answerFailed.CorrelationId); - Assert.AreEqual("serverCallId", answerFailed.ServerCallId); - Assert.AreEqual(400, answerFailed.ResultInformation?.Code); - } - else - { - Assert.Fail("Event parsed wrongfully"); - } - } - [Test] public void TranscriptionStartedEventParsed_Test() { diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs index 96d3c5f7ddea..8d177aaf0b02 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientAutomatedLiveTestsBase.cs @@ -19,6 +19,7 @@ using Azure.Core.Pipeline; using Azure.Core.TestFramework; using Azure.Core.TestFramework.Models; +using Azure.Identity; using Azure.Messaging.ServiceBus; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -32,6 +33,7 @@ internal class CallAutomationClientAutomatedLiveTestsBase : RecordedTestBase> _eventstore; private ConcurrentDictionary _incomingcontextstore; @@ -52,12 +54,21 @@ public CallAutomationClientAutomatedLiveTestsBase(bool isAsync, RecordedTestMode JsonPathSanitizers.Add("$..botAppId"); JsonPathSanitizers.Add("$..ivrContext"); JsonPathSanitizers.Add("$..dialog.botAppId"); - BodyKeySanitizers.Add(new BodyKeySanitizer("..callbackUri") { Value = @"https://sanitized.skype.com/api/servicebuscallback/events?q=SanitizedSanitized"}); + BodyKeySanitizers.Add(new BodyKeySanitizer("..sourceDisplayName") { Value = SanitizeValue }); + BodyKeySanitizers.Add(new BodyKeySanitizer("..incomingCallContext") { Value = SanitizeValue }); + BodyKeySanitizers.Add(new BodyKeySanitizer("..callbackUri") { Value = @"https://sanitized.skype.com/api/servicebuscallback/events?q=SanitizedSanitized" }); + BodyKeySanitizers.Add(new BodyKeySanitizer("..transportUrl") { Value = @"wss://sanitized.skype.com" }); + BodyKeySanitizers.Add(new BodyKeySanitizer("..cognitiveServicesEndpoint") { Value = @"https://sanitized.skype.com" }); + BodyKeySanitizers.Add(new BodyKeySanitizer("$..file.uri") { Value = @"https://sanitized.skype.com/prompt.wav" }); BodyRegexSanitizers.Add(new BodyRegexSanitizer(TestDispatcherRegEx) { Value = "https://sanitized.skype.com" }); UriRegexSanitizers.Add(new UriRegexSanitizer(URIDomainRegEx) { Value = "https://sanitized.skype.com" }); - UriRegexSanitizers.Add(new UriRegexSanitizer(TestDispatcherQNameRegEx)); + UriRegexSanitizers.Add(new UriRegexSanitizer(TestDispatcherQNameRegEx) { Value = SanitizeValue }); + UriRegexSanitizers.Add(new UriRegexSanitizer(ACSUserIdInUrlRegex) { Value = SanitizeValue }); } + public bool SkipCallAutomationInteractionLiveTests + => TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLAUTOMATION_INTERACTION_LIVE_TESTS") == "TRUE"; + [SetUp] public void TestSetup() { @@ -92,7 +103,7 @@ public async Task CleanUp() } public bool SkipCallingServerInteractionLiveTests - => TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS")== "TRUE"; + => TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLINGSERVER_INTERACTION_LIVE_TESTS") == "TRUE"; /// /// Creates a @@ -103,6 +114,7 @@ protected CallAutomationClient CreateInstrumentedCallAutomationClientWithConnect var connectionString = TestEnvironment.LiveTestStaticConnectionString; CallAutomationClient callAutomationClient; + if (TestEnvironment.PMAEndpoint == null || TestEnvironment.PMAEndpoint.Length == 0) { callAutomationClient = new CallAutomationClient(connectionString, CreateServerCallingClientOptionsWithCorrelationVectorLogs(source)); @@ -170,6 +182,37 @@ protected string GetResourceId() return TestEnvironment.ResourceIdentifier; } + protected void GetPhoneNumbers(out CommunicationIdentifier sourcePhone, out CommunicationIdentifier target) + { + if (Mode == RecordedTestMode.Playback) + { + sourcePhone = new PhoneNumberIdentifier("Sanitized"); + target = new PhoneNumberIdentifier("Sanitized"); + } + else + { + PhoneNumbersClient phoneNumbersClient = new PhoneNumbersClient(TestEnvironment.LiveTestStaticConnectionString); + var purchasedPhoneNumbers = phoneNumbersClient.GetPurchasedPhoneNumbers(); + List phoneNumbers = new List(); + foreach (var phoneNumber in purchasedPhoneNumbers) + { + phoneNumbers.Add(phoneNumber.PhoneNumber); + Console.WriteLine($"Phone number: {phoneNumber.PhoneNumber}, monthly cost: {phoneNumber.Cost}"); + } + + Random random = new Random(); + int num1 = random.Next(0, phoneNumbers.Count); + int num2; + do + { + num2 = random.Next(0, phoneNumbers.Count); + } while (num2 == num1); + + target = new PhoneNumberIdentifier(phoneNumbers[num1]); + sourcePhone = new PhoneNumberIdentifier(phoneNumbers[num2]); + } + } + /// /// Creates a with the connectionstring via environment /// variables and instruments it to make use of the Azure Core Test Framework functionalities. @@ -193,7 +236,7 @@ protected async Task WaitForOperationCompletion(int milliSeconds = 10000) await Task.Delay(milliSeconds); } - protected async Task CleanUpCall(CallAutomationClient client, string? callConnectionId) + protected async Task CleanUpCall(CallAutomationClient client, string? callConnectionId, string? uniqueId) { try { @@ -207,6 +250,11 @@ protected async Task CleanUpCall(CallAutomationClient client, string? callConnec } } } + + if (!string.IsNullOrEmpty(uniqueId)) + { + await DeRegisterCallBackWithDispatcher(uniqueId); + } } catch { @@ -231,7 +279,7 @@ private void RecordedEventListenerOnCollectionChanged(object sender, RecordedEve private void HandleServiceBusReceivedMessage(RecordedServiceBusReceivedMessage receivedMessage) { - string body = receivedMessage.Body.ToString(); + string body = Regex.Unescape(receivedMessage.Body.ToString()); if (!string.IsNullOrEmpty(body)) { @@ -271,7 +319,7 @@ private string ParseFromAndTo(string unparsed) string fromId = unparsed.Split(new string[] { "\"from\":{\"kind\":" }, StringSplitOptions.None)[1].Split(new string[] { "\"rawId\":\"" }, StringSplitOptions.None)[1].Split(new string[] { "\"" }, StringSplitOptions.None)[0]; string toId = unparsed.Split(new string[] { "\"to\":{\"kind\":" }, StringSplitOptions.None)[1].Split(new string[] { "\"rawId\":\"" }, StringSplitOptions.None)[1].Split(new string[] { "\"" }, StringSplitOptions.None)[0]; - return fromId + toId; + return RemoveAllNonChar(fromId + toId); } private string ParseIdsFromIdentifier(CommunicationIdentifier inputIdentifier) @@ -289,10 +337,7 @@ private string ParseIdsFromIdentifier(CommunicationIdentifier inputIdentifier) } else { - /* Change the plus + sign to it's unicode without the special characters i.e. u002B. - * It's required because the dispacther app receives the incoming call context for pstn call - * with the + as unicode in it and builds the topic id with it to send the event.*/ - return RemoveAllNonChar(((PhoneNumberIdentifier)inputIdentifier).RawId).Insert(1, "u002B"); + return RemoveAllNonChar(((PhoneNumberIdentifier)inputIdentifier).RawId); } case MicrosoftTeamsUserIdentifier: return RemoveAllNonChar(((MicrosoftTeamsUserIdentifier)inputIdentifier).RawId); @@ -310,7 +355,7 @@ private static string RemoveAllNonChar(string inputId) private HttpPipeline BuildHttpPipeline() { var clientOptions = CreateServerCallingClientOptionsWithCorrelationVectorLogs(); - return clientOptions.CustomBuildHttpPipeline( + return clientOptions.BuildHttpPipeline( ConnectionString.Parse(TestEnvironment.LiveTestStaticConnectionString)); } @@ -347,7 +392,7 @@ private async Task RegisterCallBackWithDispatcher(string uniqueId) } } - private HttpMessage CreateDeRegisterCallBackWithDispatcherRequest(IEnumerable ids) + private HttpMessage CreateDeRegisterCallBackWithDispatcherRequest(string uniqueId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -356,25 +401,22 @@ private HttpMessage CreateDeRegisterCallBackWithDispatcherRequest(IEnumerable TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLAUTOMATION_INTERACTION_LIVE_TESTS")== "TRUE"; - - /// - /// Creates a - /// - /// The instrumented . - protected CallAutomationClient CreateInstrumentedCallAutomationClientWithConnectionString() - { - var connectionString = TestEnvironment.LiveTestStaticConnectionString; - - CallAutomationClient callAutomationClient; - if (TestEnvironment.PMAEndpoint == null || TestEnvironment.PMAEndpoint.Length == 0) - { - callAutomationClient = new CallAutomationClient(connectionString, CreateServerCallingClientOptionsWithCorrelationVectorLogs()); - } - else - { - callAutomationClient = new CallAutomationClient(new Uri(TestEnvironment.PMAEndpoint), connectionString, CreateServerCallingClientOptionsWithCorrelationVectorLogs()); - } - - return InstrumentClient(callAutomationClient); - } + => TestEnvironment.Mode != RecordedTestMode.Playback && Environment.GetEnvironmentVariable("SKIP_CALLAUTOMATION_INTERACTION_LIVE_TESTS") == "TRUE"; /// /// Creates a @@ -82,7 +61,8 @@ protected CommunicationIdentityClient CreateInstrumentedCommunicationIdentityCli TestEnvironment.LiveTestStaticConnectionString, InstrumentClientOptions(new CommunicationIdentityClientOptions(CommunicationIdentityClientOptions.ServiceVersion.V2023_10_01)))); - protected async Task CreateIdentityUserAsync() { + protected async Task CreateIdentityUserAsync() + { CommunicationIdentityClient communicationIdentityClient = CreateInstrumentedCommunicationIdentityClient(); return await communicationIdentityClient.CreateUserAsync().ConfigureAwait(false); } diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientTestEnvironment.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientTestEnvironment.cs index f0108637f123..c6c369225d63 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientTestEnvironment.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationClientTestEnvironment.cs @@ -31,6 +31,12 @@ internal class CallAutomationClientTestEnvironment : CommunicationTestEnvironmen private string botAppId = "BOT_APP_ID"; + private string transportUrl = "TRANSPORT_URL"; + + private string fileSourceUrl = "FILE_SOURCE_URL"; + + private string cognitiveServiceEndpoint = "COGNITIVE_SERVICE_ENDPOINT"; + /// /// The resource identifier associated with the Azure Communication Service. /// @@ -73,8 +79,22 @@ internal class CallAutomationClientTestEnvironment : CommunicationTestEnvironmen /// /// ServiceBus string /// - public string ServiceBusConnectionString => GetRecordedOptionalVariable(servicebusString, - options => options.HasSecretConnectionStringParameter("SharedAccessKey", SanitizedValue.Base64).HasSecretConnectionStringParameter("SharedAccessKeyName")); + public string ServiceBusNamespace => GetRecordedOptionalVariable(servicebusString, options => options.IsSecret("Sanitized")); + + /// + /// websocket url for automated testing + /// + public string TransportUrl => GetRecordedOptionalVariable(transportUrl, options => options.IsSecret("https://sanitized.skype.com")); + + /// + /// file source for automated testing + /// + public string FileSourceUrl => GetRecordedOptionalVariable(fileSourceUrl, options => options.IsSecret("https://sanitized.skype.com/prompt.wav")); + + /// + /// Cognitive service endpoint for automated testing + /// + public string CognitiveServiceEndpoint => GetRecordedOptionalVariable(cognitiveServiceEndpoint, options => options.IsSecret("https://sanitized.skype.com")); /// /// The callback url of the application where notification would be received. diff --git a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs index 43f2a3b52ed3..4bd706f2d05f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/tests/Infrastructure/CallAutomationEventProcessorTestBase.cs @@ -25,12 +25,15 @@ public abstract class CallAutomationEventProcessorTestBase protected const string TargetUser = "TARGET_USER_ID"; protected const string TransfereeUser = "TRANSFEREE_USER_ID"; protected const int defaultTestTimeout = 3; - private const string NoneMediaSubscriptionId = "null"; - private const string MediaSubscriptionId = "\"mediaSubscriptionId\""; - protected string CreateOrAnswerCallOrGetCallConnectionPayload = string.Format(DummyPayload, NoneMediaSubscriptionId); - protected string CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionPayload = string.Format(DummyPayload, MediaSubscriptionId); + private const string NoneMediaSubscription = "null"; + private const string MediaStreamingSubscription = "{" + + " \"id\": \"22c3a25a-aed5-47df-9ef9-5ba5c7b6d08e\"," + + "\"state\": \"disabled\",\"subscribedContentTypes\": [" + + "\"audio\"] }"; + protected string CreateOrAnswerCallOrGetCallConnectionPayload = string.Format(DummyPayload, NoneMediaSubscription); + protected string CreateOrAnswerCallOrGetCallConnectionWithMediaSubscriptionPayload = string.Format(DummyPayload, MediaStreamingSubscription); - protected const string DummyPayload = "{{\"callConnectionId\": \"someCallConnectionId\",\"serverCallId\": \"someServerCallId\",\"targets\": [{{\"rawId\":\"targetId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"targetId\"}}}}],\"source\":{{\"rawId\":\"sourceId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"sourceId\"}}}},\"callConnectionState\": \"connecting\",\"subject\": \"dummySubject\",\"callbackUri\": \"https://bot.contoso.com/callback\",\"mediaSubscriptionId\": {0}}}"; + protected const string DummyPayload = "{{\"callConnectionId\": \"someCallConnectionId\",\"serverCallId\": \"someServerCallId\",\"targets\": [{{\"rawId\":\"targetId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"targetId\"}}}}],\"source\":{{\"rawId\":\"sourceId\",\"kind\":\"communicationUser\",\"communicationUser\":{{\"id\":\"sourceId\"}}}},\"callConnectionState\": \"connecting\",\"subject\": \"dummySubject\",\"callbackUri\": \"https://bot.contoso.com/callback\",\"mediaStreamingSubscription\": {0}}}"; protected const string TransferCallOrRemoveParticipantsPayload = "{\"operationContext\": \"someOperationContext\"}"; @@ -49,7 +52,7 @@ public abstract class CallAutomationEventProcessorTestBase "\"invitationId\": \"invitationId\"" + "}"; - internal CallAutomationClient CreateMockCallAutomationClient(int responseCode, object? responseContent = null, HttpHeader[]? httpHeaders = null, CallAutomationClientOptions ? options = default) + internal CallAutomationClient CreateMockCallAutomationClient(int responseCode, object? responseContent = null, HttpHeader[]? httpHeaders = null, CallAutomationClientOptions? options = default) { var mockResponse = new MockResponse(responseCode); @@ -98,7 +101,7 @@ protected IEnumerable CreateMoakTargets(IEnumerable words = transcription.Words.ToList(); Assert.AreEqual(2, words.Count); Assert.AreEqual("Hello", words[0].Text); - Assert.AreEqual(1, words[0].Offset); - Assert.AreEqual(1, words[0].Duration); + Assert.AreEqual(1, words[0].Offset.Ticks); + Assert.AreEqual(1, words[0].Duration.Ticks); Assert.AreEqual("World", words[1].Text); - Assert.AreEqual(6, words[1].Offset); - Assert.AreEqual(1, words[1].Duration); + Assert.AreEqual(6, words[1].Offset.Ticks); + Assert.AreEqual(1, words[1].Duration.Ticks); Assert.IsTrue(transcription.Participant is CommunicationIdentifier); Assert.AreEqual("abc12345", transcription.Participant.RawId); - Console.WriteLine(transcription.ResultStatus.ToString()); - Assert.AreEqual(ResultStatus.Final, transcription.ResultStatus); + Console.WriteLine(transcription.ResultState.ToString()); + Assert.AreEqual(TranscriptionResultState.Final, transcription.ResultState); } #endregion } diff --git a/sdk/communication/Azure.Communication.CallingServer/README.md b/sdk/communication/Azure.Communication.CallingServer/README.md index 1aed82d2af62..0959d0b0dae3 100644 --- a/sdk/communication/Azure.Communication.CallingServer/README.md +++ b/sdk/communication/Azure.Communication.CallingServer/README.md @@ -131,10 +131,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [nuget]: https://www.nuget.org/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/a20e269162fa88a43e5ba0e5bb28f2e76c74a484/sdk/communication/Azure.Communication.CallingServer/src diff --git a/sdk/communication/Azure.Communication.Chat/CHANGELOG.md b/sdk/communication/Azure.Communication.Chat/CHANGELOG.md index 8f3e0e2f0121..c1bb0cfeb39f 100644 --- a/sdk/communication/Azure.Communication.Chat/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Chat/CHANGELOG.md @@ -116,5 +116,5 @@ This is a Public Preview version, so breaking changes are possible in subsequent [read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Chat/README.md -[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-csharp +[documentation]: https://learn.microsoft.com/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-csharp diff --git a/sdk/communication/Azure.Communication.Chat/README.md b/sdk/communication/Azure.Communication.Chat/README.md index 6428c0f3220f..8c26473eaa36 100644 --- a/sdk/communication/Azure.Communication.Chat/README.md +++ b/sdk/communication/Azure.Communication.Chat/README.md @@ -376,12 +376,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc_contact]: mailto:opencode@microsoft.com [nuget]: https://www.nuget.org/ [netstandars2mappings]:https://github.com/dotnet/standard/blob/master/docs/versions.md -[useraccesstokens]:https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[nextsteps]:https://docs.microsoft.com/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-csharp +[useraccesstokens]:https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[nextsteps]:https://learn.microsoft.com/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-csharp [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Chat/src -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [package]: https://www.nuget.org/packages/Azure.Communication.Chat diff --git a/sdk/communication/Azure.Communication.Common/README.md b/sdk/communication/Azure.Communication.Common/README.md index e5ee3f2c7a7b..5d24945d71db 100644 --- a/sdk/communication/Azure.Communication.Common/README.md +++ b/sdk/communication/Azure.Communication.Common/README.md @@ -121,11 +121,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [azure_sub]: https://azure.microsoft.com/free/dotnet/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Common/src [package]: https://www.nuget.org/packages/Azure.Communication.Common/ -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [nuget]: https://www.nuget.org/ -[user_access_token]: https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[user_access_token]: https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net diff --git a/sdk/communication/Azure.Communication.Email/README.md b/sdk/communication/Azure.Communication.Email/README.md index 7e7cada0505c..4855b69eafe2 100644 --- a/sdk/communication/Azure.Communication.Email/README.md +++ b/sdk/communication/Azure.Communication.Email/README.md @@ -304,11 +304,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp [email_resource_docs]: https://aka.ms/acsemail/createemailresource -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net [package]: https://www.nuget.org/packages/Azure.Communication.Email [product_docs]: https://aka.ms/acsemail/overview [nextsteps]:https://aka.ms/acsemail/qs-sendmail?pivots=programming-language-csharp diff --git a/sdk/communication/Azure.Communication.Identity/CHANGELOG.md b/sdk/communication/Azure.Communication.Identity/CHANGELOG.md index 6a02218efcb4..193844e3a76d 100644 --- a/sdk/communication/Azure.Communication.Identity/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Identity/CHANGELOG.md @@ -71,4 +71,4 @@ Updated `Azure.Communication.Identity` version. [read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Identity/README.md -[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp +[documentation]: https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp diff --git a/sdk/communication/Azure.Communication.Identity/README.md b/sdk/communication/Azure.Communication.Identity/README.md index 077cc4260ecb..828173e90b45 100644 --- a/sdk/communication/Azure.Communication.Identity/README.md +++ b/sdk/communication/Azure.Communication.Identity/README.md @@ -198,10 +198,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [nuget]: https://www.nuget.org/ -[user_access_token]: https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[user_access_token]: https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net diff --git a/sdk/communication/Azure.Communication.JobRouter/README.md b/sdk/communication/Azure.Communication.JobRouter/README.md index b1ff7f828661..c98b0a4d933f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/README.md +++ b/sdk/communication/Azure.Communication.JobRouter/README.md @@ -258,18 +258,18 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc_contact]: mailto:opencode@microsoft.com [nuget]: https://www.nuget.org/ [netstandars2mappings]:https://github.com/dotnet/standard/blob/master/docs/versions.md -[useraccesstokens]:https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[nextsteps]:https://docs.microsoft.com/azure/communication-services/concepts/router/concepts +[useraccesstokens]:https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[nextsteps]:https://learn.microsoft.com/azure/communication-services/concepts/router/concepts [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.JobRouter/src -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview -[classification_concepts]: https://docs.microsoft.com/azure/communication-services/concepts/router/classification-concepts -[subscribe_events]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events -[offer_issued_event_schema]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview +[classification_concepts]: https://learn.microsoft.com/azure/communication-services/concepts/router/classification-concepts +[subscribe_events]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events +[offer_issued_event_schema]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued [deserialize_event_grid_event_data]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid#receiving-and-deserializing-events -[event_grid_event_handlers]: https://docs.microsoft.com/azure/event-grid/event-handlers -[webhook_event_grid_event_delivery]: https://docs.microsoft.com/azure/event-grid/webhook-event-delivery +[event_grid_event_handlers]: https://learn.microsoft.com/azure/event-grid/event-handlers +[webhook_event_grid_event_delivery]: https://learn.microsoft.com/azure/event-grid/webhook-event-delivery [nuget_link]: https://www.nuget.org diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md index a74fdf0ab7a0..03e8b32a4a8f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorld.md @@ -17,7 +17,7 @@ JobRouterAdministrationClient routerAdministrationClient = new JobRouterAdminist ## Create a Distribution Policy -Use `RouterClient` to create a [Distribution Policy](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#distribution-policy) to control how jobs are to be distributed to workers with associated queue. +Use `RouterClient` to create a [Distribution Policy](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#distribution-policy) to control how jobs are to be distributed to workers with associated queue. For this example, we are going to create a __Longest Idle__ policy with an offer TTL set to 1 day. @@ -32,7 +32,7 @@ Response distributionPolicy = routerAdministrationClient.Cre ## Create a Queue -Use `RouterClient` to create a [Queue](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#queue). +Use `RouterClient` to create a [Queue](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#queue). ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CreateQueue Response queue = routerAdministrationClient.CreateQueue( @@ -44,7 +44,7 @@ Response queue = routerAdministrationClient.CreateQueue( ## Create a Job -Now, we can submit a [Job](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#job) directly to that queue, with a worker selector the requires the worker to have the label `Some-Skill` greater than 10. +Now, we can submit a [Job](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#job) directly to that queue, with a worker selector the requires the worker to have the label `Some-Skill` greater than 10. ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CreateJobDirectQAssign Response job = routerClient.CreateJob( @@ -80,7 +80,7 @@ Response worker = routerClient.CreateWorker( ## Check offers to a Worker -Once the worker has been registered, Router will send an offer to the worker if the worker satisfies requirements for a job. See [Offer flow](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#offer) +Once the worker has been registered, Router will send an offer to the worker if the worker satisfies requirements for a job. See [Offer flow](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#offer) We should get a [RouterWorkerOfferIssued][offer_issued_event_schema] from our [EventGrid subscription][subscribe_events]. @@ -191,8 +191,8 @@ Console.WriteLine($"Updated job status: {updatedJob.Value.Status == RouterJobSta ``` -[subscribe_events]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events -[offer_issued_event_schema]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued +[subscribe_events]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events +[offer_issued_event_schema]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued [deserialize_event_grid_event_data]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid#receiving-and-deserializing-events -[event_grid_event_handlers]: https://docs.microsoft.com/azure/event-grid/event-handlers -[webhook_event_grid_event_delivery]: https://docs.microsoft.com/azure/event-grid/webhook-event-delivery +[event_grid_event_handlers]: https://learn.microsoft.com/azure/event-grid/event-handlers +[webhook_event_grid_event_delivery]: https://learn.microsoft.com/azure/event-grid/webhook-event-delivery diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md index 97f624200b45..87718e153631 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample1_HelloWorldAsync.md @@ -17,7 +17,7 @@ JobRouterAdministrationClient routerAdministrationClient = new JobRouterAdminist ## Create a Distribution Policy -Use `RouterClient` to create a [Distribution Policy](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#distribution-policy) to control how jobs are to be distributed to workers with associated queue. +Use `RouterClient` to create a [Distribution Policy](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#distribution-policy) to control how jobs are to be distributed to workers with associated queue. For this example, we are going to create a __Longest Idle__ policy with an offer TTL set to 1 day. @@ -32,7 +32,7 @@ Response distributionPolicy = await routerAdministrationClie ## Create a Queue -Use `RouterClient` to create a [Queue](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#queue). +Use `RouterClient` to create a [Queue](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#queue). ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CreateQueue_Async Response queue = await routerAdministrationClient.CreateQueueAsync( @@ -44,7 +44,7 @@ Response queue = await routerAdministrationClient.CreateQueueAsync( ## Create a Job -Use `RouterClient` to create a [Job](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#job). +Use `RouterClient` to create a [Job](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#job). ```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CreateJobDirectQAssign_Async Response job = await routerClient.CreateJobAsync( @@ -80,7 +80,7 @@ Response worker = await routerClient.CreateWorkerAsync( ## Check offers to a Worker -Once the worker has been registered, Router will send an offer to the worker if the worker satisfies requirements for a job. See [Offer flow](https://docs.microsoft.com/azure/communication-services/concepts/router/concepts#offer) +Once the worker has been registered, Router will send an offer to the worker if the worker satisfies requirements for a job. See [Offer flow](https://learn.microsoft.com/azure/communication-services/concepts/router/concepts#offer) We should get a [RouterWorkerOfferIssued][offer_issued_event_schema] from our [EventGrid subscription][subscribe_events]. @@ -191,8 +191,8 @@ Console.WriteLine($"Updated job status: {updatedJob.Value.Status == RouterJobSta ``` -[subscribe_events]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events -[offer_issued_event_schema]: https://docs.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued +[subscribe_events]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events +[offer_issued_event_schema]: https://learn.microsoft.com/azure/communication-services/how-tos/router-sdk/subscribe-events#microsoftcommunicationrouterworkerofferissued [deserialize_event_grid_event_data]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid#receiving-and-deserializing-events -[event_grid_event_handlers]: https://docs.microsoft.com/azure/event-grid/event-handlers -[webhook_event_grid_event_delivery]: https://docs.microsoft.com/azure/event-grid/webhook-event-delivery +[event_grid_event_handlers]: https://learn.microsoft.com/azure/event-grid/event-handlers +[webhook_event_grid_event_delivery]: https://learn.microsoft.com/azure/event-grid/webhook-event-delivery diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithPriorityRuleAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithPriorityRuleAsync.md index b200deb15bcc..2305051a3d7c 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithPriorityRuleAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample2_ClassificationWithPriorityRuleAsync.md @@ -271,4 +271,4 @@ Console.WriteLine($"Job has been assigned a priority value: {queriedJob2.Value.P ``` -[azure-func-js-quickstart]: https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-node +[azure-func-js-quickstart]: https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-node diff --git a/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md b/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md index 7d499185ee10..1afe9948546d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md +++ b/sdk/communication/Azure.Communication.JobRouter/samples/Sample3_AdvancedDistributionAsync.md @@ -144,7 +144,7 @@ The decision flow (as shown above) is as follows: Before moving on any further in the process, let us first define an Azure function that scores worker. > [!NOTE] -> The following Azure function is using JavaScript. For more information, please refer to [Quickstart: Create a JavaScript function in Azure using Visual Studio Code](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-node) +> The following Azure function is using JavaScript. For more information, please refer to [Quickstart: Create a JavaScript function in Azure using Visual Studio Code](https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-node) Sample input for **Worker 1** diff --git a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json index bd9c94ca5bae..d7e9f4991651 100644 --- a/sdk/communication/Azure.Communication.Messages/tspCodeModel.json +++ b/sdk/communication/Azure.Communication.Messages/tspCodeModel.json @@ -34,7 +34,7 @@ "enumType": { "$ref": "2" }, - "description": "Text message type.", + "doc": "Text message type.", "decorators": [] }, { @@ -52,7 +52,7 @@ "enumType": { "$ref": "2" }, - "description": "Image message type.", + "doc": "Image message type.", "decorators": [] }, { @@ -70,7 +70,7 @@ "enumType": { "$ref": "2" }, - "description": "Image message type. Legacy image type for `MediaNotificationContent` which is being deprecated", + "doc": "Image message type. Legacy image type for `MediaNotificationContent` which is being deprecated", "decorators": [] }, { @@ -88,7 +88,7 @@ "enumType": { "$ref": "2" }, - "description": "Document message type.", + "doc": "Document message type.", "decorators": [] }, { @@ -106,7 +106,7 @@ "enumType": { "$ref": "2" }, - "description": "Video message type.", + "doc": "Video message type.", "decorators": [] }, { @@ -124,7 +124,7 @@ "enumType": { "$ref": "2" }, - "description": "Audio message type.", + "doc": "Audio message type.", "decorators": [] }, { @@ -142,11 +142,11 @@ "enumType": { "$ref": "2" }, - "description": "Template message type.", + "doc": "Template message type.", "decorators": [] } ], - "description": "The type of message.", + "doc": "The type of message.", "isFixed": false, "isFlags": false, "usage": "Input,Json", @@ -180,7 +180,7 @@ "enumType": { "$ref": "18" }, - "description": "The text template parameter type.", + "doc": "The text template parameter type.", "decorators": [] }, { @@ -198,7 +198,7 @@ "enumType": { "$ref": "18" }, - "description": "The image template parameter type.", + "doc": "The image template parameter type.", "decorators": [] }, { @@ -216,7 +216,7 @@ "enumType": { "$ref": "18" }, - "description": "The document template parameter type.", + "doc": "The document template parameter type.", "decorators": [] }, { @@ -234,7 +234,7 @@ "enumType": { "$ref": "18" }, - "description": "The video template parameter type.", + "doc": "The video template parameter type.", "decorators": [] }, { @@ -252,7 +252,7 @@ "enumType": { "$ref": "18" }, - "description": "The location template parameter type.", + "doc": "The location template parameter type.", "decorators": [] }, { @@ -270,11 +270,11 @@ "enumType": { "$ref": "18" }, - "description": "The quick action template parameter type.", + "doc": "The quick action template parameter type.", "decorators": [] } ], - "description": "The type of the template parameter.", + "doc": "The type of the template parameter.", "isFixed": false, "isFlags": false, "usage": "Input,Json", @@ -308,11 +308,11 @@ "enumType": { "$ref": "32" }, - "description": "The WhatsApp template type.", + "doc": "The WhatsApp template type.", "decorators": [] } ], - "description": "The type of the message template.", + "doc": "The type of the message template.", "isFixed": false, "isFlags": false, "usage": "Input,Json", @@ -346,7 +346,7 @@ "enumType": { "$ref": "36" }, - "description": "The WhatsApp button sub type is quick reply.", + "doc": "The WhatsApp button sub type is quick reply.", "decorators": [] }, { @@ -364,11 +364,11 @@ "enumType": { "$ref": "36" }, - "description": "The WhatsApp button sub type is url.", + "doc": "The WhatsApp button sub type is url.", "decorators": [] } ], - "description": "The WhatsApp button sub type.", + "doc": "The WhatsApp button sub type.", "isFixed": false, "isFlags": false, "usage": "Input,Json", @@ -402,7 +402,7 @@ "enumType": { "$ref": "42" }, - "description": "Azure Communication Messages 2024-02-01 api version", + "doc": "Azure Communication Messages 2024-02-01 api version", "decorators": [] }, { @@ -420,11 +420,11 @@ "enumType": { "$ref": "42" }, - "description": "Azure Communication Messages 2024-08-30 api version", + "doc": "Azure Communication Messages 2024-08-30 api version", "decorators": [] } ], - "description": "Azure Communication Messages Versions", + "doc": "Azure Communication Messages Versions", "isFixed": true, "isFlags": false, "usage": "ApiVersionEnum", @@ -458,7 +458,7 @@ "enumType": { "$ref": "48" }, - "description": "Message template is approved.", + "doc": "Message template is approved.", "decorators": [] }, { @@ -476,7 +476,7 @@ "enumType": { "$ref": "48" }, - "description": "Message template is rejected.", + "doc": "Message template is rejected.", "decorators": [] }, { @@ -494,7 +494,7 @@ "enumType": { "$ref": "48" }, - "description": "Message template is pending.", + "doc": "Message template is pending.", "decorators": [] }, { @@ -512,11 +512,11 @@ "enumType": { "$ref": "48" }, - "description": "Message template is paused.", + "doc": "Message template is paused.", "decorators": [] } ], - "description": "The aggregated template status.", + "doc": "The aggregated template status.", "isFixed": false, "isFlags": false, "usage": "Output,Json", @@ -550,11 +550,11 @@ "enumType": { "$ref": "58" }, - "description": "The WhatsApp communication messages channel type.", + "doc": "The WhatsApp communication messages channel type.", "decorators": [] } ], - "description": "The type of the communication messages channel.", + "doc": "The type of the communication messages channel.", "isFixed": false, "isFlags": false, "usage": "Output,Json", @@ -588,7 +588,7 @@ "enumType": { "$ref": "62" }, - "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation.", + "doc": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation.", "decorators": [] }, { @@ -606,11 +606,11 @@ "enumType": { "$ref": "62" }, - "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server.", + "doc": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server.", "decorators": [] } ], - "description": "Repeatability Result header options", + "doc": "Repeatability Result header options", "isFixed": true, "isFlags": false, "usage": "Output", @@ -624,14 +624,14 @@ "name": "NotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.NotificationContent", "usage": "Input,Json", - "description": "Details of the message to send.", + "doc": "Details of the message to send.", "decorators": [], "discriminatorProperty": { "$id": "69", "kind": "property", "name": "kind", "serializedName": "kind", - "description": "The type discriminator describing a notification type.", + "doc": "The type discriminator describing a notification type.", "type": { "$ref": "2" }, @@ -648,7 +648,7 @@ "kind": "property", "name": "channelRegistrationId", "serializedName": "channelRegistrationId", - "description": "The Channel Registration ID for the Business Identifier.", + "doc": "The Channel Registration ID for the Business Identifier.", "type": { "$id": "71", "kind": "string", @@ -675,7 +675,7 @@ "kind": "property", "name": "to", "serializedName": "to", - "description": "The native external platform user identifiers of the recipient.", + "doc": "The native external platform user identifiers of the recipient.", "type": { "$id": "74", "kind": "array", @@ -709,7 +709,7 @@ "name": "TextNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TextNotificationContent", "usage": "Input,Json", - "description": "A request to send a text notification.", + "doc": "A request to send a text notification.", "discriminatorValue": "text", "decorators": [], "baseModel": { @@ -721,7 +721,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is text.", + "doc": "Message notification type is text.", "type": { "$id": "79", "kind": "constant", @@ -747,7 +747,7 @@ "kind": "property", "name": "content", "serializedName": "content", - "description": "Message content.", + "doc": "Message content.", "type": { "$id": "82", "kind": "string", @@ -771,7 +771,7 @@ "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MediaNotificationContent", "usage": "Input,Json", "deprecation": "`MediaNotificationContent` is being deprecated, we encourage you to use the new `ImageNotificationContent` for sending images instead.", - "description": "@deprecated A request to send an image notification.", + "doc": "@deprecated A request to send an image notification.", "discriminatorValue": "image_v0", "decorators": [], "baseModel": { @@ -783,7 +783,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is image.", + "doc": "Message notification type is image.", "type": { "$id": "85", "kind": "constant", @@ -809,7 +809,7 @@ "kind": "property", "name": "content", "serializedName": "content", - "description": "Optional text content.", + "doc": "Optional text content.", "type": { "$id": "88", "kind": "string", @@ -829,7 +829,7 @@ "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", - "description": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { "$id": "90", "kind": "url", @@ -852,7 +852,7 @@ "name": "ImageNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.ImageNotificationContent", "usage": "Input,Json", - "description": "A request to send an image notification.", + "doc": "A request to send an image notification.", "discriminatorValue": "image", "decorators": [], "baseModel": { @@ -864,7 +864,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is image.", + "doc": "Message notification type is image.", "type": { "$id": "93", "kind": "constant", @@ -890,7 +890,7 @@ "kind": "property", "name": "caption", "serializedName": "caption", - "description": "Optional text content.", + "doc": "Optional text content.", "type": { "$id": "96", "kind": "string", @@ -910,7 +910,7 @@ "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", - "description": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { "$id": "98", "kind": "url", @@ -933,7 +933,7 @@ "name": "DocumentNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.DocumentNotificationContent", "usage": "Input,Json", - "description": "A request to send a document notification.", + "doc": "A request to send a document notification.", "discriminatorValue": "document", "decorators": [], "baseModel": { @@ -945,7 +945,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is image.", + "doc": "Message notification type is image.", "type": { "$id": "101", "kind": "constant", @@ -971,7 +971,7 @@ "kind": "property", "name": "caption", "serializedName": "caption", - "description": "Optional text content.", + "doc": "Optional text content.", "type": { "$id": "104", "kind": "string", @@ -991,7 +991,7 @@ "kind": "property", "name": "fileName", "serializedName": "fileName", - "description": "Optional name for the file.", + "doc": "Optional name for the file.", "type": { "$id": "106", "kind": "string", @@ -1011,7 +1011,7 @@ "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", - "description": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { "$id": "108", "kind": "url", @@ -1034,7 +1034,7 @@ "name": "VideoNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.VideoNotificationContent", "usage": "Input,Json", - "description": "A request to send a video notification.", + "doc": "A request to send a video notification.", "discriminatorValue": "video", "decorators": [], "baseModel": { @@ -1046,7 +1046,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is image.", + "doc": "Message notification type is image.", "type": { "$id": "111", "kind": "constant", @@ -1072,7 +1072,7 @@ "kind": "property", "name": "caption", "serializedName": "caption", - "description": "Optional text content.", + "doc": "Optional text content.", "type": { "$id": "114", "kind": "string", @@ -1092,7 +1092,7 @@ "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", - "description": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { "$id": "116", "kind": "url", @@ -1115,7 +1115,7 @@ "name": "AudioNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.AudioNotificationContent", "usage": "Input,Json", - "description": "A request to send an audio notification.", + "doc": "A request to send an audio notification.", "discriminatorValue": "audio", "decorators": [], "baseModel": { @@ -1127,7 +1127,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is audio.", + "doc": "Message notification type is audio.", "type": { "$id": "119", "kind": "constant", @@ -1153,7 +1153,7 @@ "kind": "property", "name": "mediaUri", "serializedName": "mediaUri", - "description": "A media url for the file. Required if the type is one of the supported media types, e.g. image", + "doc": "A media url for the file. Required if the type is one of the supported media types, e.g. image", "type": { "$id": "122", "kind": "url", @@ -1176,7 +1176,7 @@ "name": "TemplateNotificationContent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.TemplateNotificationContent", "usage": "Input,Json", - "description": "A request to send a template notification.", + "doc": "A request to send a template notification.", "discriminatorValue": "template", "decorators": [], "baseModel": { @@ -1188,7 +1188,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message notification type is template.", + "doc": "Message notification type is template.", "type": { "$id": "125", "kind": "constant", @@ -1214,14 +1214,14 @@ "kind": "property", "name": "template", "serializedName": "template", - "description": "The template object used to create templates.", + "doc": "The template object used to create templates.", "type": { "$id": "128", "kind": "model", "name": "MessageTemplate", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplate", "usage": "Input,Json", - "description": "The template object used to create templates.", + "doc": "The template object used to create templates.", "decorators": [], "properties": [ { @@ -1229,7 +1229,7 @@ "kind": "property", "name": "name", "serializedName": "name", - "description": "Name of the template.", + "doc": "Name of the template.", "type": { "$id": "130", "kind": "string", @@ -1249,7 +1249,7 @@ "kind": "property", "name": "language", "serializedName": "language", - "description": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", + "doc": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", "type": { "$id": "132", "kind": "string", @@ -1269,7 +1269,7 @@ "kind": "property", "name": "values", "serializedName": "values", - "description": "The template values.", + "doc": "The template values.", "type": { "$id": "134", "kind": "array", @@ -1280,14 +1280,14 @@ "name": "MessageTemplateValue", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateValue", "usage": "Input,Json", - "description": "The class describes a parameter of a template.", + "doc": "The class describes a parameter of a template.", "decorators": [], "discriminatorProperty": { "$id": "136", "kind": "property", "name": "kind", "serializedName": "kind", - "description": "The type discriminator describing a template parameter type.", + "doc": "The type discriminator describing a template parameter type.", "type": { "$ref": "18" }, @@ -1304,7 +1304,7 @@ "kind": "property", "name": "name", "serializedName": "name", - "description": "Template binding reference name", + "doc": "Template binding reference name", "type": { "$id": "138", "kind": "string", @@ -1331,7 +1331,7 @@ "name": "MessageTemplateText", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateText", "usage": "Input,Json", - "description": "The message template's text value information.", + "doc": "The message template's text value information.", "discriminatorValue": "text", "decorators": [], "baseModel": { @@ -1343,7 +1343,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message parameter type is text.", + "doc": "Message parameter type is text.", "type": { "$id": "142", "kind": "constant", @@ -1369,7 +1369,7 @@ "kind": "property", "name": "text", "serializedName": "text", - "description": "The text value.", + "doc": "The text value.", "type": { "$id": "145", "kind": "string", @@ -1392,7 +1392,7 @@ "name": "MessageTemplateImage", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateImage", "usage": "Input,Json", - "description": "The message template's image value information.", + "doc": "The message template's image value information.", "discriminatorValue": "image", "decorators": [], "baseModel": { @@ -1404,7 +1404,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message parameter type is image.", + "doc": "Message parameter type is image.", "type": { "$id": "148", "kind": "constant", @@ -1430,7 +1430,7 @@ "kind": "property", "name": "uri", "serializedName": "url", - "description": "The (public) URL of the media.", + "doc": "The (public) URL of the media.", "type": { "$id": "151", "kind": "url", @@ -1450,7 +1450,7 @@ "kind": "property", "name": "caption", "serializedName": "caption", - "description": "The [optional] caption of the media object.", + "doc": "The [optional] caption of the media object.", "type": { "$id": "153", "kind": "string", @@ -1470,7 +1470,7 @@ "kind": "property", "name": "fileName", "serializedName": "fileName", - "description": "The [optional] filename of the media file.", + "doc": "The [optional] filename of the media file.", "type": { "$id": "155", "kind": "string", @@ -1493,7 +1493,7 @@ "name": "MessageTemplateDocument", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateDocument", "usage": "Input,Json", - "description": "The message template's document value information.", + "doc": "The message template's document value information.", "discriminatorValue": "document", "decorators": [], "baseModel": { @@ -1505,7 +1505,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message parameter type is document.", + "doc": "Message parameter type is document.", "type": { "$id": "158", "kind": "constant", @@ -1531,7 +1531,7 @@ "kind": "property", "name": "uri", "serializedName": "url", - "description": "The (public) URL of the media.", + "doc": "The (public) URL of the media.", "type": { "$id": "161", "kind": "url", @@ -1551,7 +1551,7 @@ "kind": "property", "name": "caption", "serializedName": "caption", - "description": "The [optional] caption of the media object.", + "doc": "The [optional] caption of the media object.", "type": { "$id": "163", "kind": "string", @@ -1571,7 +1571,7 @@ "kind": "property", "name": "fileName", "serializedName": "fileName", - "description": "The [optional] filename of the media file.", + "doc": "The [optional] filename of the media file.", "type": { "$id": "165", "kind": "string", @@ -1594,7 +1594,7 @@ "name": "MessageTemplateVideo", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateVideo", "usage": "Input,Json", - "description": "The message template's video value information.", + "doc": "The message template's video value information.", "discriminatorValue": "video", "decorators": [], "baseModel": { @@ -1606,7 +1606,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message parameter type is video.", + "doc": "Message parameter type is video.", "type": { "$id": "168", "kind": "constant", @@ -1632,7 +1632,7 @@ "kind": "property", "name": "uri", "serializedName": "url", - "description": "The (public) URL of the media.", + "doc": "The (public) URL of the media.", "type": { "$id": "171", "kind": "url", @@ -1652,7 +1652,7 @@ "kind": "property", "name": "caption", "serializedName": "caption", - "description": "The [optional] caption of the media object.", + "doc": "The [optional] caption of the media object.", "type": { "$id": "173", "kind": "string", @@ -1672,7 +1672,7 @@ "kind": "property", "name": "fileName", "serializedName": "fileName", - "description": "The [optional] filename of the media file.", + "doc": "The [optional] filename of the media file.", "type": { "$id": "175", "kind": "string", @@ -1695,7 +1695,7 @@ "name": "MessageTemplateLocation", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateLocation", "usage": "Input,Json", - "description": "The message template's location value information.", + "doc": "The message template's location value information.", "discriminatorValue": "location", "decorators": [], "baseModel": { @@ -1707,7 +1707,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message parameter type is location.", + "doc": "Message parameter type is location.", "type": { "$id": "178", "kind": "constant", @@ -1733,7 +1733,7 @@ "kind": "property", "name": "locationName", "serializedName": "locationName", - "description": "The [Optional] name of the location.", + "doc": "The [Optional] name of the location.", "type": { "$id": "181", "kind": "string", @@ -1753,7 +1753,7 @@ "kind": "property", "name": "address", "serializedName": "address", - "description": "The [Optional] address of the location.", + "doc": "The [Optional] address of the location.", "type": { "$id": "183", "kind": "string", @@ -1773,7 +1773,7 @@ "kind": "property", "name": "latitude", "serializedName": "latitude", - "description": "The latitude of the location.", + "doc": "The latitude of the location.", "type": { "$id": "185", "kind": "float64", @@ -1793,7 +1793,7 @@ "kind": "property", "name": "longitude", "serializedName": "longitude", - "description": "The longitude of the location.", + "doc": "The longitude of the location.", "type": { "$id": "187", "kind": "float64", @@ -1816,7 +1816,7 @@ "name": "MessageTemplateQuickAction", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateQuickAction", "usage": "Input,Json", - "description": "The message template's quick action value information.", + "doc": "The message template's quick action value information.", "discriminatorValue": "quickAction", "decorators": [], "baseModel": { @@ -1828,7 +1828,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message parameter type is quick action.", + "doc": "Message parameter type is quick action.", "type": { "$id": "190", "kind": "constant", @@ -1854,7 +1854,7 @@ "kind": "property", "name": "text", "serializedName": "text", - "description": "The [Optional] quick action text", + "doc": "The [Optional] quick action text", "type": { "$id": "193", "kind": "string", @@ -1874,7 +1874,7 @@ "kind": "property", "name": "payload", "serializedName": "payload", - "description": "The [Optional] quick action payload", + "doc": "The [Optional] quick action payload", "type": { "$id": "195", "kind": "string", @@ -1908,21 +1908,21 @@ "kind": "property", "name": "bindings", "serializedName": "bindings", - "description": "The binding object to link values to the template specific locations", + "doc": "The binding object to link values to the template specific locations", "type": { "$id": "197", "kind": "model", "name": "MessageTemplateBindings", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateBindings", "usage": "Input,Json", - "description": "The binding object to link values to the template specific locations", + "doc": "The binding object to link values to the template specific locations", "decorators": [], "discriminatorProperty": { "$id": "198", "kind": "property", "name": "kind", "serializedName": "kind", - "description": "The type discriminator describing a template bindings type.", + "doc": "The type discriminator describing a template bindings type.", "type": { "$ref": "32" }, @@ -1946,7 +1946,7 @@ "name": "WhatsAppMessageTemplateBindings", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindings", "usage": "Input,Json", - "description": "The template bindings for WhatsApp", + "doc": "The template bindings for WhatsApp", "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { @@ -1958,7 +1958,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "MessageTemplateBindings is whatsApp", + "doc": "MessageTemplateBindings is whatsApp", "type": { "$id": "202", "kind": "constant", @@ -1984,7 +1984,7 @@ "kind": "property", "name": "header", "serializedName": "header", - "description": "The header template bindings", + "doc": "The header template bindings", "type": { "$id": "205", "kind": "array", @@ -1995,7 +1995,7 @@ "name": "WhatsAppMessageTemplateBindingsComponent", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsComponent", "usage": "Input,Json", - "description": "The template bindings component for WhatsApp", + "doc": "The template bindings component for WhatsApp", "decorators": [], "properties": [ { @@ -2003,7 +2003,7 @@ "kind": "property", "name": "refValue", "serializedName": "refValue", - "description": "The name of the referenced item in the template values.", + "doc": "The name of the referenced item in the template values.", "type": { "$id": "208", "kind": "string", @@ -2035,7 +2035,7 @@ "kind": "property", "name": "body", "serializedName": "body", - "description": "The body template bindings", + "doc": "The body template bindings", "type": { "$id": "210", "kind": "array", @@ -2058,7 +2058,7 @@ "kind": "property", "name": "footer", "serializedName": "footer", - "description": "The footer template bindings", + "doc": "The footer template bindings", "type": { "$id": "212", "kind": "array", @@ -2081,7 +2081,7 @@ "kind": "property", "name": "buttons", "serializedName": "buttons", - "description": "The button template bindings", + "doc": "The button template bindings", "type": { "$id": "214", "kind": "array", @@ -2092,7 +2092,7 @@ "name": "WhatsAppMessageTemplateBindingsButton", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateBindingsButton", "usage": "Input,Json", - "description": "The template bindings component button for WhatsApp", + "doc": "The template bindings component button for WhatsApp", "decorators": [], "properties": [ { @@ -2100,7 +2100,7 @@ "kind": "property", "name": "subType", "serializedName": "subType", - "description": "The WhatsApp button sub type", + "doc": "The WhatsApp button sub type", "type": { "$ref": "36" }, @@ -2116,7 +2116,7 @@ "kind": "property", "name": "refValue", "serializedName": "refValue", - "description": "The name of the referenced item in the template values.", + "doc": "The name of the referenced item in the template values.", "type": { "$id": "218", "kind": "string", @@ -2230,7 +2230,7 @@ "name": "SendMessageResult", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.SendMessageResult", "usage": "Output,Json", - "description": "Result of the send message operation.", + "doc": "Result of the send message operation.", "decorators": [], "properties": [ { @@ -2238,7 +2238,7 @@ "kind": "property", "name": "receipts", "serializedName": "receipts", - "description": "Receipts of the send message operation.", + "doc": "Receipts of the send message operation.", "type": { "$id": "221", "kind": "array", @@ -2249,7 +2249,7 @@ "name": "MessageReceipt", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageReceipt", "usage": "Output,Json", - "description": "Receipt of the sending one message.", + "doc": "Receipt of the sending one message.", "decorators": [], "properties": [ { @@ -2257,7 +2257,7 @@ "kind": "property", "name": "messageId", "serializedName": "messageId", - "description": "The message id.", + "doc": "The message id.", "type": { "$id": "224", "kind": "string", @@ -2277,7 +2277,7 @@ "kind": "property", "name": "to", "serializedName": "to", - "description": "The native external platform user identifier of the recipient.", + "doc": "The native external platform user identifier of the recipient.", "type": { "$id": "226", "kind": "string", @@ -2315,14 +2315,14 @@ "name": "MessageTemplateItem", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.MessageTemplateItem", "usage": "Output,Json", - "description": "The message template as returned from the service.", + "doc": "The message template as returned from the service.", "decorators": [], "discriminatorProperty": { "$id": "228", "kind": "property", "name": "kind", "serializedName": "kind", - "description": "The type discriminator describing a template type.", + "doc": "The type discriminator describing a template type.", "type": { "$ref": "58" }, @@ -2339,7 +2339,7 @@ "kind": "property", "name": "name", "serializedName": "name", - "description": "The template's name.", + "doc": "The template's name.", "type": { "$id": "230", "kind": "string", @@ -2359,7 +2359,7 @@ "kind": "property", "name": "language", "serializedName": "language", - "description": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", + "doc": "The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.", "type": { "$id": "232", "kind": "string", @@ -2379,7 +2379,7 @@ "kind": "property", "name": "status", "serializedName": "status", - "description": "The aggregated template status.", + "doc": "The aggregated template status.", "type": { "$ref": "48" }, @@ -2402,7 +2402,7 @@ "name": "WhatsAppMessageTemplateItem", "crossLanguageDefinitionId": "Azure.Communication.MessagesService.WhatsAppMessageTemplateItem", "usage": "Output,Json", - "description": "The WhatsApp-specific template response contract", + "doc": "The WhatsApp-specific template response contract", "discriminatorValue": "whatsApp", "decorators": [], "baseModel": { @@ -2414,7 +2414,7 @@ "kind": "property", "name": "content", "serializedName": "content", - "description": "WhatsApp platform's template content. This is the payload returned from WhatsApp API.", + "doc": "WhatsApp platform's template content. This is the payload returned from WhatsApp API.", "type": { "$id": "237", "kind": "unknown", @@ -2434,7 +2434,7 @@ "kind": "property", "name": "kind", "serializedName": "kind", - "description": "Message template response type is whatsApp.", + "doc": "Message template response type is whatsApp.", "type": { "$id": "239", "kind": "constant", @@ -2468,7 +2468,7 @@ "name": "PagedMessageTemplateItem", "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", "usage": "Output,Json", - "description": "Paged collection of MessageTemplateItem items", + "doc": "Paged collection of MessageTemplateItem items", "decorators": [], "properties": [ { @@ -2476,7 +2476,7 @@ "kind": "property", "name": "value", "serializedName": "value", - "description": "The MessageTemplateItem items on this page", + "doc": "The MessageTemplateItem items on this page", "type": { "$id": "243", "kind": "array", @@ -2499,7 +2499,7 @@ "kind": "property", "name": "nextLink", "serializedName": "nextLink", - "description": "The link to the next page of items", + "doc": "The link to the next page of items", "type": { "$id": "245", "kind": "url", @@ -2533,14 +2533,14 @@ "$id": "248", "Name": "send", "ResourceName": "NotificationMessagesClient", - "Description": "Sends a notification message from Business to User.", + "Doc": "Sends a notification message from Business to User.", "Accessibility": "public", "Parameters": [ { "$id": "249", "Name": "apiVersion", "NameInRequest": "api-version", - "Description": "The API version to use for this operation.", + "Doc": "The API version to use for this operation.", "Type": { "$id": "250", "kind": "string", @@ -2572,7 +2572,7 @@ "$id": "253", "Name": "repeatabilityRequestId", "NameInRequest": "Repeatability-Request-ID", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "254", "kind": "string", @@ -2594,7 +2594,7 @@ "$id": "255", "Name": "repeatabilityFirstSent", "NameInRequest": "Repeatability-First-Sent", - "Description": "Specifies the date and time at which the request was first created.", + "Doc": "Specifies the date and time at which the request was first created.", "Type": { "$id": "256", "kind": "utcDateTime", @@ -2624,7 +2624,7 @@ "$id": "258", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "259", "kind": "string", @@ -2653,7 +2653,7 @@ "$id": "261", "Name": "contentType", "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", + "Doc": "Body parameter's content type. Known values are application/json", "Type": { "$id": "262", "kind": "constant", @@ -2708,7 +2708,7 @@ "$id": "267", "Name": "notificationContent", "NameInRequest": "notificationContent", - "Description": "Details of the message to send.", + "Doc": "Details of the message to send.", "Type": { "$ref": "68" }, @@ -2738,7 +2738,7 @@ "$id": "269", "Name": "repeatabilityResult", "NameInResponse": "Repeatability-Result", - "Description": "Indicates whether the repeatable request was accepted or rejected.", + "Doc": "Indicates whether the repeatable request was accepted or rejected.", "Type": { "$ref": "62" } @@ -2747,7 +2747,7 @@ "$id": "270", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "271", "kind": "string", @@ -2787,14 +2787,14 @@ "$id": "273", "Name": "downloadMediaInternal", "ResourceName": "MessageDataStream", - "Description": "Download the Media payload from a User to Business message.", + "Doc": "Download the Media payload from a User to Business message.", "Accessibility": "internal", "Parameters": [ { "$id": "274", "Name": "apiVersion", "NameInRequest": "api-version", - "Description": "The API version to use for this operation.", + "Doc": "The API version to use for this operation.", "Type": { "$id": "275", "kind": "string", @@ -2826,7 +2826,7 @@ "$id": "278", "Name": "id", "NameInRequest": "id", - "Description": "The stream ID.", + "Doc": "The stream ID.", "Type": { "$id": "279", "kind": "string", @@ -2848,7 +2848,7 @@ "$id": "280", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "281", "kind": "string", @@ -2920,7 +2920,7 @@ "$id": "288", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "289", "kind": "string", @@ -2940,7 +2940,7 @@ "$id": "291", "Name": "contentType", "NameInResponse": "content-type", - "Description": "The stream content type.", + "Doc": "The stream content type.", "Type": { "$id": "292", "kind": "constant", @@ -3037,7 +3037,7 @@ "$id": "302", "Name": "endpoint", "NameInRequest": "endpoint", - "Description": "The communication resource, for example https://my-resource.communication.azure.com", + "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { "$id": "303", "kind": "url", @@ -3065,14 +3065,14 @@ "$id": "305", "Name": "getTemplates", "ResourceName": "MessageTemplateItem", - "Description": "List all templates for given Azure Communication Services channel", + "Doc": "List all templates for given Azure Communication Services channel", "Accessibility": "public", "Parameters": [ { "$id": "306", "Name": "apiVersion", "NameInRequest": "api-version", - "Description": "The API version to use for this operation.", + "Doc": "The API version to use for this operation.", "Type": { "$id": "307", "kind": "string", @@ -3104,7 +3104,7 @@ "$id": "310", "Name": "channelId", "NameInRequest": "channelId", - "Description": "The registration ID of the channel.", + "Doc": "The registration ID of the channel.", "Type": { "$id": "311", "kind": "string", @@ -3133,7 +3133,7 @@ "$id": "313", "Name": "maxpagesize", "NameInRequest": "maxpagesize", - "Description": "Number of objects to return per page.", + "Doc": "Number of objects to return per page.", "Type": { "$id": "314", "kind": "int32", @@ -3155,7 +3155,7 @@ "$id": "315", "Name": "clientRequestId", "NameInRequest": "x-ms-client-request-id", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "316", "kind": "string", @@ -3223,7 +3223,7 @@ "$id": "322", "Name": "clientRequestId", "NameInResponse": "x-ms-client-request-id", - "Description": "An opaque, globally-unique, client-generated string identifier for the request.", + "Doc": "An opaque, globally-unique, client-generated string identifier for the request.", "Type": { "$id": "323", "kind": "string", @@ -3270,7 +3270,7 @@ "$id": "327", "Name": "endpoint", "NameInRequest": "endpoint", - "Description": "The communication resource, for example https://my-resource.communication.azure.com", + "Doc": "The communication resource, for example https://my-resource.communication.azure.com", "Type": { "$id": "328", "kind": "url", diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md b/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md index 53130d756f84..65d8684ed902 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.PhoneNumbers/CHANGELOG.md @@ -102,4 +102,4 @@ Updated `Azure.Communication.PhoneNumbers` version. [read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.PhoneNumbers/README.md -[documentation]: https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp +[documentation]: https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp diff --git a/sdk/communication/Azure.Communication.PhoneNumbers/README.md b/sdk/communication/Azure.Communication.PhoneNumbers/README.md index 70261866a607..52b6806909d5 100644 --- a/sdk/communication/Azure.Communication.PhoneNumbers/README.md +++ b/sdk/communication/Azure.Communication.PhoneNumbers/README.md @@ -234,7 +234,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [azure_sub]: https://azure.microsoft.com/free/dotnet/ [azure_portal]: https://portal.azure.com -[azure_identity]: https://docs.microsoft.com/dotnet/api/azure.identity?view=azure-dotnet +[azure_identity]: https://learn.microsoft.com/dotnet/api/azure.identity?view=azure-dotnet [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.PhoneNumbers/src [source_samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.PhoneNumbers/samples [cla]: https://cla.microsoft.com @@ -242,11 +242,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[phone_numbers]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony/get-phone-number?pivots=platform-azp -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[phone_numbers]: https://learn.microsoft.com/azure/communication-services/quickstarts/telephony/get-phone-number?pivots=platform-azp +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [nuget]: https://www.nuget.org/ -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[direct_routing]: https://docs.microsoft.com/azure/communication-services/concepts/telephony/direct-routing-provisioning +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[direct_routing]: https://learn.microsoft.com/azure/communication-services/concepts/telephony/direct-routing-provisioning diff --git a/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md b/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md index f12426c3b871..0a02178d4ac0 100644 --- a/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md +++ b/sdk/communication/Azure.Communication.ProgrammableConnectivity/README.md @@ -2,7 +2,7 @@ This client library allows .NET applications to interact with Azure Programmable Connectivity Gateway, instead of using `curl` requests. For information on APC, see [docs](https://learn.microsoft.com/azure/programmable-connectivity/). - [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.ProgrammableConnectivity/src) | Package (NuGet): `https://www.nuget.org/packages/Azure.Communication.ProgrammableConnectivity` | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.ProgrammableConnectivity/src) | Package (NuGet): `https://www.nuget.org/packages/Azure.Communication.ProgrammableConnectivity` | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://learn.microsoft.com/azure) ## Getting started diff --git a/sdk/communication/Azure.Communication.ProgrammableConnectivity/samples/README.md b/sdk/communication/Azure.Communication.ProgrammableConnectivity/samples/README.md index 7f6b119d3058..35ad87039163 100644 --- a/sdk/communication/Azure.Communication.ProgrammableConnectivity/samples/README.md +++ b/sdk/communication/Azure.Communication.ProgrammableConnectivity/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.Communication.ProgrammableConnectivity samples for .NET description: Samples for the Azure.Communication.ProgrammableConnectivity client library. diff --git a/sdk/communication/Azure.Communication.Rooms/README.md b/sdk/communication/Azure.Communication.Rooms/README.md index f8a47bacd03e..c228ad403265 100644 --- a/sdk/communication/Azure.Communication.Rooms/README.md +++ b/sdk/communication/Azure.Communication.Rooms/README.md @@ -229,13 +229,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net [nextsteps]: https://learn.microsoft.com/azure/communication-services/quickstarts/rooms/get-started-rooms?tabs=windows&pivots=programming-language-csharp [nuget]: https://www.nuget.org/ -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Rooms/src [source_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Rooms/tests/Samples diff --git a/sdk/communication/Azure.Communication.ShortCodes/README.md b/sdk/communication/Azure.Communication.ShortCodes/README.md index a7d2e62b09ab..42e3d5fc3f8a 100644 --- a/sdk/communication/Azure.Communication.ShortCodes/README.md +++ b/sdk/communication/Azure.Communication.ShortCodes/README.md @@ -53,10 +53,10 @@ A `RequestFailedException` is thrown as a service response for any unsuccessful [azure_sub]: https://azure.microsoft.com/free/ -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net [nuget]: https://www.nuget.org/ ## Next steps @@ -75,4 +75,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [nuget]: https://www.nuget.org/ -[apply_for_short_code]: https://docs.microsoft.com/azure/communication-services/quickstarts/sms/apply-for-short-code +[apply_for_short_code]: https://learn.microsoft.com/azure/communication-services/quickstarts/sms/apply-for-short-code diff --git a/sdk/communication/Azure.Communication.Sms/CHANGELOG.md b/sdk/communication/Azure.Communication.Sms/CHANGELOG.md index 148666459c57..40f5098b8404 100644 --- a/sdk/communication/Azure.Communication.Sms/CHANGELOG.md +++ b/sdk/communication/Azure.Communication.Sms/CHANGELOG.md @@ -51,6 +51,6 @@ This is a Public Preview version, so breaking changes are possible in subsequent [read_me]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Sms/README.md -[documentation]:https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-csharp +[documentation]:https://learn.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-csharp diff --git a/sdk/communication/Azure.Communication.Sms/README.md b/sdk/communication/Azure.Communication.Sms/README.md index 4449dfdfe78a..94becbd0e050 100644 --- a/sdk/communication/Azure.Communication.Sms/README.md +++ b/sdk/communication/Azure.Communication.Sms/README.md @@ -44,7 +44,8 @@ SmsClient client = new SmsClient(new Uri(endpoint), tokenCredential); ``` ## Examples -### Send a 1:1 SMS Message +### SMS +#### Send a 1:1 SMS Message To send a SMS message, call the `Send` or `SendAsync` function from the `SmsClient`. ```C# Snippet:Azure_Communication_Sms_Tests_SendAsync SmsSendResult sendResult = await smsClient.SendAsync( @@ -53,7 +54,7 @@ SmsSendResult sendResult = await smsClient.SendAsync( message: "Hi"); Console.WriteLine($"Sms id: {sendResult.MessageId}"); ``` -### Send a 1:N SMS Message +#### Send a 1:N SMS Message To send a SMS message to a list of recipients, call the `Send` or `SendAsync` function from the `SmsClient` with a list of recipient's phone numbers. You may also add pass in an options object to specify whether the delivery report should be enabled and set custom tags. ```C# Snippet:Azure_Communication_SmsClient_Send_GroupSmsWithOptionsAsync @@ -72,6 +73,45 @@ foreach (SmsSendResult result in response.Value) Console.WriteLine($"Send Result Successful: {result.Successful}"); } ``` +### Opt Out Management +#### Check if a list of recipients is in the Opt Out list +To check if the recipients are in the Opt Out list, call the function from the `SmsClient.OptOuts.Check` or `SmsClient.OptOuts.CheckAsync` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_CheckAsync +var optOutCheckResults = await smsClient.OptOuts.CheckAsync( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers +foreach (var result in optOutCheckResults.Value) +{ + Console.WriteLine($"{result.To}: {result.IsOptedOut}"); +} +``` +#### Add a list of recipients to Opt Out list +To add the list of recipients to Opt Out list, call the function from the `SmsClient.OptOuts.Add` or `SmsClient.OptOuts.AddAsync` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_AddAsync +var optOutAddResults = await smsClient.OptOuts.AddAsync( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers +foreach (var result in optOutAddResults.Value) +{ + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); +} +``` + +#### Remove a list of recipients from Opt Out list +To remove the list of recipients to Opt Out list, call the function from the `SmsClient.OptOuts.Remove` or `SmsClient.OptOuts.RemoveAsync` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_RemoveAsync +var optOutRemoveResults = await smsClient.OptOuts.RemoveAsync( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + +foreach (var result in optOutRemoveResults.Value) +{ + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); +} +``` + + + ## Troubleshooting SMS operations will throw an exception if the request to the server fails. Exceptions will not be thrown if the error is caused by an individual message, only if something fails with the overall request. @@ -123,13 +163,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[handle_sms_events]: https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/handle-sms-events +[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp +[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice +[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net +[handle_sms_events]: https://learn.microsoft.com/azure/communication-services/quickstarts/telephony-sms/handle-sms-events [package]: https://www.nuget.org/packages/Azure.Communication.Sms -[product_docs]: https://docs.microsoft.com/azure/communication-services/overview -[nextsteps]:https://docs.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-csharp +[product_docs]: https://learn.microsoft.com/azure/communication-services/overview +[nextsteps]:https://learn.microsoft.com/azure/communication-services/quickstarts/telephony-sms/send?pivots=programming-language-csharp [nuget]: https://www.nuget.org/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Sms/src diff --git a/sdk/communication/Azure.Communication.Sms/assets.json b/sdk/communication/Azure.Communication.Sms/assets.json index e7fa3f54c5b5..24bb957cb2d0 100644 --- a/sdk/communication/Azure.Communication.Sms/assets.json +++ b/sdk/communication/Azure.Communication.Sms/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/communication/Azure.Communication.Sms", - "Tag": "net/communication/Azure.Communication.Sms_b96598d9ba" + "Tag": "net/communication/Azure.Communication.Sms_d05ab98bcb" } diff --git a/sdk/communication/Azure.Communication.Sms/samples/README.md b/sdk/communication/Azure.Communication.Sms/samples/README.md index 2759af3036d3..1bf79cecfad3 100644 --- a/sdk/communication/Azure.Communication.Sms/samples/README.md +++ b/sdk/communication/Azure.Communication.Sms/samples/README.md @@ -17,10 +17,14 @@ To get started you will need to have an Azure Subscription. Once you have this y This client library allows to do following operations: - Send SMS to one or more recipients - Specify optional paramters while sending SMS + - Manage the Opt Out list #### You can find samples for each of these functions below. - Send SMS Messages [synchronously][sample_sms] or [asynchronously][sample_sms_async] + - Manage Opt Out list [synchronously][sample_optouts] or [asynchronously][sample_optouts_async] [sample_sms]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Sms/samples/Sample1_SendSms.md [sample_sms_async]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Sms/samples/Sample1_SendSmsAsync.md +[sample_optouts]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApi.md +[sample_optouts_async]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApiAsync.md diff --git a/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApi.md b/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApi.md new file mode 100644 index 000000000000..07b82ec2a457 --- /dev/null +++ b/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApi.md @@ -0,0 +1,51 @@ +# Opt Out Management +This sample demonstrates how to check if customers phone numbers are in the Opt Out list, and add or remove entries to it. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `SmsClient` +SMS clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Sms_Tests_Samples_CreateSmsClientWithToken +string endpoint = ""; +TokenCredential tokenCredential = new DefaultAzureCredential(); +SmsClient client = new SmsClient(new Uri(endpoint), tokenCredential); +``` + +## Check if a list of recipients is in the Opt Out list +To check if the recipients are in the Opt Out list, call the function from the `SmsClient.OptOuts.Check` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Check +var optOutCheckResults = smsClient.OptOuts.Check( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers +foreach (var result in optOutCheckResults.Value) +{ + Console.WriteLine($"{result.To}: {result.IsOptedOut}"); +} +``` +## Add a list of recipients to Opt Out list +To add the list of recipients to Opt Out list, call the function from the `SmsClient.OptOuts.Add` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Add +var optOutAddResults = smsClient.OptOuts.Add( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers +foreach (var result in optOutAddResults.Value) +{ + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); +} +``` + +## Remove a list of recipients from Opt Out list +To remove the list of recipients to Opt Out list, call the function from the `SmsClient.OptOuts.Remove` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Remove +var optOutRemoveResults = smsClient.OptOuts.Remove( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + +foreach (var result in optOutRemoveResults.Value) +{ + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); +} +``` + +[README]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Sms/README.md#getting-started diff --git a/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApiAsync.md b/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApiAsync.md new file mode 100644 index 000000000000..0dcaa102e593 --- /dev/null +++ b/sdk/communication/Azure.Communication.Sms/samples/Sample2_OptOutsApiAsync.md @@ -0,0 +1,51 @@ +# Opt Out Management +This sample demonstrates how to check if customers phone numbers are in the Opt Out list, and add or remove entries to it. + +To get started you'll need a Communication Service Resource. See [README][README] for prerequisites and instructions. + +## Creating an `SmsClient` +SMS clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal. Alternatively, SMS clients can also be authenticated using a valid token credential. + +```C# Snippet:Azure_Communication_Sms_Tests_Samples_CreateSmsClientWithToken +string endpoint = ""; +TokenCredential tokenCredential = new DefaultAzureCredential(); +SmsClient client = new SmsClient(new Uri(endpoint), tokenCredential); +``` + +## Check if a list of recipients is in the Opt Out list +To check if the recipients are in the Opt Out list, call the function from the `SmsClient.OptOuts.CheckAsync` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_CheckAsync +var optOutCheckResults = await smsClient.OptOuts.CheckAsync( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers +foreach (var result in optOutCheckResults.Value) +{ + Console.WriteLine($"{result.To}: {result.IsOptedOut}"); +} +``` +## Add a list of recipients to Opt Out list +To add the list of recipients to Opt Out list, call the function from the `SmsClient.OptOuts.AddAsync` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_AddAsync +var optOutAddResults = await smsClient.OptOuts.AddAsync( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers +foreach (var result in optOutAddResults.Value) +{ + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); +} +``` + +## Remove a list of recipients from Opt Out list +To remove the list of recipients to Opt Out list, call the function from the `SmsClient.OptOuts.RemoveAsync` with a list of recipient phone numbers. +```C# Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_RemoveAsync +var optOutRemoveResults = await smsClient.OptOuts.RemoveAsync( + from: "", // Your E.164 formatted from phone number used to send SMS + to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + +foreach (var result in optOutRemoveResults.Value) +{ + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); +} +``` + +[README]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/communication/Azure.Communication.Sms/README.md#getting-started diff --git a/sdk/communication/Azure.Communication.Sms/tests/Azure.Communication.Sms.Tests.csproj b/sdk/communication/Azure.Communication.Sms/tests/Azure.Communication.Sms.Tests.csproj index d6b080ed84a7..6e2dbb9335b2 100644 --- a/sdk/communication/Azure.Communication.Sms/tests/Azure.Communication.Sms.Tests.csproj +++ b/sdk/communication/Azure.Communication.Sms/tests/Azure.Communication.Sms.Tests.csproj @@ -16,6 +16,8 @@ + + diff --git a/sdk/communication/Azure.Communication.Sms/tests/samples/Sample2_OptOutsApi.cs b/sdk/communication/Azure.Communication.Sms/tests/samples/Sample2_OptOutsApi.cs new file mode 100644 index 000000000000..0c8bb7a5a5a0 --- /dev/null +++ b/sdk/communication/Azure.Communication.Sms/tests/samples/Sample2_OptOutsApi.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Communication.Sms.Tests.samples +{ + /// + /// Samples that are used in the README.md file. + /// + public partial class Sample2_OptOutsApi : SmsClientLiveTestBase + { + public Sample2_OptOutsApi(bool isAsync) : base(isAsync) + { + } + + [Test] + [AsyncOnly] + public async Task CheckOptOutAsync() + { + SmsClient smsClient = CreateSmsClient(); + #region Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_CheckAsync + var optOutCheckResults = await smsClient.OptOuts.CheckAsync( + //@@ from: "", // Your E.164 formatted from phone number used to send SMS + //@@ to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + /*@@*/ from: TestEnvironment.FromPhoneNumber, + /*@@*/ to: new string[] { TestEnvironment.ToPhoneNumber, TestEnvironment.ToPhoneNumber }); + foreach (var result in optOutCheckResults.Value) + { + Console.WriteLine($"{result.To}: {result.IsOptedOut}"); + } + #endregion Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_CheckAsync + } + + [Test] + [AsyncOnly] + public async Task AddOptOutAsync() + { + SmsClient smsClient = CreateSmsClient(); + #region Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_AddAsync + var optOutAddResults = await smsClient.OptOuts.AddAsync( + //@@ from: "", // Your E.164 formatted from phone number used to send SMS + //@@ to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + /*@@*/ from: TestEnvironment.FromPhoneNumber, + /*@@*/ to: new string[] { TestEnvironment.ToPhoneNumber, TestEnvironment.ToPhoneNumber }); + foreach (var result in optOutAddResults.Value) + { + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); + } + #endregion Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_AddAsync + } + + [Test] + [AsyncOnly] + public async Task RemoveOptOutAsync() + { + SmsClient smsClient = CreateSmsClient(); + #region Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_RemoveAsync + var optOutRemoveResults = await smsClient.OptOuts.RemoveAsync( + //@@ from: "", // Your E.164 formatted from phone number used to send SMS + //@@ to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + /*@@*/ from: TestEnvironment.FromPhoneNumber, + /*@@*/ to: new string[] { TestEnvironment.ToPhoneNumber, TestEnvironment.ToPhoneNumber }); + + foreach (var result in optOutRemoveResults.Value) + { + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); + } + #endregion Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_RemoveAsync + } + + [Test] + [SyncOnly] + public void CheckOptOut() + { + SmsClient smsClient = CreateSmsClient(); + #region Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Check + var optOutCheckResults = smsClient.OptOuts.Check( + //@@ from: "", // Your E.164 formatted from phone number used to send SMS + //@@ to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + /*@@*/ from: TestEnvironment.FromPhoneNumber, + /*@@*/ to: new string[] { TestEnvironment.ToPhoneNumber, TestEnvironment.ToPhoneNumber }); + foreach (var result in optOutCheckResults.Value) + { + Console.WriteLine($"{result.To}: {result.IsOptedOut}"); + } + #endregion Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Check + } + + [Test] + [SyncOnly] + public void AddOptOut() + { + SmsClient smsClient = CreateSmsClient(); + #region Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Add + var optOutAddResults = smsClient.OptOuts.Add( + //@@ from: "", // Your E.164 formatted from phone number used to send SMS + //@@ to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + /*@@*/ from: TestEnvironment.FromPhoneNumber, + /*@@*/ to: new string[] { TestEnvironment.ToPhoneNumber, TestEnvironment.ToPhoneNumber }); + foreach (var result in optOutAddResults.Value) + { + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); + } + #endregion Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Add + } + + [Test] + [SyncOnly] + public void RemoveOptOut() + { + SmsClient smsClient = CreateSmsClient(); + #region Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Remove + var optOutRemoveResults = smsClient.OptOuts.Remove( + //@@ from: "", // Your E.164 formatted from phone number used to send SMS + //@@ to: new string[] { "", "" }); // E.164 formatted recipient phone numbers + /*@@*/ from: TestEnvironment.FromPhoneNumber, + /*@@*/ to: new string[] { TestEnvironment.ToPhoneNumber, TestEnvironment.ToPhoneNumber }); + + foreach (var result in optOutRemoveResults.Value) + { + Console.WriteLine($"{result.To}: {result.HttpStatusCode}"); + } + #endregion Snippet:Azure_Communication_Sms_OptOuts_Tests_Samples_Remove + } + } +} diff --git a/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md b/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md index 4f326a2afa02..54d011c566d7 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md +++ b/sdk/communication/Azure.ResourceManager.Communication/CHANGELOG.md @@ -94,8 +94,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -151,7 +151,7 @@ Guidance to migrate from previous version of Azure Management SDK - Better error-handling - Support uniform telemetry across all languages -> NOTE: For more information about unified authentication, please refer to [Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet) +> NOTE: For more information about unified authentication, please refer to [Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) #### Management Client Changes @@ -238,4 +238,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/communication/Azure.ResourceManager.Communication/README.md b/sdk/communication/Azure.ResourceManager.Communication/README.md index 7e16f0c94eb9..aec3fc5dbf7e 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/README.md +++ b/sdk/communication/Azure.ResourceManager.Communication/README.md @@ -45,7 +45,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/communication/CONTRIBUTING.md b/sdk/communication/CONTRIBUTING.md index f2a86f839e45..0b9bea1c1d96 100644 --- a/sdk/communication/CONTRIBUTING.md +++ b/sdk/communication/CONTRIBUTING.md @@ -44,13 +44,13 @@ If you ran the tests in RECORD mode, you may have noticed that the files inside The most probable thing is that the managed identity tests will fail at first. This is because we haven't set up any managed identity credentials for the DefaultAzureCredential object inside the tests to reference to. There are multiple ways of creating a managed identity credential. -One of the easiest ways is to install the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli) and run the `az login` command. If you are listed as a contributor of the resource you are testing against, this should be enough for the DefaultAzureCredential object to get the corresponding Azure Active Directory credentials you need. +One of the easiest ways is to install the [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) and run the `az login` command. If you are listed as a contributor of the resource you are testing against, this should be enough for the DefaultAzureCredential object to get the corresponding Azure Active Directory credentials you need. Another way to authenticate is to set up 3 environment variables called `AZURE_CLIENT_ID`, `AZURE_TENANT_ID` and `AZURE_CLIENT_SECRET` and set their values to the ones from a registered Azure Active Directory application that is linked to the resource you are testing against. -If you are testing against a personal resource, you can check the [Managed Identity Quickstart Guide for ACS](https://docs.microsoft.com/azure/communication-services/quickstarts/managed-identity-from-cli) for an easy ramp-up process. +If you are testing against a personal resource, you can check the [Managed Identity Quickstart Guide for ACS](https://learn.microsoft.com/azure/communication-services/quickstarts/managed-identity-from-cli) for an easy ramp-up process. -For a more in-depth look on how to authenticate using managed identity, refer to the [Azure Identity client library for .Net](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) documentation. This document also has more ways for you to authenticate using the DefaultAzureCredential object besides the ones we discussed in this contributing file. +For a more in-depth look on how to authenticate using managed identity, refer to the [Azure Identity client library for .Net](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) documentation. This document also has more ways for you to authenticate using the DefaultAzureCredential object besides the ones we discussed in this contributing file. ## Submitting a Pull Request diff --git a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md index c7f11a10bb60..7b2a929e81a8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md +++ b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md @@ -1,20 +1,24 @@ # Release History -## 1.7.0-beta.2 (Unreleased) +## 1.7.0-beta.3 (Unreleased) ### Features Added -- Please use the properties in `VirtualMachineScaleSetData.Properties` to set the properties of the VMSS, instead of using those properties at the root level of `VirtualMachineScaleSetData` class. -- Please use the properties in `VirtualMachineScaleSetPatch.Properties` to set the properties of the VMSS, instead of using those properties at the root level of `VirtualMachineScaleSetPatch` class. -- Added `VirtualMachineScaleSetProperties` which supports `AdditionalProperties` to send and receive private/internal properties supported by the service. -- Added `AdditionalProperties` to `VirtualMachineSizeProperties` and `VirtualMachineScaleSetUpgradePolicy` classes to support private/internal properties supported by the service. - ### Breaking Changes ### Bugs Fixed ### Other Changes +## 1.7.0-beta.2 (2024-12-11) + +### Features Added + +- Please use the properties in `VirtualMachineScaleSetData.Properties` to set the properties of the VMSS, instead of using those properties at the root level of `VirtualMachineScaleSetData` class. +- Please use the properties in `VirtualMachineScaleSetPatch.Properties` to set the properties of the VMSS, instead of using those properties at the root level of `VirtualMachineScaleSetPatch` class. +- Added `VirtualMachineScaleSetProperties` which supports `AdditionalProperties` to send and receive private/internal properties supported by the service. +- Added `AdditionalProperties` to `VirtualMachineSizeProperties` and `VirtualMachineScaleSetUpgradePolicy` classes to support private/internal properties supported by the service. + ## 1.7.0-beta.1 (2024-10-15) ### Features Added @@ -174,8 +178,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -300,7 +304,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). #### Package Name The package name has been changed from `Microsoft.Azure.Management.Compute` to `Azure.ResourceManager.Compute` diff --git a/sdk/compute/Azure.ResourceManager.Compute/README.md b/sdk/compute/Azure.ResourceManager.Compute/README.md index 414a3200f8c4..6a7996820cdb 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/README.md +++ b/sdk/compute/Azure.ResourceManager.Compute/README.md @@ -41,7 +41,7 @@ using Azure.ResourceManager; ArmClient armClient = new ArmClient(new DefaultAzureCredential()); ``` -More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). +More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). ## Key concepts diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj index 18a8be4c9130..63e4f097b0ea 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj @@ -1,6 +1,6 @@ - 1.7.0-beta.2 + 1.7.0-beta.3 1.6.0 Azure.ResourceManager.Compute diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md index 820a145f9944..3a966066fb3e 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md @@ -38,4 +38,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md index b48223d63531..afdca804f2ba 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml index cc8c7e98498b..33e2a8ab89cd 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: 0410d404c68289cb1737d06bba92133bb84b515c +commit: 7e22a66617633d162735fe65388c2852127b4aac repo: Azure/azure-rest-api-specs diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md index fa4ffbc1f13f..1dc36807e956 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/README.md b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/README.md index c18931aa3ee0..82664dfee4a0 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/README.md +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/README.md @@ -47,7 +47,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/CHANGELOG.md b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/CHANGELOG.md index 467f9ea1c9d4..5306f1a6d421 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/CHANGELOG.md +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/CHANGELOG.md @@ -98,4 +98,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/README.md b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/README.md index 556660cf1f16..c315710605cb 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/README.md +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml index d09cd781ce46..e2de52411628 100644 --- a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml +++ b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml @@ -1,4 +1,4 @@ -commit: 0410d404c68289cb1737d06bba92133bb84b515c +commit: 7e22a66617633d162735fe65388c2852127b4aac repo: Azure/azure-rest-api-specs directory: specification/confidentialledger/Microsoft.CodeTransparency additionalDirectories: [] diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md index b9c8b712cdc9..c7aeb5614685 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/README.md @@ -386,11 +386,11 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide [client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/confidentialledger/Azure.Security.ConfidentialLedger [client_nuget_package]: https://www.nuget.org/packages?q=Azure.Security.ConfidentialLedger -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_cloud_shell]: https://shell.azure.com/bash [azure_confidential_computing]: https://azure.microsoft.com/solutions/confidential-compute [client_construction_sample]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/confidentialledger/Azure.Security.ConfidentialLedger/tests/samples/CertificateServiceSample.md diff --git a/sdk/confluent/Azure.ResourceManager.Confluent/CHANGELOG.md b/sdk/confluent/Azure.ResourceManager.Confluent/CHANGELOG.md index 84d51ac53ebd..b4df9dfcbe5b 100644 --- a/sdk/confluent/Azure.ResourceManager.Confluent/CHANGELOG.md +++ b/sdk/confluent/Azure.ResourceManager.Confluent/CHANGELOG.md @@ -90,4 +90,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/confluent/Azure.ResourceManager.Confluent/README.md b/sdk/confluent/Azure.ResourceManager.Confluent/README.md index aac62c7e89fe..124e4ea34655 100644 --- a/sdk/confluent/Azure.ResourceManager.Confluent/README.md +++ b/sdk/confluent/Azure.ResourceManager.Confluent/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/CHANGELOG.md b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/CHANGELOG.md index 66c3e0d1ba8b..6879509a530c 100644 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/CHANGELOG.md +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/CHANGELOG.md @@ -114,4 +114,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/README.md b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/README.md index 67ba1851d8a4..4f79b888abe3 100644 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/README.md +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/CHANGELOG.md b/sdk/consumption/Azure.ResourceManager.Consumption/CHANGELOG.md index cae8b73cb5e9..22bcad8f403d 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/CHANGELOG.md +++ b/sdk/consumption/Azure.ResourceManager.Consumption/CHANGELOG.md @@ -83,4 +83,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/README.md b/sdk/consumption/Azure.ResourceManager.Consumption/README.md index 647033ca22fa..57f1cda840dd 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/README.md +++ b/sdk/consumption/Azure.ResourceManager.Consumption/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/CHANGELOG.md b/sdk/containerapps/Azure.ResourceManager.AppContainers/CHANGELOG.md index 070bdf65f7a6..4f8ed74c34e7 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/CHANGELOG.md +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/CHANGELOG.md @@ -168,4 +168,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/README.md b/sdk/containerapps/Azure.ResourceManager.AppContainers/README.md index 04f6bc678d38..f873f2fd2cdd 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/README.md +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/CHANGELOG.md b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/CHANGELOG.md index a320a64e8b3a..2d037eed9ab6 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/CHANGELOG.md +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/CHANGELOG.md @@ -115,8 +115,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -147,4 +147,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/README.md b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/README.md index 250ce600d7dd..541db01ae84a 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/README.md +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md index b29b9e2b5d29..6774006121be 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/CHANGELOG.md @@ -24,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md index fc43b515f672..8cd3d9cabff3 100644 --- a/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md +++ b/sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md index 5cc839482909..802f13271944 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md @@ -136,7 +136,7 @@ ### Features Added -- Added support for [anonymous pull access](https://docs.microsoft.com/azure/container-registry/anonymous-pull-access#configure-anonymous-pull-access) using the `ContainerRegistryBlobClient` +- Added support for [anonymous pull access](https://learn.microsoft.com/azure/container-registry/anonymous-pull-access#configure-anonymous-pull-access) using the `ContainerRegistryBlobClient` ## 1.1.0-beta.2 (2021-10-13) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md index 771206bb5495..81cf71037f54 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/README.md @@ -53,13 +53,13 @@ ContainerRegistryClient client = new ContainerRegistryClient(endpoint, new Defau Please see the [Azure Identity README][identity] for more approaches to authenticating with `DefaultAzureCredential`, both locally and in deployment environments. To connect to registries in non-public Azure Clouds, see the samples below. -For more information on using AAD with Azure Container Registry, please see the service's [Authentication Overview](https://docs.microsoft.com/azure/container-registry/container-registry-authentication). +For more information on using AAD with Azure Container Registry, please see the service's [Authentication Overview](https://learn.microsoft.com/azure/container-registry/container-registry-authentication). ## Key concepts A **registry** stores Docker images and [OCI Artifacts](https://opencontainers.org/). An image or artifact consists of a **manifest** and **layers**. An image's manifest describes the layers that make up the image, and is uniquely identified by its **digest**. An image can also be "tagged" to give it a human-readable alias. An image or artifact can have zero or more **tags** associated with it, and each tag uniquely identifies the image. A collection of images that share the same name but have different tags, is referred to as a **repository**. -For more information please see [Container Registry Concepts](https://docs.microsoft.com/azure/container-registry/container-registry-concepts). +For more information please see [Container Registry Concepts](https://learn.microsoft.com/azure/container-registry/container-registry-concepts). ### Thread safety @@ -422,7 +422,7 @@ foreach (OciDescriptor layerInfo in manifest.Layers) #### Authenticate in a National Cloud -To authenticate with a registry in a [National Cloud](https://docs.microsoft.com/azure/active-directory/develop/authentication-national-cloud), you will need to make the following additions to your client configuration: +To authenticate with a registry in a [National Cloud](https://learn.microsoft.com/azure/active-directory/develop/authentication-national-cloud), you will need to make the following additions to your client configuration: - Set the `AuthorityHost` in the credential options or via the `AZURE_AUTHORITY_HOST` environment variable - Set the `Audience` in `ContainerRegistryClientOptions` @@ -451,7 +451,7 @@ See our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-net/tree/ - Go further with Azure.Containers.ContainerRegistry and our [samples][samples]. - Watch a [demo or deep dive video](https://azure.microsoft.com/resources/videos/index/?service=container-registry). -- Read more about the [Azure Container Registry service](https://docs.microsoft.com/azure/container-registry/container-registry-intro). +- Read more about the [Azure Container Registry service](https://learn.microsoft.com/azure/container-registry/container-registry-intro). ## Contributing @@ -470,16 +470,16 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/containerregistry/Azure.Containers.ContainerRegistry/src [package]: https://www.nuget.org/packages/Azure.Containers.ContainerRegistry/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.containers.containerregistry -[rest_docs]: https://docs.microsoft.com/rest/api/containerregistry/ -[product_docs]: https://docs.microsoft.com/azure/container-registry +[docs]: https://learn.microsoft.com/dotnet/api/azure.containers.containerregistry +[rest_docs]: https://learn.microsoft.com/rest/api/containerregistry/ +[product_docs]: https://learn.microsoft.com/azure/container-registry [nuget]: https://www.nuget.org/ -[container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro -[container_registry_create_ps]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-powershell -[container_registry_create_cli]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli -[container_registry_create_portal]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-portal -[container_registry_concepts]: https://docs.microsoft.com/azure/container-registry/container-registry-concepts -[azure_cli]: https://docs.microsoft.com/cli/azure +[container_registry_docs]: https://learn.microsoft.com/azure/container-registry/container-registry-intro +[container_registry_create_ps]: https://learn.microsoft.com/azure/container-registry/container-registry-get-started-powershell +[container_registry_create_cli]: https://learn.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli +[container_registry_create_portal]: https://learn.microsoft.com/azure/container-registry/container-registry-get-started-portal +[container_registry_concepts]: https://learn.microsoft.com/azure/container-registry/container-registry-concepts +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/TROUBLESHOOTING.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/TROUBLESHOOTING.md index 5c1970193ef2..cd0579aa1abb 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/TROUBLESHOOTING.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/TROUBLESHOOTING.md @@ -13,9 +13,9 @@ This troubleshooting guide contains instructions to diagnose frequently encounte ## General troubleshooting -All container registry service operations will throw a [RequestFailedException](https://docs.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet) on failure. +All container registry service operations will throw a [RequestFailedException](https://learn.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet) on failure. -When you interact with the library, errors returned by the service correspond to the same HTTP status codes returned for [REST API](https://docs.microsoft.com/rest/api/containerregistry/) requests. +When you interact with the library, errors returned by the service correspond to the same HTTP status codes returned for [REST API](https://learn.microsoft.com/rest/api/containerregistry/) requests. Here's an example of how to catch an exception using synchronous method @@ -63,9 +63,9 @@ catch (RequestFailedException ex) when (ex.Status == 404) To troubleshoot issues with the library, first enable logging to monitor the behavior of the application. The errors and warnings in the logs generally provide useful insights into what went wrong and sometimes include corrective actions to fix issues. -This library uses the standard [logging](https://docs.microsoft.com/dotnet/azure/sdk/logging) library. Basic information about HTTP sessions, such as URLs and headers, is logged at the `INFO` level. +This library uses the standard [logging](https://learn.microsoft.com/dotnet/azure/sdk/logging) library. Basic information about HTTP sessions, such as URLs and headers, is logged at the `INFO` level. -The simplest way to see the logs is to enable console logging. To create an Azure SDK log listener that outputs messages to the console, use the [AzureEventSourceListener.CreateConsoleLogger](https://docs.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener.createconsolelogger?view=azure-dotnet) method: +The simplest way to see the logs is to enable console logging. To create an Azure SDK log listener that outputs messages to the console, use the [AzureEventSourceListener.CreateConsoleLogger](https://learn.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener.createconsolelogger?view=azure-dotnet) method: ```csharp using Azure.Core.Diagnostics; @@ -120,7 +120,7 @@ To learn about other logging mechanisms, see [Azure SDK diagnostics](https://git ## Troubleshooting authentication issues -Azure Container Registry supports Azure Active Directory authentication. To provide a valid credential, you can use the `Azure.Identity` package. For more information on getting started, see the [Azure Container Registry library's README](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/containerregistry/Azure.Containers.ContainerRegistry#authenticate-the-client). For details on the credential types supported in `Azure.Identity`, see the [Azure Identity library's documentation](https://docs.microsoft.com/dotnet/api/overview/azure/Identity-readme). +Azure Container Registry supports Azure Active Directory authentication. To provide a valid credential, you can use the `Azure.Identity` package. For more information on getting started, see the [Azure Container Registry library's README](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/containerregistry/Azure.Containers.ContainerRegistry#authenticate-the-client). For details on the credential types supported in `Azure.Identity`, see the [Azure Identity library's documentation](https://learn.microsoft.com/dotnet/api/overview/azure/Identity-readme). Here are the authentication exceptions and ways to handle it: diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md index 11f5949af726..b2f2bdc4a8e6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/CHANGELOG.md @@ -132,5 +132,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/README.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/README.md index f99f92916849..f9900a742b67 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/README.md +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/CHANGELOG.md b/sdk/containerservice/Azure.ResourceManager.ContainerService/CHANGELOG.md index 8ea41cd2e759..e0872f5c90fc 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/CHANGELOG.md +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/CHANGELOG.md @@ -103,8 +103,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -135,4 +135,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/README.md b/sdk/containerservice/Azure.ResourceManager.ContainerService/README.md index d7e2c0ff7d16..15e4d981f216 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/README.md +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/README.md b/sdk/contentsafety/Azure.AI.ContentSafety/README.md index 2fe100c35a72..3d7f0a82bd56 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/README.md +++ b/sdk/contentsafety/Azure.AI.ContentSafety/README.md @@ -399,7 +399,7 @@ To learn more about other logging mechanisms see [Diagnostics Samples][logging]. ### Additional documentation -For more extensive documentation on Azure Content Safety, see the [Azure AI Content Safety][contentsafety_overview] on docs.microsoft.com. +For more extensive documentation on Azure Content Safety, see the [Azure AI Content Safety][contentsafety_overview] on learn.microsoft.com. ## Contributing @@ -413,8 +413,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_sub]: https://azure.microsoft.com/free/ [contentsafety_overview]: https://aka.ms/acs-doc [azure_portal]: https://ms.portal.azure.com/ -[azure_cli_endpoint_lookup]: https://docs.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show -[azure_cli_key_lookup]: https://docs.microsoft.com/cli/azure/cognitiveservices/account/keys?view=azure-cli-latest#az-cognitiveservices-account-keys-list +[azure_cli_endpoint_lookup]: https://learn.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show +[azure_cli_key_lookup]: https://learn.microsoft.com/cli/azure/cognitiveservices/account/keys?view=azure-cli-latest#az-cognitiveservices-account-keys-list [logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/README.md b/sdk/core/Azure.Core.Expressions.DataFactory/README.md index 8bf388edf432..2618d178a185 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/README.md +++ b/sdk/core/Azure.Core.Expressions.DataFactory/README.md @@ -117,6 +117,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src [package]: https://www.nuget.org/packages/Azure.Core/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.core +[docs]: https://learn.microsoft.com/dotnet/api/azure.core [code_of_conduct]: https://opensource.microsoft.com/codeofconduct [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/core/Azure.Core.TestFramework/README.md b/sdk/core/Azure.Core.TestFramework/README.md index aa18324f5b3a..7c888931fcc7 100644 --- a/sdk/core/Azure.Core.TestFramework/README.md +++ b/sdk/core/Azure.Core.TestFramework/README.md @@ -581,7 +581,7 @@ To download and unpack all artifacts use the `Download-DevOpsRecordings.ps1` scr The `Download-DevOpsRecordings.ps1` would wait for active runs to finish before retrieving artifacts unless `-NoWait` switch is used. -__NOTE:__ these scripts require being [signed in with Azure CLI](https://docs.microsoft.com/cli/azure/authenticate-azure-cli?view=azure-cli-latest) and access to the [internal DevOps project](https://dev.azure.com/azure-sdk/internal/). +__NOTE:__ these scripts require being [signed in with Azure CLI](https://learn.microsoft.com/cli/azure/authenticate-azure-cli?view=azure-cli-latest) and access to the [internal DevOps project](https://dev.azure.com/azure-sdk/internal/). ### Note on private/non-virtual fields in your clients (such as _clientDiagnostics) and InternalsVisibleTo @@ -647,7 +647,7 @@ using (var _ = new TestEnvVar("AZURE_TENANT_ID", "foo")) ### TestAppContextSwitch -[TestAppContextSwitch](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core.TestFramework/src/TestAppContextSwitch.cs) allows you to wrap a block of code with a using statement inside which the configured [AppContext](https://docs.microsoft.com/dotnet/api/system.appcontext) switch will be set to your supplied values. +[TestAppContextSwitch](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core.TestFramework/src/TestAppContextSwitch.cs) allows you to wrap a block of code with a using statement inside which the configured [AppContext](https://learn.microsoft.com/dotnet/api/system.appcontext) switch will be set to your supplied values. It ensures that the existing value of any configured switches are preserved before they are set them and restores them outside the scope of the using block. Note: Even if an `AppContext` switch was un-set prior to setting it via `TestAppContextSwitch`, it will be unset after leaving the scope of the using block. diff --git a/sdk/core/Azure.Core/README.md b/sdk/core/Azure.Core/README.md index b83bbbde336b..9e5a17696dcb 100644 --- a/sdk/core/Azure.Core/README.md +++ b/sdk/core/Azure.Core/README.md @@ -162,7 +162,7 @@ await foreach (SecretProperties secretProperties in allSecretProperties) } ``` -For more information on paged responses, see [Pagination with the Azure SDK for .NET](https://docs.microsoft.com/dotnet/azure/sdk/pagination). +For more information on paged responses, see [Pagination with the Azure SDK for .NET](https://learn.microsoft.com/dotnet/azure/sdk/pagination). ### Consuming Long-Running Operations Using `Operation` @@ -262,6 +262,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src [package]: https://www.nuget.org/packages/Azure.Core/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.core +[docs]: https://learn.microsoft.com/dotnet/api/azure.core [code_of_conduct]: https://opensource.microsoft.com/codeofconduct [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/core/Azure.Core/samples/Diagnostics.md b/sdk/core/Azure.Core/samples/Diagnostics.md index 81d604e0c6d7..2133956e369a 100644 --- a/sdk/core/Azure.Core/samples/Diagnostics.md +++ b/sdk/core/Azure.Core/samples/Diagnostics.md @@ -10,7 +10,7 @@ The Azure SDK libraries produce various log messages that include information ab 2. Authentication attempts 3. Retries -The simplest way to see the logs is to enable the console logging using the [`AzureEventSourceListener`](https://docs.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener?view=azure-dotnet). +The simplest way to see the logs is to enable the console logging using the [`AzureEventSourceListener`](https://learn.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener?view=azure-dotnet). ```C# Snippet:ConsoleLogging // Setup a listener to monitor logged events. @@ -41,7 +41,7 @@ using AzureEventSourceListener traceListener = AzureEventSourceListener.CreateTr ### Enabling content logging -By default only URI and headers are logged. To enable content logging, set the `Diagnostics.IsLoggingContentEnabled` client option: +By default only URI and headers are logged. To enable content logging, set the logging level to `EventLevel.Verbose` and set the `Diagnostics.IsLoggingContentEnabled` client option: ```C# Snippet:LoggingContent SecretClientOptions options = new SecretClientOptions() @@ -94,7 +94,7 @@ using AzureEventSourceListener listener = new AzureEventSourceListener( When targeting .NET Standard 2.1, .NET Core 2.2, or newer, you might instead use `args.TimeStamp` to log the time the event was written instead of rendered, like above. It's in UTC format, so if you want to log the local time like in the example call `ToLocaleTime()` first. For help diagnosing multi-threading issues, you might also log `args.OSThreadId` which is also available on those same targets. -More information about the `args` parameter for the callback can be found in the [EventWrittenEventArgs](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventwritteneventargs) documentation. +More information about the `args` parameter for the callback can be found in the [EventWrittenEventArgs](https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventwritteneventargs) documentation. ### Applying filtering logic diff --git a/sdk/core/Azure.Core/samples/Events.md b/sdk/core/Azure.Core/samples/Events.md index 4e578321f8bb..ea2bffcef2f0 100644 --- a/sdk/core/Azure.Core/samples/Events.md +++ b/sdk/core/Azure.Core/samples/Events.md @@ -90,11 +90,11 @@ client.Snooze(); If you need to call an async method from a synchronous event handler, you have two options: -- You can use [`Task.Run`](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task.run) +- You can use [`Task.Run`](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task.run) to queue a task for execution on the ThreadPool without waiting on it to complete. This "fire and forget" approach may not run before your handler finishes executing. Be sure to understand - [exception handling in the Task Parallel Library](https://docs.microsoft.com/dotnet/standard/parallel-programming/exception-handling-task-parallel-library) + [exception handling in the Task Parallel Library](https://learn.microsoft.com/dotnet/standard/parallel-programming/exception-handling-task-parallel-library) to avoid unhandled exceptions tearing down your process. - If you absolutely need the async method to execute before returning from your handler, you can call `myAsyncTask.GetAwaiter().GetResult()`. Please be aware @@ -150,11 +150,11 @@ await client.SnoozeAsync(); // async call that doesn't block ## Handling exceptions Any exceptions thrown by an event handler will be wrapped in a single -[`AggregateException`](https://docs.microsoft.com/dotnet/api/system.aggregateexception) and thrown from the code that raised the event. You can check the -[`AggregateException.InnerExceptions`](https://docs.microsoft.com/dotnet/api/system.aggregateexception.innerexceptions) +[`AggregateException`](https://learn.microsoft.com/dotnet/api/system.aggregateexception) and thrown from the code that raised the event. You can check the +[`AggregateException.InnerExceptions`](https://learn.microsoft.com/dotnet/api/system.aggregateexception.innerexceptions) property to see the original exceptions thrown by your event handlers. `AggregateException` also provides -[a number of helpful methods](https://docs.microsoft.com/archive/msdn-magazine/2009/brownfield/aggregating-exceptions) +[a number of helpful methods](https://learn.microsoft.com/archive/msdn-magazine/2009/brownfield/aggregating-exceptions) like `Flatten` and `Handle` to make complex failures easier to work with. ```C# Snippet:Azure_Core_Samples_EventSamples_Exceptions @@ -178,7 +178,7 @@ catch (AggregateException ex) Executing asynchronous code from a sync code path is commonly referred to as sync-over-async because you're getting sync behavior but still invoking all the async machinery. See -[Diagnosing .NET Core ThreadPool Starvation with PerfView](https://docs.microsoft.com/archive/blogs/vancem/diagnosing-net-core-threadpool-starvation-with-perfview-why-my-service-is-not-saturating-all-cores-or-seems-to-stall) +[Diagnosing .NET Core ThreadPool Starvation with PerfView](https://learn.microsoft.com/archive/blogs/vancem/diagnosing-net-core-threadpool-starvation-with-perfview-why-my-service-is-not-saturating-all-cores-or-seems-to-stall) for a detailed explanation of how that can cause serious performance problems. We recommend you use the `SyncAsyncEventArgs.IsRunningSynchronously` flag to avoid ThreadPool starvation. diff --git a/sdk/core/Azure.Core/samples/Response.md b/sdk/core/Azure.Core/samples/Response.md index e4390e25a1fa..c36e61f4243c 100644 --- a/sdk/core/Azure.Core/samples/Response.md +++ b/sdk/core/Azure.Core/samples/Response.md @@ -6,8 +6,8 @@ Most client methods return one of the following types: - `Response` - An HTTP response. - `Response` - A value and HTTP response. -- `Pageable` - A collection of values retrieved synchronously in pages. See [Pagination with the Azure SDK for .NET](https://docs.microsoft.com/dotnet/azure/sdk/pagination). -- `AsyncPageable` - A collection of values retrieved asynchronously in pages. See [Pagination with the Azure SDK for .NET](https://docs.microsoft.com/dotnet/azure/sdk/pagination). +- `Pageable` - A collection of values retrieved synchronously in pages. See [Pagination with the Azure SDK for .NET](https://learn.microsoft.com/dotnet/azure/sdk/pagination). +- `AsyncPageable` - A collection of values retrieved asynchronously in pages. See [Pagination with the Azure SDK for .NET](https://learn.microsoft.com/dotnet/azure/sdk/pagination). - `*Operation` - A long-running operation. See [long running operation samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md). ## Accessing HTTP response properties diff --git a/sdk/core/Microsoft.Azure.Core.Spatial/README.md b/sdk/core/Microsoft.Azure.Core.Spatial/README.md index b2139b0fba69..213b352363af 100644 --- a/sdk/core/Microsoft.Azure.Core.Spatial/README.md +++ b/sdk/core/Microsoft.Azure.Core.Spatial/README.md @@ -95,6 +95,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_search_documents_readme]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/README.md [code_of_conduct]: https://opensource.microsoft.com/codeofconduct [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[JsonSerializerOptions]: https://docs.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions +[JsonSerializerOptions]: https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions [microsoft_spatial_package]: https://www.nuget.org/packages/Microsoft.Spatial/ [NuGet]: https://www.nuget.org diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md index 4077be7b1203..bbb69b2de683 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md @@ -168,8 +168,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -250,4 +250,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/README.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/README.md index 81641f9be9ca..dfd6458df873 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/README.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/CHANGELOG.md b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/CHANGELOG.md index 6a79cdea2509..bb3194f50fb9 100644 --- a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/CHANGELOG.md +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/CHANGELOG.md @@ -36,8 +36,8 @@ This release is the first stable release of the CosmosDBForPostgreSql library. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). ## 1.0.0-beta.1 (2023-06-06) @@ -53,4 +53,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/README.md b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/README.md index c92595cc7236..79fec646b69c 100644 --- a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/README.md +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/costmanagement/Azure.ResourceManager.CostManagement/CHANGELOG.md b/sdk/costmanagement/Azure.ResourceManager.CostManagement/CHANGELOG.md index cbd33a75a0d3..0cfca7ed200d 100644 --- a/sdk/costmanagement/Azure.ResourceManager.CostManagement/CHANGELOG.md +++ b/sdk/costmanagement/Azure.ResourceManager.CostManagement/CHANGELOG.md @@ -37,8 +37,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -57,4 +57,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/costmanagement/Azure.ResourceManager.CostManagement/README.md b/sdk/costmanagement/Azure.ResourceManager.CostManagement/README.md index 45ed92b27d2e..c303822dd1d3 100644 --- a/sdk/costmanagement/Azure.ResourceManager.CostManagement/README.md +++ b/sdk/costmanagement/Azure.ResourceManager.CostManagement/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/CHANGELOG.md b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/CHANGELOG.md index 8359a9ab9d80..0c3b031725dd 100644 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/CHANGELOG.md +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/CHANGELOG.md @@ -67,5 +67,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/README.md b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/README.md index 2d905d1d7cf1..7ac5be5dde62 100644 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/README.md +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/databox/Azure.ResourceManager.DataBox/CHANGELOG.md b/sdk/databox/Azure.ResourceManager.DataBox/CHANGELOG.md index 8c8a986d8f2a..1617fee8e36d 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/CHANGELOG.md +++ b/sdk/databox/Azure.ResourceManager.DataBox/CHANGELOG.md @@ -57,7 +57,7 @@ Polishing since last public beta release: - Corrected the format of all `Guid` type properties / parameters. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Optimized the name of some models and functions. @@ -88,4 +88,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/databox/Azure.ResourceManager.DataBox/README.md b/sdk/databox/Azure.ResourceManager.DataBox/README.md index bd6038a8e912..54191be5736d 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/README.md +++ b/sdk/databox/Azure.ResourceManager.DataBox/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/CHANGELOG.md b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/CHANGELOG.md index c0ff56319e50..56b256177e2a 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/CHANGELOG.md +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/CHANGELOG.md @@ -53,7 +53,7 @@ Polishing since last public beta release: - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `IPAddress` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -85,5 +85,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/README.md b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/README.md index 18cc2b27047c..3b65296a27ef 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/README.md +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/CHANGELOG.md b/sdk/datadog/Azure.ResourceManager.Datadog/CHANGELOG.md index dfcf62f24957..730898f425c2 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/CHANGELOG.md +++ b/sdk/datadog/Azure.ResourceManager.Datadog/CHANGELOG.md @@ -67,5 +67,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/README.md b/sdk/datadog/Azure.ResourceManager.Datadog/README.md index 9916b8c7ff1b..464c5f3395cc 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/README.md +++ b/sdk/datadog/Azure.ResourceManager.Datadog/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md b/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md index 620b9456537f..9f07d6dc0fe4 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md @@ -157,8 +157,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -189,4 +189,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/README.md b/sdk/datafactory/Azure.ResourceManager.DataFactory/README.md index 9322c8ea00b8..b67bbdd57e8a 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/README.md +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/CHANGELOG.md b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/CHANGELOG.md index 8be74b394ebc..e3da9549f845 100644 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/CHANGELOG.md +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/CHANGELOG.md @@ -91,4 +91,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/README.md b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/README.md index fd8a5f7f80aa..0096a7fa2469 100644 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/README.md +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/CHANGELOG.md b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/CHANGELOG.md index 1156d7b85667..e0762f54ad55 100644 --- a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/CHANGELOG.md +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/CHANGELOG.md @@ -89,4 +89,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/README.md b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/README.md index 81a2e2958dcb..57c7f7aecaa5 100644 --- a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/README.md +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/CHANGELOG.md b/sdk/datamigration/Azure.ResourceManager.DataMigration/CHANGELOG.md index 89c95e7fbf84..7eeece346369 100644 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/CHANGELOG.md +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/CHANGELOG.md @@ -67,4 +67,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/README.md b/sdk/datamigration/Azure.ResourceManager.DataMigration/README.md index a41a8f9b5144..e6f9cf555f91 100644 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/README.md +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md index 517c9505bf7c..b5c078c5ab78 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md @@ -10,6 +10,8 @@ ### Bugs Fixed +Convert properties of type Uri to type string in DataProtectionIdentityDetails. Issue at https://github.com/Azure/azure-sdk-for-net/issues/47031 + ### Other Changes ## 1.5.0 (2024-06-17) @@ -121,7 +123,7 @@ Polishing since last public beta release: - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `ResouceType` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Optimized the name of some models and functions. @@ -151,4 +153,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/README.md b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/README.md index 960ae8c64abc..f27245d52834 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/README.md +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs index 828f8bc0fb38..a86a5cac951a 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.net8.0.cs @@ -1986,7 +1986,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class DataProtectionIdentityDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DataProtectionIdentityDetails() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This property has been replaced by UserAssignedIdentityArmUriString", false)] public System.Uri UserAssignedIdentityArmUri { get { throw null; } set { } } + public string UserAssignedIdentityArmUriString { get { throw null; } set { } } public bool? UseSystemAssignedIdentity { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs index 828f8bc0fb38..a86a5cac951a 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs @@ -1986,7 +1986,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class DataProtectionIdentityDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DataProtectionIdentityDetails() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This property has been replaced by UserAssignedIdentityArmUriString", false)] public System.Uri UserAssignedIdentityArmUri { get { throw null; } set { } } + public string UserAssignedIdentityArmUriString { get { throw null; } set { } } public bool? UseSystemAssignedIdentity { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionIdentityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs new file mode 100644 index 000000000000..23416225309e --- /dev/null +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Customized/Models/DataProtectionIdentityDetails.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DataProtectionBackup.Models +{ + public partial class DataProtectionIdentityDetails + { + /// + /// ARM URL for User Assigned Identity. + /// + [EditorBrowsableAttribute(EditorBrowsableState.Never)] + [ObsoleteAttribute("This property has been replaced by UserAssignedIdentityArmUriString", false)] + public Uri UserAssignedIdentityArmUri + { + get => string.IsNullOrEmpty(UserAssignedIdentityArmUriString) ? null : new Uri(UserAssignedIdentityArmUriString); + set => UserAssignedIdentityArmUriString = value?.AbsoluteUri; + } + } +} diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs index 005b0f5cebdf..a35aaa0b8b39 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.Serialization.cs @@ -39,10 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("useSystemAssignedIdentity"u8); writer.WriteBooleanValue(UseSystemAssignedIdentity.Value); } - if (Optional.IsDefined(UserAssignedIdentityArmUri)) + if (Optional.IsDefined(UserAssignedIdentityArmUriString)) { writer.WritePropertyName("userAssignedIdentityArmUrl"u8); - writer.WriteStringValue(UserAssignedIdentityArmUri.AbsoluteUri); + writer.WriteStringValue(UserAssignedIdentityArmUriString); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -82,7 +82,7 @@ internal static DataProtectionIdentityDetails DeserializeDataProtectionIdentityD return null; } bool? useSystemAssignedIdentity = default; - Uri userAssignedIdentityArmUrl = default; + string userAssignedIdentityArmUrl = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,11 +98,7 @@ internal static DataProtectionIdentityDetails DeserializeDataProtectionIdentityD } if (property.NameEquals("userAssignedIdentityArmUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - userAssignedIdentityArmUrl = new Uri(property.Value.GetString()); + userAssignedIdentityArmUrl = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs index 899299fa419e..b6dbda574cfc 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataProtectionIdentityDetails.cs @@ -52,18 +52,18 @@ public DataProtectionIdentityDetails() /// Initializes a new instance of . /// Specifies if the BI is protected by System Identity. - /// ARM URL for User Assigned Identity. + /// ARM URL for User Assigned Identity. /// Keeps track of any properties unknown to the library. - internal DataProtectionIdentityDetails(bool? useSystemAssignedIdentity, Uri userAssignedIdentityArmUri, IDictionary serializedAdditionalRawData) + internal DataProtectionIdentityDetails(bool? useSystemAssignedIdentity, string userAssignedIdentityArmUriString, IDictionary serializedAdditionalRawData) { UseSystemAssignedIdentity = useSystemAssignedIdentity; - UserAssignedIdentityArmUri = userAssignedIdentityArmUri; + UserAssignedIdentityArmUriString = userAssignedIdentityArmUriString; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Specifies if the BI is protected by System Identity. public bool? UseSystemAssignedIdentity { get; set; } /// ARM URL for User Assigned Identity. - public Uri UserAssignedIdentityArmUri { get; set; } + public string UserAssignedIdentityArmUriString { get; set; } } } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md index 96de46e2826b..eddd616ba0fb 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md @@ -17,7 +17,7 @@ modelerfour: flatten-payloads: false use-model-reader-writer: true -#mgmt-debug: +# mgmt-debug: # show-serialized-names: true format-by-name-rules: @@ -257,6 +257,7 @@ rename-mapping: SecureScoreLevel: BackupVaultSecureScoreLevel FeatureSettings: BackupVaultFeatureSettings IdentityDetails: DataProtectionIdentityDetails + IdentityDetails.userAssignedIdentityArmUrl: UserAssignedIdentityArmUriString NamespacedNameResource: NamespacedName CrossRegionRestoreDetails.sourceBackupInstanceId : -|arm-id CrossRegionRestoreDetails.sourceRegion : -|azure-location diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/CHANGELOG.md b/sdk/datashare/Azure.ResourceManager.DataShare/CHANGELOG.md index 6ab06f634368..1ab5793766c3 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/CHANGELOG.md +++ b/sdk/datashare/Azure.ResourceManager.DataShare/CHANGELOG.md @@ -83,4 +83,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/README.md b/sdk/datashare/Azure.ResourceManager.DataShare/README.md index 58bc86a47ff8..c160802c9782 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/README.md +++ b/sdk/datashare/Azure.ResourceManager.DataShare/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/CHANGELOG.md b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/CHANGELOG.md index e37587da0582..767c166f233d 100644 --- a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/CHANGELOG.md +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/README.md b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/README.md index 2d847925a295..c3d7f8edfedf 100644 --- a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/README.md +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/CHANGELOG.md b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/CHANGELOG.md index 86f970904d67..8fab88142432 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/CHANGELOG.md +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/CHANGELOG.md @@ -81,7 +81,7 @@ Polishing since last public beta release: - Prepended `DesktopVirtualization` prefix to all single / simple model names. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Optimized the name of some models and functions. - Replaced the model `ResourceModelWithAllowedPropertySetIdentity` with `Azure.ResourceManager.Models.ManagedServiceIdentit`. @@ -105,4 +105,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/README.md b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/README.md index 9e5140c6d6c3..9e34936c3cc4 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/README.md +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/devcenter/Azure.Developer.DevCenter/README.md b/sdk/devcenter/Azure.Developer.DevCenter/README.md index 3e833763c658..dd689c924d87 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/README.md +++ b/sdk/devcenter/Azure.Developer.DevCenter/README.md @@ -6,7 +6,7 @@ Use the client library for Azure DevCenter to: > Create, access, manage, and delete [Dev Box](https://learn.microsoft.com/azure/dev-box) resources > Create, deploy, manage, and delete [Environment](https://learn.microsoft.com/azure/deployment-environments) resources - [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/devcenter/Azure.Developer.DevCenter/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) + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/devcenter/Azure.Developer.DevCenter/src) | [Package (NuGet)](https://www.nuget.org/packages/) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://learn.microsoft.com/azure) ## Getting started @@ -20,7 +20,7 @@ dotnet add package Azure.Developer.DevCenter --prerelease ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). 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`. +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). 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://learn.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`. You must have [configured](https://learn.microsoft.com/azure/dev-box/quickstart-configure-dev-box-service) a DevCenter, Project, Network Connection, Dev Box Definition, and Pool before you can create Dev Boxes @@ -257,7 +257,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azdevcenter_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/devcenter/CONTRIBUTING.md -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/devcenter/Azure.Developer.DevCenter/samples/README.md b/sdk/devcenter/Azure.Developer.DevCenter/samples/README.md index bd8cb08afa25..fe9115bba697 100644 --- a/sdk/devcenter/Azure.Developer.DevCenter/samples/README.md +++ b/sdk/devcenter/Azure.Developer.DevCenter/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.Developer.DevCenter samples for .NET description: Samples for the Azure.Developer.DevCenter client library. diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/CHANGELOG.md b/sdk/devcenter/Azure.ResourceManager.DevCenter/CHANGELOG.md index 5be2b2a04801..3b27a5a11655 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/CHANGELOG.md +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/CHANGELOG.md @@ -66,5 +66,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/README.md b/sdk/devcenter/Azure.ResourceManager.DevCenter/README.md index b189df6f06f4..b4114a5544ab 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/README.md +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/README.md @@ -42,7 +42,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/CHANGELOG.md b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/CHANGELOG.md index 899f56cdebfb..19504f07b4cf 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/CHANGELOG.md +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/CHANGELOG.md @@ -84,6 +84,6 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/README.md b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/README.md index b7cc3c55029e..45f7b78ceefd 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/README.md +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md index d40512886119..aef164a59671 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/CHANGELOG.md @@ -26,4 +26,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md index 0fac2476684d..5dce3a96b839 100644 --- a/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md +++ b/sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/deviceupdate/Azure.IoT.DeviceUpdate/README.md b/sdk/deviceupdate/Azure.IoT.DeviceUpdate/README.md index 0b09fcc6d42c..678185ee9e89 100644 --- a/sdk/deviceupdate/Azure.IoT.DeviceUpdate/README.md +++ b/sdk/deviceupdate/Azure.IoT.DeviceUpdate/README.md @@ -2,7 +2,7 @@ The library provides access to the Device Update for IoT Hub service that enables customers to publish updates for their IoT devices to the cloud, and then deploy these updates to their devices (approve updates to groups of devices managed and provisioned in IoT Hub). - [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/deviceupdate/Azure.IoT.DeviceUpdate/src) | [Package](https://www.nuget.org) | [Product documentation](https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update) + [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/deviceupdate/Azure.IoT.DeviceUpdate/src) | [Package](https://www.nuget.org) | [Product documentation](https://learn.microsoft.com/azure/iot-hub-device-update/understand-device-update) ## Getting started @@ -27,7 +27,7 @@ dotnet add package Azure.IoT.DeviceUpdate ### Authenticate the Client -In order to interact with the Device Update for IoT Hub service, you will need to create an instance of a [TokenCredential class](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet) and pass it to the constructor of your DeviceUpdateClient and DeviceManagementClient class. +In order to interact with the Device Update for IoT Hub service, you will need to create an instance of a [TokenCredential class](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet) and pass it to the constructor of your DeviceUpdateClient and DeviceManagementClient class. ## Key concepts @@ -45,7 +45,7 @@ You can familiarize yourself with different APIs using [Samples](https://github. All Device Update for IoT Hub service operations will throw a RequestFailedException on failure with helpful ErrorCodes. -For example, if you use the `GetUpdateAsync` operation and the model you are looking for doesn't exist, you can catch that specific [HttpStatusCode](https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1) to decide the operation that follows in that case. +For example, if you use the `GetUpdateAsync` operation and the model you are looking for doesn't exist, you can catch that specific [HttpStatusCode](https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1) to decide the operation that follows in that case. ```csharp try diff --git a/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdate.md b/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdate.md index 95d66f6aaa15..35c82ba9f8d6 100644 --- a/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdate.md +++ b/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdate.md @@ -6,7 +6,7 @@ This sample demonstrates using `DeviceUpdateClient` class in this library to imp Let's assume you have device update (provided by device builder) and you want to import it into your Device Update for IoT Hub instance. For device update to be importable you need not only the actual payload file but also the corresponding import manifest document. -See [Import-Concepts](https://docs.microsoft.com/azure/iot-hub-device-update/import-concepts) for details about import manifest. +See [Import-Concepts](https://learn.microsoft.com/azure/iot-hub-device-update/import-concepts) for details about import manifest. For the sample below, use proper `account-id` and `instance-id`. You can find the right value in Azure Portal. diff --git a/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdateAsync.md b/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdateAsync.md index 17bd5568004e..14e0e79c07e5 100644 --- a/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdateAsync.md +++ b/sdk/deviceupdate/Azure.IoT.DeviceUpdate/samples/Sample3_ImportUpdateAsync.md @@ -6,7 +6,7 @@ This sample demonstrates using `DeviceUpdateClient` class in this library to imp Let's assume you have device update (provided by device builder) and you want to import it into your Device Update for IoT Hub instance. For device update to be importable you need not only the actual payload file but also the corresponding import manifest document. -See [Import-Concepts](https://docs.microsoft.com/azure/iot-hub-device-update/import-concepts) for details about import manifest. +See [Import-Concepts](https://learn.microsoft.com/azure/iot-hub-device-update/import-concepts) for details about import manifest. For the sample below, you can set `accountEndpoint` and `instance` in an environment variable. diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/CHANGELOG.md b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/CHANGELOG.md index d27d0f87cf45..c904ccde83ee 100644 --- a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/CHANGELOG.md +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/CHANGELOG.md @@ -120,4 +120,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/README.md b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/README.md index 34a11cf559d5..c2d832c23d91 100644 --- a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/README.md +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/CHANGELOG.md b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/CHANGELOG.md index aefd9f49d324..349d2c4c4ca5 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/CHANGELOG.md +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/CHANGELOG.md @@ -24,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/README.md b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/README.md index d9f7e6ea0efd..5829529fe688 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/README.md +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/devspaces/Azure.ResourceManager.DevSpaces/CHANGELOG.md b/sdk/devspaces/Azure.ResourceManager.DevSpaces/CHANGELOG.md index 7a26807d41b3..f46cd2092a9a 100644 --- a/sdk/devspaces/Azure.ResourceManager.DevSpaces/CHANGELOG.md +++ b/sdk/devspaces/Azure.ResourceManager.DevSpaces/CHANGELOG.md @@ -67,4 +67,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/devspaces/Azure.ResourceManager.DevSpaces/README.md b/sdk/devspaces/Azure.ResourceManager.DevSpaces/README.md index 0b45f2486997..5bca5a0c82ff 100644 --- a/sdk/devspaces/Azure.ResourceManager.DevSpaces/README.md +++ b/sdk/devspaces/Azure.ResourceManager.DevSpaces/README.md @@ -40,7 +40,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/CHANGELOG.md b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/CHANGELOG.md index b4c6c5d21316..f142f6e4af15 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/CHANGELOG.md +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/CHANGELOG.md @@ -51,7 +51,7 @@ Polishing since last public beta release: - Prepended `DevTestLab` prefix to all single / simple model names. - Corrected the format of all `Guid` type properties / parameters. - Corrected the format of all `ResourceIdentifier` type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Optimized the name of some models and functions. ### Other Changes @@ -81,5 +81,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md index 02b8f70a9626..89e0f16144c5 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/digitaltwins/Azure.DigitalTwins.Core/README.md b/sdk/digitaltwins/Azure.DigitalTwins.Core/README.md index 4fb9c8d2c2a6..dabc68e89f4e 100644 --- a/sdk/digitaltwins/Azure.DigitalTwins.Core/README.md +++ b/sdk/digitaltwins/Azure.DigitalTwins.Core/README.md @@ -136,7 +136,7 @@ For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or conta [microsoft_sdk_download]: https://azure.microsoft.com/downloads/?sdk=net [azure_sdk_target_frameworks]: https://github.com/azure/azure-sdk-for-net#target-frameworks -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/digitaltwins/Azure.DigitalTwins.Core/src [package]: https://www.nuget.org/packages/Azure.DigitalTwins.Core @@ -144,12 +144,12 @@ For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or conta [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [nuget]: https://www.nuget.org/ [azure_portal]: https://portal.azure.com/ -[azure_rest_api]: https://docs.microsoft.com/rest/api/azure/ +[azure_rest_api]: https://learn.microsoft.com/rest/api/azure/ [azure_core_library]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core -[token_credential]: https://docs.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet +[token_credential]: https://learn.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet [digital_twins_client]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/digitaltwins/Azure.DigitalTwins.Core/src/DigitalTwinsClient.cs -[digital_twins_documentation]: https://docs.microsoft.com/azure/digital-twins/ +[digital_twins_documentation]: https://learn.microsoft.com/azure/digital-twins/ [iot_cli_extension]: https://github.com/Azure/azure-iot-cli-extension/releases -[iot_cli_doc]: https://docs.microsoft.com/cli/azure/azure-cli-reference-for-iot -[http_status_code]: https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1 +[iot_cli_doc]: https://learn.microsoft.com/cli/azure/azure-cli-reference-for-iot +[http_status_code]: https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1 [adt_nuget]: https://www.nuget.org/packages/Azure.DigitalTwins.Core diff --git a/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/Readme.md b/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/Readme.md index 5381ac738530..4d91c657b0a2 100644 --- a/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/Readme.md +++ b/sdk/digitaltwins/Azure.DigitalTwins.Core/samples/Readme.md @@ -1,8 +1,8 @@ # Introduction -Azure Digital Twins is a developer platform for next-generation IoT solutions that lets you create, run, and manage digital representations of your business environment, securely and efficiently in the cloud. With Azure Digital Twins, creating live operational state representations is quick and cost-effective, and digital representations stay current with real-time data from IoT and other data sources. If you are new to Azure Digital Twins and would like to learn more about the platform, please make sure you check out the Azure Digital Twins [official documentation page](https://docs.microsoft.com/azure/digital-twins/overview). +Azure Digital Twins is a developer platform for next-generation IoT solutions that lets you create, run, and manage digital representations of your business environment, securely and efficiently in the cloud. With Azure Digital Twins, creating live operational state representations is quick and cost-effective, and digital representations stay current with real-time data from IoT and other data sources. If you are new to Azure Digital Twins and would like to learn more about the platform, please make sure you check out the Azure Digital Twins [official documentation page](https://learn.microsoft.com/azure/digital-twins/overview). -For an introduction on how to program against the Azure Digital Twins service, visit the [coding tutorial page](https://docs.microsoft.com/azure/digital-twins/tutorial-code) for an easy step-by-step guide. Visit [this tutorial](https://docs.microsoft.com/azure/digital-twins/tutorial-command-line-app) to learn how to interact with an Azure Digital Twin instance using a command-line client application. Finally, for a quick guide on how to build an end-to-end Azure Digital Twins solution that is driven by live data from your environment, make sure you check out [this helpful guide](https://docs.microsoft.com/azure/digital-twins/tutorial-end-to-end). +For an introduction on how to program against the Azure Digital Twins service, visit the [coding tutorial page](https://learn.microsoft.com/azure/digital-twins/tutorial-code) for an easy step-by-step guide. Visit [this tutorial](https://learn.microsoft.com/azure/digital-twins/tutorial-command-line-app) to learn how to interact with an Azure Digital Twin instance using a command-line client application. Finally, for a quick guide on how to build an end-to-end Azure Digital Twins solution that is driven by live data from your environment, make sure you check out [this helpful guide](https://learn.microsoft.com/azure/digital-twins/tutorial-end-to-end). The guides mentioned above can help you get started with key elements of Azure Digital Twins, such as creating Azure Digital Twins instances, models, twin graphs, etc. Use this samples guide below to familiarize yourself with the various APIs that help you program against Azure Digital Twins. @@ -26,7 +26,7 @@ The samples project demonstrates the following: To create a new digital twins client, you need the endpoint to an Azure Digital Twin instance and credentials. In the sample below, you can set `AdtEndpoint`, `TenantId`, `ClientId`, and `ClientSecret` as command-line arguments. -The client requires an instance of [TokenCredential](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet). +The client requires an instance of [TokenCredential](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet). In this samples, we illustrate how to use one derived class: ClientSecretCredential. > Note: In order to access the data plane for the Digital Twins service, the entity must be given permissions. @@ -57,15 +57,15 @@ It provides an opportunity to override default behavior including: #### Object serializer The digital twins client has methods that will serialize your custom digital twins and relationship types for transport, and deserialize the response back to a type specified by you. -The default object serializer, [JsonObjectSerializer](https://docs.microsoft.com/dotnet/api/azure.core.serialization.jsonobjectserializer?view=azure-dotnet), +The default object serializer, [JsonObjectSerializer](https://learn.microsoft.com/dotnet/api/azure.core.serialization.jsonobjectserializer?view=azure-dotnet), works using the `System.Text.Json` library. -It uses a default [JsonSerializerOptions](https://docs.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions?view=net-5.0) instance. +It uses a default [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions?view=net-5.0) instance. Set the `Serializer` property to a custom instance of `JsonObjectSerializer` or your own implementation that inherits from -[ObjectSerializer](https://docs.microsoft.com/dotnet/api/azure.core.serialization.objectserializer?view=azure-dotnet). +[ObjectSerializer](https://learn.microsoft.com/dotnet/api/azure.core.serialization.objectserializer?view=azure-dotnet). One reason for customizing would be to provide custom de/serialization settings, for example setting the `IgnoreNullValues` property to `true`. -See more examples and options of working with `JsonSerializerOptions` [here](https://docs.microsoft.com/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-5-0#ignore-all-null-value-properties). +See more examples and options of working with `JsonSerializerOptions` [here](https://learn.microsoft.com/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-5-0#ignore-all-null-value-properties). This would prevent unset properties on your digital twin or relationship from being included in the payload sent to the service. ## Create, list, decommission, and delete models @@ -265,7 +265,7 @@ Console.WriteLine($"Retrieved and deserialized digital twin {customDt.Id}:\n\t" ### Query digital twins -Query the Azure Digital Twins instance for digital twins using the [Azure Digital Twins Query Store lanaguage](https://review.docs.microsoft.com/azure/digital-twins-v2/concepts-query-language?branch=pr-en-us-114648). Query calls support paging. Here's an example of how to query for digital twins and how to iterate over the results. +Query the Azure Digital Twins instance for digital twins using the [Azure Digital Twins Query Store lanaguage](https://review.learn.microsoft.com/azure/digital-twins-v2/concepts-query-language?branch=pr-en-us-114648). Query calls support paging. Here's an example of how to query for digital twins and how to iterate over the results. ```C# Snippet:DigitalTwinsSampleQueryTwins // This code snippet demonstrates the simplest way to iterate over the digital twin results, where paging diff --git a/sdk/digitaltwins/Azure.DigitalTwins.Core/tests/prerequisites/prerequisite readme.md b/sdk/digitaltwins/Azure.DigitalTwins.Core/tests/prerequisites/prerequisite readme.md index bb60c2914ec8..a119cdadd333 100644 --- a/sdk/digitaltwins/Azure.DigitalTwins.Core/tests/prerequisites/prerequisite readme.md +++ b/sdk/digitaltwins/Azure.DigitalTwins.Core/tests/prerequisites/prerequisite readme.md @@ -9,11 +9,11 @@ - If already installed, check latest version: - Run `az --version` to make sure `azure-cli` is at least **version 2.3.1** - If it isn't, update it -- Use this link to install [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) +- Use this link to install [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) ### Install Bicep -- Install using the instructions in [bicep](https://docs.microsoft.com/azure/azure-resource-manager/bicep/install#install-manually) +- Install using the instructions in [bicep](https://learn.microsoft.com/azure/azure-resource-manager/bicep/install#install-manually) - Note that to deploy Bicep files, use Bicep CLI version 0.4.1124 or later. To check your Bicep CLI version, run: ```bash diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/CHANGELOG.md b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/CHANGELOG.md index 1c6a929425bc..93dea56cdf2f 100644 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/CHANGELOG.md +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/CHANGELOG.md @@ -93,4 +93,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/README.md b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/README.md index df30b788404f..64718899943e 100644 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/README.md +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/dns/Azure.ResourceManager.Dns/CHANGELOG.md b/sdk/dns/Azure.ResourceManager.Dns/CHANGELOG.md index 71e1016ac0e6..b991187eb87b 100644 --- a/sdk/dns/Azure.ResourceManager.Dns/CHANGELOG.md +++ b/sdk/dns/Azure.ResourceManager.Dns/CHANGELOG.md @@ -94,8 +94,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. @@ -125,7 +125,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). ### Management Client Changes diff --git a/sdk/dns/Azure.ResourceManager.Dns/README.md b/sdk/dns/Azure.ResourceManager.Dns/README.md index be4991653de5..1026f3575adf 100644 --- a/sdk/dns/Azure.ResourceManager.Dns/README.md +++ b/sdk/dns/Azure.ResourceManager.Dns/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples @@ -100,7 +100,7 @@ await dnsZone.DeleteAsync(WaitUntil.Completed); - File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). - Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. -- If having trouble with authentication, go to [DefaultAzureCredential documentation](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). +- If having trouble with authentication, go to [DefaultAzureCredential documentation](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). ## Next steps diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/CHANGELOG.md b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/CHANGELOG.md index dc6d612a6068..a9f7d6260fa8 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/CHANGELOG.md +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/CHANGELOG.md @@ -111,4 +111,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/README.md b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/README.md index 1f1fdf7bc638..6003240bc874 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/README.md +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md index 4f0290cc0827..00e775543394 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/CHANGELOG.md @@ -1,17 +1,72 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.1.0-beta.1 (Unreleased) ### Features Added +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0 (2024-12-16) + +### Features Added +- Added methods `GetAnalyzeBatchResult`, `GetAnalyzeBatchResults`, `DeleteAnalyzeBatchResult`, and `DeleteAnalyzeResult` to `DocumentIntelligenceClient`. +- Added class `AnalyzeBatchOperationDetails` to be used as the output of the `GetAnalyzeBatchResult` and `GetAnalyzeBatchResults` APIs. +- Added overloads for the `AnalyzeDocument` API that take only required parameters. +- Added property `ModifiedOn` to `DocumentModelDetails` and to `DocumentClassifierDetails`. +- Added member `Skipped` to `DocumentIntelligenceOperationStatus` (former `OperationStatus`). - Exposed `JsonModelWriteCore` for model serialization procedure. ### Breaking Changes +- Replaced the following `Content` classes with new corresponding `Options` classes: + - `AnalyzeBatchDocumentsContent` to `AnalyzeBatchDocumentsOptions`. + - `AnalyzeDocumentContent` to `AnalyzeDocumentOptions`. + - `AuthorizeClassifierCopyContent` to `AuthorizeClassifierCopyOptions`. + - `AuthorizeCopyContent` to `AuthorizeModelCopyOptions`. + - `BuildDocumentClassifierContent` to `BuildClassifierOptions`. + - `BuildDocumentModelContent` to `BuildDocumentModelOptions`. + - `ClassifyDocumentContent` to `ClassifyDocumentOptions`. + - `ComposeDocumentModelContent` to `ComposeModelOptions`. + - Parameters of the `AnalyzeBatchDocuments`, `AnalyzeDocument`, and `ClassifyDocument` methods have been moved into their corresponding `Options` class. +- Updated parameter `resultId` of methods `GetAnalyzeResultPdf` and `GetAnalyzeResultFigure` to take a `string` instead of a `Guid`. +- Renamed all occurrences of property `UrlSource` to `UriSource`. +- Renamed all occurrences of properties `DocType` and `DocTypes` to `DocumentType` and `DocumentTypes`, respectively. +- In `DocumentField`, renamed properties `Type` and `ValueLong` to `FieldType` and `ValueInt64`, respectively. +- Renamed property `Type` to `FieldType` in `DocumentFieldSchema`. +- Renamed class `AzureBlobContentSource` to `BlobContentSource`. +- Renamed class `AzureBlobFileListContentSource` to `BlobFileListContentSource`. +- Renamed all occurrences of properties `AzureBlobSource` and `AzureBlobFileListSource` to `BlobSource` and `BlobFileListSource`, respectively. +- Renamed all occurrences of property `ContainerUrl` to `ContainerUri`. +- Renamed property `ResultContainerUrl` to `ResultContainerUri` in `AnalyzeBatchDocumentsContent`. +- Renamed class `AnalyzeBatchOperationDetail` to `AnalyzeBatchResultDetails`. +- In `AnalyzeBatchResultDetails` (former `AnalyzeBatchOperationDetail`), renamed properties `SourceUrl` and `ResultUrl` to `SourceUri` and `ResultUri`, respectively. +- Removed member `Generative` from `DocumentBuildMode`. +- Renamed member `StyleFonts` to `FontStyling` in `DocumentAnalysisFeature`. +- In `ContentSourceKind`, renamed members `Url`, `Base64`, `AzureBlob`, and `AzureBlobFileList` to `Uri`, `Bytes`, `Blob`, and `BlobFileList`, respectively. +- Renamed all occurrences of property `ExpirationDateTime` to `ExpiresOn`. +- Renamed method `GetResourceInfo` to `GetResourceDetails` in `DocumentIntelligenceAdministrationClient`. +- Renamed class `ResourceDetails` to `DocumentIntelligenceResourceDetails`. +- Renamed type `ContentFormat` to `DocumentContentFormat`. +- Renamed class `OperationDetails` to `DocumentIntelligenceOperationDetails`. +- Renamed class `InnerError` to `DocumentIntelligenceInnerError`. +- Renamed class `CopyAuthorization` to `ModelCopyAuthorization`. +- Renamed type `OperationStatus` to `DocumentIntelligenceOperationStatus`. +- Renamed property `Innererror` to `InnerError` in `DocumentIntelligenceError`. +- Renamed property `InnerErrorObject` to `InnerError` in `DocumentIntelligenceInnerError` (former class `InnerError`). +- Removed member `Completed` from `DocumentIntelligenceOperationStatus` (former `OperationStatus`). +- Removed type `StringIndexType`. +- Removed property `StringIndexType` in `AnalyzeResult`. +- Updated property `Fields` in `AnalyzedDocument` to be a `DocumentFieldDictionary` instead of an `IReadOnly`. +- Updated property `ValueDictionary` in `DocumentField` to be a `DocumentFieldDictionary` instead of an `IReadOnly`. +- Made type `BoundingRegion` a `struct`. +- Made type `DocumentSpan` a `struct`. ### Bugs Fixed - Fixed a bug where calling `Operation.Id` would sometimes return an `InvalidOperationException` with message "The operation ID was not present in the service response.". - -### Other Changes +- Calling `Operation.Id` in an operation returned from the `AnalyzeBatchDocuments` and `ClassifyDocument` APIs won't throw a `NotSupportedException` anymore. ## 1.0.0-beta.3 (2024-08-14) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/MigrationGuide.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/MigrationGuide.md index 7b3f614f2431..606e11f0cfda 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/MigrationGuide.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/MigrationGuide.md @@ -1,8 +1,8 @@ # Guide for migrating to Azure.AI.DocumentIntelligence from Azure.AI.FormRecognizer -This guide is intended to assist in the migration to `Azure.AI.DocumentIntelligence (1.0.0-beta.3)` from `Azure.AI.FormRecognizer (4.1.0 or 4.0.0)`. It will focus on side-by-side comparisons for similar operations between libraries. Please note that version `1.0.0-beta.3` will be used for comparison with `4.1.0`. +This guide is intended to assist in the migration to `Azure.AI.DocumentIntelligence (1.0.0)` from `Azure.AI.FormRecognizer (4.1.0 or 4.0.0)`. It will focus on side-by-side comparisons for similar operations between libraries. Please note that version `1.0.0` will be used for comparison with `4.1.0`. -Familiarity with the `Azure.AI.FormRecognizer` package is assumed. For those new to the Document Intelligence and the Form Recognizer client libraries for .NET, please refer to the [README][readme] rather than this guide. For an exhaustive list of breaking changes between the packages, see the [CHANGELOG][changelog]. +Familiarity with the `Azure.AI.FormRecognizer` package is assumed. For those new to the Document Intelligence and the Form Recognizer client libraries for .NET, please refer to the [README][readme] rather than this guide. ## Table of Contents - [Migration benefits](#migration-benefits) @@ -22,21 +22,22 @@ Familiarity with the `Azure.AI.FormRecognizer` package is assumed. For those new A natural question to ask when considering whether to adopt a new version of a library is what the benefits of doing so would be. As Azure Document Intelligence has matured and been embraced by a more diverse group of developers, we have been focused on learning the patterns and practices to best support developer productivity and add value to our customers. -There are many benefits to using the new `Azure.AI.DocumentIntelligence` library. This new library introduces two new clients: `DocumentIntelligenceClient` and `DocumentIntelligenceAdministrationClient`, providing support for the new features added by the service in API version `2024-07-31-preview` and higher. +There are many benefits to using the new `Azure.AI.DocumentIntelligence` library. This new library introduces two new clients: `DocumentIntelligenceClient` and `DocumentIntelligenceAdministrationClient`, providing support for the new features added by the service in API version `2024-11-30` and higher. New features provided by the `Azure.AI.DocumentIntelligence` library include: - **Markdown content format:** support to output with Markdown content format along with the default plain text. This is only supported for the "prebuilt-layout" model. Markdown content format is deemed a more friendly format for LLM consumption in a chat or automation use scenario. -- **Query fields:** query fields are reintroduced as a premium add-on feature. When the `DocumentAnalysisFeature.QueryFields` argument is passed to a document analysis request, the service will further extract the values of the fields specified via the parameter `queryFields` to supplement any existing fields defined by the model as fallback. -- **Split options:** in previous API versions, the document splitting and classification operation always tried to split the input file into multiple documents. To enable a wider set of scenarios, `ClassifyDocument` now supports a `split` parameter. The following values are supported: +- **Query fields:** query fields are reintroduced as a premium add-on feature. When the `DocumentAnalysisFeature.QueryFields` argument is passed to a document analysis request, the service will further extract the values of the fields specified via the option `QueryFields` to supplement any existing fields defined by the model as fallback. +- **Split options:** in previous API versions, the document splitting and classification operation always tried to split the input file into multiple documents. To enable a wider set of scenarios, `ClassifyDocument` now supports a `Split` option. The following values are supported: - `Auto`: let the service determine where to split. - `None`: the entire file is treated as a single document. No splitting is performed. - `PerPage`: each page is treated as a separate document. Each empty page is kept as its own document. +- **Batch analysis:** allows you to bulk process multiple documents using a single request. Rather than having to submit documents individually, you can analyze a collection of documents like invoices, a series of a loan documents, or a group of custom documents simultaneously. The table below describes the relationship of each client and its supported API version(s): Package|API version|Supported clients |-|-|- -|Azure.AI.DocumentIntelligence | 2024-07-31-preview | DocumentIntelligenceClient and DocumentIntelligenceAdministrationClient +|Azure.AI.DocumentIntelligence | 2024-11-30 | DocumentIntelligenceClient and DocumentIntelligenceAdministrationClient |Azure.AI.FormRecognizer |2023-07-31 | DocumentAnalysisClient and DocumentModelAdministrationClient |Azure.AI.FormRecognizer |2022-08-31 | DocumentAnalysisClient and DocumentModelAdministrationClient |Azure.AI.FormRecognizer |2.1 | FormRecognizerClient and FormTrainingClient @@ -57,10 +58,7 @@ Some terminology has changed to reflect the enhanced capabilities of the latest ### Client usage -We continue to support API key and AAD authentication methods when creating the clients. Below are the differences between the two versions: - -- In `Azure.AI.DocumentIntelligence`, we have `DocumentIntelligenceClient` and `DocumentIntelligenceAdministrationClient` which support API version `2024-07-31-preview` and higher. -- Some client methods have been renamed. See the [CHANGELOG][changelog] for an exhaustive list of changes. +In `Azure.AI.DocumentIntelligence`, we have `DocumentIntelligenceClient` and `DocumentIntelligenceAdministrationClient` which can only be used with API version `2024-11-30` and higher. We continue to support Microsoft Entra ID and API key authentication methods when creating the clients: Creating new clients in `Azure.AI.FormRecognizer`: ```C# @@ -83,10 +81,10 @@ var documentIntelligenceAdministrationClient = new DocumentIntelligenceAdministr ### Analyzing documents Differences between the versions: -- The former `AnalyzeDocument` method taking a `Stream` as the input document is still not supported in `Azure.AI.DocumentIntelligence` 1.0.0-beta.3. As a workaround you will need to use a URI input or the new Base64 input option, which is described later in this guide ([Analyzing and classifying documents from a stream](#analyzing-and-classifying-documents-from-a-stream)). -- `AnalyzeDocumentFromUri` has been renamed to `AnalyzeDocument` and its input arguments have been reorganized: - - The `documentUri` parameter has been removed. Instead, an `AnalyzeDocumentContent` object must be passed to the method to select the desired input type: URI or Base64 binary data. - - The `options` parameter has been removed. Instead, `pages`, `locale`, and `features` options can be passed directly as method parameters. +- The former `AnalyzeDocument` method taking a `Stream` as the input document is still not supported in `Azure.AI.DocumentIntelligence` 1.0.0. As a workaround you will need to use a URI input or the new binary data input option, which is described later in this guide ([Analyzing and classifying documents from a stream](#analyzing-and-classifying-documents-from-a-stream)). +- `AnalyzeDocumentFromUri` has been renamed to `AnalyzeDocument`. + - The `modelId` and the `documentUri` parameters have been moved into `AnalyzeDocumentOptions`, which is now required. The desired input type must be selected when creating the options object: URI or binary data. +- Overloads of `AnalyzeDocument` have been added to support simpler scenarios without creating an `AnalyzeDocumentOptions` object. - The property `DocumentField.Value` has been removed. A field's value can now be extracted from one of the its new value properties, depending on the type of the field: `ValueAddress` for type `Address`, `ValueBoolean` for type `Boolean`, and so on. Analyzing documents with `Azure.AI.FormRecognizer`: @@ -214,13 +212,7 @@ if (invoice.Fields.TryGetValue("InvoiceTotal", out FormField invoiceTotalField)) Analyzing documents with `Azure.AI.DocumentIntelligence`: ```C# Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelFromUriAsync Uri uriSource = new Uri(""); - -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", uriSource); AnalyzeResult result = operation.Value; // To see the list of all the supported fields returned by service and its corresponding types for the @@ -234,39 +226,39 @@ for (int i = 0; i < result.Documents.Count; i++) AnalyzedDocument document = result.Documents[i]; if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField) - && vendorNameField.Type == DocumentFieldType.String) + && vendorNameField.FieldType == DocumentFieldType.String) { string vendorName = vendorNameField.ValueString; Console.WriteLine($"Vendor Name: '{vendorName}', with confidence {vendorNameField.Confidence}"); } if (document.Fields.TryGetValue("CustomerName", out DocumentField customerNameField) - && customerNameField.Type == DocumentFieldType.String) + && customerNameField.FieldType == DocumentFieldType.String) { string customerName = customerNameField.ValueString; Console.WriteLine($"Customer Name: '{customerName}', with confidence {customerNameField.Confidence}"); } if (document.Fields.TryGetValue("Items", out DocumentField itemsField) - && itemsField.Type == DocumentFieldType.List) + && itemsField.FieldType == DocumentFieldType.List) { foreach (DocumentField itemField in itemsField.ValueList) { Console.WriteLine("Item:"); - if (itemField.Type == DocumentFieldType.Dictionary) + if (itemField.FieldType == DocumentFieldType.Dictionary) { IReadOnlyDictionary itemFields = itemField.ValueDictionary; if (itemFields.TryGetValue("Description", out DocumentField itemDescriptionField) - && itemDescriptionField.Type == DocumentFieldType.String) + && itemDescriptionField.FieldType == DocumentFieldType.String) { string itemDescription = itemDescriptionField.ValueString; Console.WriteLine($" Description: '{itemDescription}', with confidence {itemDescriptionField.Confidence}"); } if (itemFields.TryGetValue("Amount", out DocumentField itemAmountField) - && itemAmountField.Type == DocumentFieldType.Currency) + && itemAmountField.FieldType == DocumentFieldType.Currency) { CurrencyValue itemAmount = itemAmountField.ValueCurrency; Console.WriteLine($" Amount: '{itemAmount.CurrencySymbol}{itemAmount.Amount}', with confidence {itemAmountField.Confidence}"); @@ -276,21 +268,21 @@ for (int i = 0; i < result.Documents.Count; i++) } if (document.Fields.TryGetValue("SubTotal", out DocumentField subTotalField) - && subTotalField.Type == DocumentFieldType.Currency) + && subTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue subTotal = subTotalField.ValueCurrency; Console.WriteLine($"Sub Total: '{subTotal.CurrencySymbol}{subTotal.Amount}', with confidence {subTotalField.Confidence}"); } if (document.Fields.TryGetValue("TotalTax", out DocumentField totalTaxField) - && totalTaxField.Type == DocumentFieldType.Currency) + && totalTaxField.FieldType == DocumentFieldType.Currency) { CurrencyValue totalTax = totalTaxField.ValueCurrency; Console.WriteLine($"Total Tax: '{totalTax.CurrencySymbol}{totalTax.Amount}', with confidence {totalTaxField.Confidence}"); } if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField) - && invoiceTotalField.Type == DocumentFieldType.Currency) + && invoiceTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency; Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}', with confidence {invoiceTotalField.Confidence}"); @@ -301,8 +293,9 @@ for (int i = 0; i < result.Documents.Count; i++) ### Classifying documents Differences between the versions: -- The former `ClassifyDocument` method taking a `Stream` as the input document is still not supported in `Azure.AI.DocumentIntelligence` 1.0.0-beta.3. As a workaround you will need to use a URI input or the new Base64 input option, which is described later in this guide ([Analyzing and classifying documents from a stream](#analyzing-and-classifying-documents-from-a-stream)). -- `ClassifyDocumentFromUri` has been renamed to `ClassifyDocument` and its input arguments have been reorganized. The `documentUri` parameter has been removed. Instead, a `ClassifyDocumentContent` object must be passed to the method to select the desired input type: URI or Base64 binary data. +- The former `ClassifyDocument` method taking a `Stream` as the input document is still not supported in `Azure.AI.DocumentIntelligence` 1.0.0. As a workaround you will need to use a URI input or the new binary data input option, which is described later in this guide ([Analyzing and classifying documents from a stream](#analyzing-and-classifying-documents-from-a-stream)). +- `ClassifyDocumentFromUri` has been renamed to `ClassifyDocument`: + - The `classifierId` and the `documentUri` parameters have been moved into a new `ClassifyDocumentOptions` property bag. The desired input type must be selected when creating the options object: URI or binary data. Classifying documents with `Azure.AI.FormRecognizer`: ```C# @@ -325,27 +318,24 @@ Classifying documents with `Azure.AI.DocumentIntelligence`: string classifierId = ""; Uri uriSource = new Uri(""); -var content = new ClassifyDocumentContent() -{ - UrlSource = uriSource -}; +var options = new ClassifyDocumentOptions(classifierId, uriSource); -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, classifierId, content); +Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine($"Input was classified by the classifier with ID '{result.ModelId}'."); foreach (AnalyzedDocument document in result.Documents) { - Console.WriteLine($"Found a document of type: {document.DocType}"); + Console.WriteLine($"Found a document of type: {document.DocumentType}"); } ``` ### Building a document model Differences between the versions: -- Parameters `trainingDataSource`, `buildMode`, `modelId`, and `options` have been removed. The method now takes a `buildRequest` parameter of type `BuildDocumentModelContent` containing all the removed options. -- After creating a `BuildDocumentModelContent` instance, either property `AzureBlobSource` or `AzureBlobFileListSource` must be set depending on your data source. +- Parameters `trainingDataSource`, `buildMode`, `modelId` have moved into `BuildDocumentModelOptions`, which is now required. +- When creating a `BuildDocumentModelOptions` instance, either property `BlobSource` or `BlobFileListSource` must be set depending on your data source. Building a document model with `Azure.AI.FormRecognizer`: ```C# @@ -386,19 +376,17 @@ Uri blobContainerUri = new Uri(""); // build modes and their differences, see: // https://aka.ms/azsdk/formrecognizer/buildmode -var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) -{ - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) -}; +var blobSource = new BlobContentSource(blobContainerUri); +var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource); -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, options); DocumentModelDetails model = operation.Value; Console.WriteLine($"Model ID: {model.ModelId}"); Console.WriteLine($"Created on: {model.CreatedOn}"); Console.WriteLine("Document types the model can recognize:"); -foreach (KeyValuePair docType in model.DocTypes) +foreach (KeyValuePair docType in model.DocumentTypes) { Console.WriteLine($" Document type: '{docType.Key}', which has the following fields:"); foreach (KeyValuePair schema in docType.Value.FieldSchema) @@ -412,18 +400,14 @@ foreach (KeyValuePair docType in model.DocTypes) ### Analyzing and classifying documents from a stream -Currently neither `AnalyzeDocument` nor `ClassifyDocument` support submitting a document from a `Stream` input. As a temporary workaround, you can make use of the new Base64 input option. The following example illustrates how to submit a local file for analysis: +Currently neither `AnalyzeDocument` nor `ClassifyDocument` support submitting a document from a `Stream` input. As a temporary workaround, you can make use of the new binary data input option. The following example illustrates how to submit a local file for analysis: -```C# Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelWithBase64Async +```C# Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelFromBytesAsync string filePath = ""; byte[] fileBytes = File.ReadAllBytes(filePath); -var content = new AnalyzeDocumentContent() -{ - Base64Source = BinaryData.FromBytes(fileBytes) -}; - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); +BinaryData bytesSource = BinaryData.FromBytes(fileBytes); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", bytesSource); AnalyzeResult result = operation.Value; // To see the list of all the supported fields returned by service and its corresponding types for the @@ -437,39 +421,39 @@ for (int i = 0; i < result.Documents.Count; i++) AnalyzedDocument document = result.Documents[i]; if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField) - && vendorNameField.Type == DocumentFieldType.String) + && vendorNameField.FieldType == DocumentFieldType.String) { string vendorName = vendorNameField.ValueString; Console.WriteLine($"Vendor Name: '{vendorName}', with confidence {vendorNameField.Confidence}"); } if (document.Fields.TryGetValue("CustomerName", out DocumentField customerNameField) - && customerNameField.Type == DocumentFieldType.String) + && customerNameField.FieldType == DocumentFieldType.String) { string customerName = customerNameField.ValueString; Console.WriteLine($"Customer Name: '{customerName}', with confidence {customerNameField.Confidence}"); } if (document.Fields.TryGetValue("Items", out DocumentField itemsField) - && itemsField.Type == DocumentFieldType.List) + && itemsField.FieldType == DocumentFieldType.List) { foreach (DocumentField itemField in itemsField.ValueList) { Console.WriteLine("Item:"); - if (itemField.Type == DocumentFieldType.Dictionary) + if (itemField.FieldType == DocumentFieldType.Dictionary) { IReadOnlyDictionary itemFields = itemField.ValueDictionary; if (itemFields.TryGetValue("Description", out DocumentField itemDescriptionField) - && itemDescriptionField.Type == DocumentFieldType.String) + && itemDescriptionField.FieldType == DocumentFieldType.String) { string itemDescription = itemDescriptionField.ValueString; Console.WriteLine($" Description: '{itemDescription}', with confidence {itemDescriptionField.Confidence}"); } if (itemFields.TryGetValue("Amount", out DocumentField itemAmountField) - && itemAmountField.Type == DocumentFieldType.Currency) + && itemAmountField.FieldType == DocumentFieldType.Currency) { CurrencyValue itemAmount = itemAmountField.ValueCurrency; Console.WriteLine($" Amount: '{itemAmount.CurrencySymbol}{itemAmount.Amount}', with confidence {itemAmountField.Confidence}"); @@ -479,21 +463,21 @@ for (int i = 0; i < result.Documents.Count; i++) } if (document.Fields.TryGetValue("SubTotal", out DocumentField subTotalField) - && subTotalField.Type == DocumentFieldType.Currency) + && subTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue subTotal = subTotalField.ValueCurrency; Console.WriteLine($"Sub Total: '{subTotal.CurrencySymbol}{subTotal.Amount}', with confidence {subTotalField.Confidence}"); } if (document.Fields.TryGetValue("TotalTax", out DocumentField totalTaxField) - && totalTaxField.Type == DocumentFieldType.Currency) + && totalTaxField.FieldType == DocumentFieldType.Currency) { CurrencyValue totalTax = totalTaxField.ValueCurrency; Console.WriteLine($"Total Tax: '{totalTax.CurrencySymbol}{totalTax.Amount}', with confidence {totalTaxField.Confidence}"); } if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField) - && invoiceTotalField.Type == DocumentFieldType.Currency) + && invoiceTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency; Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}', with confidence {invoiceTotalField.Confidence}"); @@ -533,12 +517,9 @@ Note that it's necessary to pass the `DocumentPage` containing the line to the m ```C# Snippet:Migration_DocumentIntelligenceGetWordsUsage Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; +var options = new AnalyzeDocumentOptions("prebuilt-invoice", uriSource); -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; DocumentPage firstPage = result.Pages[0]; @@ -559,7 +540,7 @@ foreach (DocumentLine line in firstPage.Lines) ### Accessing an existing long-running operation -Storing the ID of a long-running operation to retrieve its status at a later point in time is still not supported in `Azure.AI.DocumentIntelligence` 1.0.0-beta.3. There are no straightforward workarounds to support this scenario. +With the exception of the new batch analysis API, storing the ID of a long-running operation to retrieve its status at a later point in time is still not supported in `Azure.AI.DocumentIntelligence` 1.0.0. There are no straightforward workarounds to support this scenario. ## Additional samples diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md index a37e5d5aa240..ffde27092265 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/README.md @@ -14,30 +14,28 @@ Azure AI Document Intelligence is a cloud service that uses machine learning to ## 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 Install the Azure Document Intelligence client library for .NET with [NuGet][nuget]: ```dotnetcli -dotnet add package Azure.AI.DocumentIntelligence --prerelease +dotnet add package Azure.AI.DocumentIntelligence ``` -> Note: This version of the client library defaults to the `2024-07-31-preview` version of the service. +> Note: This version of the client library defaults to the `2024-11-30` version of the service. ### Prerequisites * An [Azure subscription][azure_sub]. -* A [Cognitive Services or Document Intelligence resource][cognitive_resource] to use this package. +* A [Document Intelligence][docint_resource] or an [Azure AI services][ai_resource] resource to use this package. -#### Create a Cognitive Services or Document Intelligence resource +#### Create a Document Intelligence or an Azure AI services resource -Document Intelligence supports both [multi-service and single-service access][cognitive_resource_portal]. Create a Cognitive Services resource if you plan to access multiple cognitive services under a single endpoint and key. For Document Intelligence access only, create a Document Intelligence resource. Please note that you will need a single-service resource if you intend to use [Azure Active Directory authentication](#create-documentintelligenceclient-with-azure-active-directory-credential). +Document Intelligence supports both [multi-service and single-service access][ai_resource]. Create an Azure AI services resource if you plan to access multiple Azure AI services under a single endpoint and key. For Document Intelligence access only, create a Document Intelligence resource. Please note that you will need a single-service resource if you intend to use [Microsoft Entra ID authentication](#create-documentintelligenceclient-with-microsoft-entra-id). You can create either resource using: -* Option 1: [Azure Portal][cognitive_resource_portal]. +* Option 1: [Azure Portal][ai_resource]. * Option 2: [Azure CLI][cognitive_resource_cli]. Below is an example of how you can create a Document Intelligence resource using the CLI: @@ -49,7 +47,7 @@ az group create --name --location ``` ```PowerShell -# Create the Form Recognizer resource +# Create the Document Intelligence resource az cognitiveservices account create \ --name \ --resource-group \ @@ -81,46 +79,48 @@ Regional endpoint: https://.api.cognitive.microsoft.com/ Custom subdomain: https://.cognitiveservices.azure.com/ ``` -A regional endpoint is the same for every resource in a region. A complete list of supported regional endpoints can be consulted [here][regional_endpoints]. Please note that regional endpoints do not support AAD authentication. +A regional endpoint is the same for every resource in a region. A complete list of supported regional endpoints can be consulted [here][regional_endpoints]. Please note that regional endpoints do not support Microsoft Entra ID authentication. -A custom subdomain, on the other hand, is a name that is unique to the Document Intelligence resource. They can only be used by [single-service resources][cognitive_resource_portal]. +A custom subdomain, on the other hand, is a name that is unique to the Document Intelligence resource. They can only be used by [single-service resources][ai_resource]. -#### Get the API Key +#### Create DocumentIntelligenceClient with Microsoft Entra ID -The API key can be found in the [Azure Portal][azure_portal] or by running the following Azure CLI command: +You can authenticate with Microsoft Entra ID by using the [Azure Identity library][azure_identity]. Note that regional endpoints do not support identity-based authentication. Create a [custom subdomain][custom_subdomain] for your resource in order to use this type of authentication. -```PowerShell -az cognitiveservices account keys list --name "" --resource-group "" -``` +To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `Azure.Identity` package: -#### Create DocumentIntelligenceClient with AzureKeyCredential +```dotnetcli +dotnet add package Azure.Identity +``` -Once you have the value for the API key, create an `AzureKeyCredential`. With the endpoint and key credential, you can create the [`DocumentIntelligenceClient`][doc_intelligence_client_class]: +You will also need to [register a new Microsoft Entra application][register_aad_app] and grant access to Document Intelligence by assigning the `"Cognitive Services Data Reader"` role to your service principal. -```C# Snippet:CreateDocumentIntelligenceClientApiKey +```C# Snippet:CreateDocumentIntelligenceClient string endpoint = ""; -string apiKey = ""; -var client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); +var credential = new DefaultAzureCredential(); +var client = new DocumentIntelligenceClient(new Uri(endpoint), credential); ``` -#### Create DocumentIntelligenceClient with Azure Active Directory Credential +#### Create DocumentIntelligenceClient with AzureKeyCredential -`AzureKeyCredential` authentication is used in the examples in this getting started guide, but you can also authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. Note that regional endpoints do not support AAD authentication. Create a [custom subdomain][custom_subdomain] for your resource in order to use this type of authentication. +It is strongly recommended to use Microsoft Entra ID as your default authentication approach. On the other hand, using an `AzureKeyCredential` can be helpful on getting-started scenarios since it can be set up fastly. -To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `Azure.Identity` package: +##### Get the API Key -```dotnetcli -dotnet add package Azure.Identity +The API key can be found in the [Azure Portal][azure_portal_get_endpoint] or by running the following Azure CLI command: + +```PowerShell +az cognitiveservices account keys list --name "" --resource-group "" ``` -You will also need to [register a new AAD application][register_aad_app] and [grant access][aad_grant_access] to Document Intelligence by assigning the `"Cognitive Services User"` role to your service principal. +##### Create the client -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET. +Once you have the value for the API key, create an `AzureKeyCredential`. With the endpoint and key credential, you can create the [`DocumentIntelligenceClient`][doc_intelligence_client_class]: -```C# Snippet:CreateDocumentIntelligenceClient +```C# Snippet:CreateDocumentIntelligenceClientApiKey string endpoint = ""; -var credential = new DefaultAzureCredential(); -var client = new DocumentIntelligenceClient(new Uri(endpoint), credential); +string apiKey = ""; +var client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); ``` ## Key concepts @@ -182,13 +182,7 @@ Extract text, selection marks, table structures, styles, and paragraphs, along w ```C# Snippet:DocumentIntelligenceExtractLayoutFromUriAsync Uri uriSource = new Uri(""); - -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", uriSource); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -255,8 +249,8 @@ foreach (DocumentStyle style in result.Styles) foreach (DocumentSpan span in style.Spans) { - var handwrittenContent = result.Content.Substring(span.Offset, span.Length); - Console.WriteLine($" {handwrittenContent}"); + var handwrittenOptions = result.Content.Substring(span.Offset, span.Length); + Console.WriteLine($" {handwrittenOptions}"); } } } @@ -284,13 +278,7 @@ For example, to analyze fields from an invoice, use the prebuilt Invoice model p ```C# Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelFromUriAsync Uri uriSource = new Uri(""); - -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", uriSource); AnalyzeResult result = operation.Value; // To see the list of all the supported fields returned by service and its corresponding types for the @@ -304,39 +292,39 @@ for (int i = 0; i < result.Documents.Count; i++) AnalyzedDocument document = result.Documents[i]; if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField) - && vendorNameField.Type == DocumentFieldType.String) + && vendorNameField.FieldType == DocumentFieldType.String) { string vendorName = vendorNameField.ValueString; Console.WriteLine($"Vendor Name: '{vendorName}', with confidence {vendorNameField.Confidence}"); } if (document.Fields.TryGetValue("CustomerName", out DocumentField customerNameField) - && customerNameField.Type == DocumentFieldType.String) + && customerNameField.FieldType == DocumentFieldType.String) { string customerName = customerNameField.ValueString; Console.WriteLine($"Customer Name: '{customerName}', with confidence {customerNameField.Confidence}"); } if (document.Fields.TryGetValue("Items", out DocumentField itemsField) - && itemsField.Type == DocumentFieldType.List) + && itemsField.FieldType == DocumentFieldType.List) { foreach (DocumentField itemField in itemsField.ValueList) { Console.WriteLine("Item:"); - if (itemField.Type == DocumentFieldType.Dictionary) + if (itemField.FieldType == DocumentFieldType.Dictionary) { IReadOnlyDictionary itemFields = itemField.ValueDictionary; if (itemFields.TryGetValue("Description", out DocumentField itemDescriptionField) - && itemDescriptionField.Type == DocumentFieldType.String) + && itemDescriptionField.FieldType == DocumentFieldType.String) { string itemDescription = itemDescriptionField.ValueString; Console.WriteLine($" Description: '{itemDescription}', with confidence {itemDescriptionField.Confidence}"); } if (itemFields.TryGetValue("Amount", out DocumentField itemAmountField) - && itemAmountField.Type == DocumentFieldType.Currency) + && itemAmountField.FieldType == DocumentFieldType.Currency) { CurrencyValue itemAmount = itemAmountField.ValueCurrency; Console.WriteLine($" Amount: '{itemAmount.CurrencySymbol}{itemAmount.Amount}', with confidence {itemAmountField.Confidence}"); @@ -346,21 +334,21 @@ for (int i = 0; i < result.Documents.Count; i++) } if (document.Fields.TryGetValue("SubTotal", out DocumentField subTotalField) - && subTotalField.Type == DocumentFieldType.Currency) + && subTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue subTotal = subTotalField.ValueCurrency; Console.WriteLine($"Sub Total: '{subTotal.CurrencySymbol}{subTotal.Amount}', with confidence {subTotalField.Confidence}"); } if (document.Fields.TryGetValue("TotalTax", out DocumentField totalTaxField) - && totalTaxField.Type == DocumentFieldType.Currency) + && totalTaxField.FieldType == DocumentFieldType.Currency) { CurrencyValue totalTax = totalTaxField.ValueCurrency; Console.WriteLine($"Total Tax: '{totalTax.CurrencySymbol}{totalTax.Amount}', with confidence {totalTaxField.Confidence}"); } if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField) - && invoiceTotalField.Type == DocumentFieldType.Currency) + && invoiceTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency; Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}', with confidence {invoiceTotalField.Confidence}"); @@ -392,19 +380,17 @@ Uri blobContainerUri = new Uri(""); // build modes and their differences, see: // https://aka.ms/azsdk/formrecognizer/buildmode -var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) -{ - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) -}; +var blobSource = new BlobContentSource(blobContainerUri); +var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource); -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, options); DocumentModelDetails model = operation.Value; Console.WriteLine($"Model ID: {model.ModelId}"); Console.WriteLine($"Created on: {model.CreatedOn}"); Console.WriteLine("Document types the model can recognize:"); -foreach (KeyValuePair docType in model.DocTypes) +foreach (KeyValuePair docType in model.DocumentTypes) { Console.WriteLine($" Document type: '{docType.Key}', which has the following fields:"); foreach (KeyValuePair schema in docType.Value.FieldSchema) @@ -424,7 +410,7 @@ Manage the models stored in your account. // Check number of custom models in the Document Intelligence resource, and the maximum number // of custom models that can be stored. -ResourceDetails resourceDetails = await client.GetResourceInfoAsync(); +DocumentIntelligenceResourceDetails resourceDetails = await client.GetResourceDetailsAsync(); Console.WriteLine($"Resource has {resourceDetails.CustomDocumentModels.Count} custom models."); Console.WriteLine($"It can have at most {resourceDetails.CustomDocumentModels.Limit} custom models."); @@ -472,26 +458,26 @@ Build a document classifier by uploading custom training documents. string classifierId = ""; Uri blobContainerUri = new Uri(""); -var sourceA = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; -var sourceB = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; -var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; -var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; +var sourceA = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; +var sourceB = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; +var docTypeA = new ClassifierDocumentTypeDetails(sourceA); +var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; -var content = new BuildDocumentClassifierContent(classifierId, docTypes); +var options = new BuildClassifierOptions(classifierId, docTypes); -Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, options); DocumentClassifierDetails classifier = operation.Value; Console.WriteLine($"Classifier ID: {classifier.ClassifierId}"); Console.WriteLine($"Created on: {classifier.CreatedOn}"); Console.WriteLine("Document types the classifier can recognize:"); -foreach (KeyValuePair docType in classifier.DocTypes) +foreach (KeyValuePair docType in classifier.DocumentTypes) { Console.WriteLine($" {docType.Key}"); } @@ -507,19 +493,16 @@ Use document classifiers to accurately detect and identify documents you process string classifierId = ""; Uri uriSource = new Uri(""); -var content = new ClassifyDocumentContent() -{ - UrlSource = uriSource -}; +var options = new ClassifyDocumentOptions(classifierId, uriSource); -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, classifierId, content); +Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine($"Input was classified by the classifier with ID '{result.ModelId}'."); foreach (AnalyzedDocument document in result.Documents) { - Console.WriteLine($"Found a document of type: {document.DocType}"); + Console.WriteLine($"Found a document of type: {document.DocumentType}"); } ``` @@ -529,19 +512,17 @@ For more information, see [here][classify_document]. ### General -When you interact with the Document Intelligence client library using the .NET SDK, errors returned by the service will result in a `RequestFailedException` with the same HTTP status code returned by the [REST API][docint_rest_api] request. +When you interact with the Document Intelligence client library using the .NET SDK, errors returned by the service will result in a `RequestFailedException` with the same HTTP status code returned by the REST API request. For example, if you submit a receipt image with an invalid `Uri`, a `400` error is returned, indicating "Bad Request". ```C# Snippet:DocumentIntelligenceBadRequest -var content = new AnalyzeDocumentContent() -{ - UrlSource = new Uri("http://invalid.uri") -}; +var uriSource = new Uri("http://invalid.uri"); +var options = new AnalyzeDocumentOptions("prebuilt-receipt", uriSource); try { - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-receipt", content); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); } catch (RequestFailedException e) { @@ -561,12 +542,15 @@ Content: {"error":{"code":"InvalidRequest","message":"Invalid request.","innererror":{"code":"InvalidContent","message":"The file is corrupted or format is unsupported. Refer to documentation for the list of supported formats."}}} Headers: - Transfer-Encoding: chunked + ms-azure-ai-errorcode: REDACTED + x-ms-error-code: REDACTED x-envoy-upstream-service-time: REDACTED - apim-request-id: REDACTED + apim-request-id: 4ca2a2ff-aaa5-4ffa-864f-cbd8f4a847f7 Strict-Transport-Security: REDACTED X-Content-Type-Options: REDACTED - Date: Fri, 01 Oct 2021 02:55:44 GMT + x-ms-region: REDACTED + Date: Mon, 16 Dec 2024 23:25:15 GMT + Content-Length: 221 Content-Type: application/json; charset=utf-8 ``` @@ -613,28 +597,26 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [docint_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src -[docint_docs]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/ -[docint_refdocs]: https://aka.ms/azsdk/net/docs/ref/formrecognizer -[docint_nuget_package]: https://www.nuget.org/packages/Azure.AI.FormRecognizer +[docint_docs]: https://learn.microsoft.com/azure/cognitive-services/form-recognizer/ +[docint_refdocs]: https://learn.microsoft.com/dotnet/api/overview/azure/cognitiveservices/documentintelligence?view=azure-dotnet +[docint_nuget_package]: https://www.nuget.org/packages/Azure.AI.DocumentIntelligence [docint_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/README.md -[docint_rest_api]: https://aka.ms/azsdk/formrecognizer/restapi [docint_models]: https://aka.ms/azsdk/formrecognizer/models [docint_errors]: https://aka.ms/azsdk/formrecognizer/errors [docint_build_model]: https://aka.ms/azsdk/formrecognizer/buildmodel -[cognitive_resource]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account +[docint_resource]: https://learn.microsoft.com/azure/ai-services/document-intelligence/how-to-guides/create-document-intelligence-resource +[ai_resource]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [doc_intelligence_client_class]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClient.cs [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[aad_grant_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[cognitive_resource_portal]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account -[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli -[regional_endpoints]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains#is-there-a-list-of-regional-endpoints -[azure_cli_endpoint_lookup]: https://docs.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show -[azure_portal_get_endpoint]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows#get-the-keys-for-your-resource +[cognitive_resource_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[regional_endpoints]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains#is-there-a-list-of-regional-endpoints +[azure_cli_endpoint_lookup]: https://learn.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show +[azure_portal_get_endpoint]: https://learn.microsoft.com/azure/ai-services/document-intelligence/how-to-guides/create-document-intelligence-resource#get-endpoint-url-and-keys [di_studio]: https://aka.ms/azsdk/formrecognizer/formrecognizerstudio @@ -653,10 +635,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [analyze_with_addons]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AddOnCapabilities.md [extract_layout_markdown]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayoutAsMarkdown.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ -[azure_portal]: https://portal.azure.com [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.net8.0.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.net8.0.cs index 7cfdd97ec19a..1453566d6d12 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.net8.0.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/api/Azure.AI.DocumentIntelligence.net8.0.cs @@ -24,39 +24,50 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AnalyzeBatchDocumentsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AnalyzeBatchDocumentsContent(System.Uri resultContainerUrl) { } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } + public partial class AnalyzeBatchDocumentsOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AnalyzeBatchDocumentsOptions(string modelId, Azure.AI.DocumentIntelligence.BlobContentSource blobSource, System.Uri resultContainerUri) { } + public AnalyzeBatchDocumentsOptions(string modelId, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource, System.Uri resultContainerUri) { } + public Azure.AI.DocumentIntelligence.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } + public System.Collections.Generic.ICollection Features { get { throw null; } } + public string Locale { get { throw null; } set { } } + public string ModelId { get { throw null; } } + public System.Collections.Generic.ICollection Output { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentContentFormat? OutputContentFormat { get { throw null; } set { } } public bool? OverwriteExisting { get { throw null; } set { } } - public System.Uri ResultContainerUrl { get { throw null; } } + public string Pages { get { throw null; } set { } } + public System.Collections.Generic.ICollection QueryFields { get { throw null; } } + public System.Uri ResultContainerUri { get { throw null; } } public string ResultPrefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AnalyzeBatchOperationDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AnalyzeBatchOperationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal AnalyzeBatchOperationDetail() { } + internal AnalyzeBatchOperationDetails() { } + public System.DateTimeOffset CreatedOn { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } - public System.Uri ResultUrl { get { throw null; } } - public System.Uri SourceUrl { get { throw null; } } - public Azure.AI.DocumentIntelligence.OperationStatus Status { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } + public int? PercentCompleted { get { throw null; } } + public Azure.AI.DocumentIntelligence.AnalyzeBatchResult Result { get { throw null; } } + public string ResultId { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Status { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class AnalyzeBatchResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AnalyzeBatchResult() { } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } public int FailedCount { get { throw null; } } public int SkippedCount { get { throw null; } } public int SucceededCount { get { throw null; } } @@ -67,13 +78,27 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AnalyzeBatchResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AnalyzeBatchResultDetails() { } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } + public System.Uri ResultUri { get { throw null; } } + public System.Uri SourceUri { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AnalyzedDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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 string DocumentType { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentFieldDictionary Fields { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.AnalyzedDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -82,17 +107,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AnalyzeDocumentContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AnalyzeDocumentOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AnalyzeDocumentContent() { } - public System.BinaryData Base64Source { get { throw null; } set { } } - public System.Uri UrlSource { get { throw null; } set { } } + public AnalyzeDocumentOptions(string modelId, System.BinaryData bytesSource) { } + public AnalyzeDocumentOptions(string modelId, System.Uri uriSource) { } + public System.BinaryData BytesSource { get { throw null; } } + public System.Collections.Generic.ICollection Features { get { throw null; } } + public string Locale { get { throw null; } set { } } + public string ModelId { get { throw null; } } + public System.Collections.Generic.ICollection Output { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentContentFormat? OutputContentFormat { get { throw null; } set { } } + public string Pages { get { throw null; } set { } } + public System.Collections.Generic.ICollection QueryFields { get { throw null; } } + public System.Uri UriSource { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeDocumentContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeDocumentContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AnalyzeOutputOption : System.IEquatable @@ -117,7 +150,7 @@ public partial class AnalyzeResult : System.ClientModel.Primitives.IJsonModel Documents { get { throw null; } } public System.Collections.Generic.IReadOnlyList Figures { get { throw null; } } public System.Collections.Generic.IReadOnlyList KeyValuePairs { get { throw null; } } @@ -126,7 +159,6 @@ internal AnalyzeResult() { } 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 System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } @@ -137,106 +169,114 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AuthorizeClassifierCopyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AuthorizeClassifierCopyOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AuthorizeClassifierCopyContent(string classifierId) { } + public AuthorizeClassifierCopyOptions(string classifierId) { } public string ClassifierId { get { throw null; } } public string Description { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AuthorizeCopyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AuthorizeModelCopyOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AuthorizeCopyContent(string modelId) { } + public AuthorizeModelCopyOptions(string modelId) { } public string Description { get { throw null; } set { } } public string ModelId { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeCopyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeCopyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzureBlobContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BlobContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureBlobContentSource(System.Uri containerUrl) { } - public System.Uri ContainerUrl { get { throw null; } set { } } + public BlobContentSource(System.Uri containerUri) { } + public System.Uri ContainerUri { get { throw null; } set { } } public string Prefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BlobContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BlobContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzureBlobFileListContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BlobFileListContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureBlobFileListContentSource(System.Uri containerUrl, string fileList) { } - public System.Uri ContainerUrl { get { throw null; } set { } } + public BlobFileListContentSource(System.Uri containerUri, string fileList) { } + public System.Uri ContainerUri { get { throw null; } set { } } public string FileList { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BlobFileListContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BlobFileListContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BoundingRegion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BoundingRegion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel, System.ClientModel.Primitives.IPersistableModel { - internal BoundingRegion() { } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BoundingRegion() { throw null; } public int PageNumber { get { throw null; } } public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.BoundingRegion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + object System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.BoundingRegion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + object System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BuildDocumentClassifierContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BuildClassifierOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BuildDocumentClassifierContent(string classifierId, System.Collections.Generic.IDictionary docTypes) { } + public BuildClassifierOptions(string classifierId, System.Collections.Generic.IDictionary documentTypes) { } public bool? AllowOverwrite { get { throw null; } set { } } public string BaseClassifierId { get { throw null; } set { } } public string ClassifierId { get { throw null; } } public string Description { get { throw null; } set { } } - public System.Collections.Generic.IDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IDictionary DocumentTypes { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentClassifierContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentClassifierContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BuildClassifierOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BuildClassifierOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BuildDocumentModelContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BuildDocumentModelOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BuildDocumentModelContent(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode) { } + public BuildDocumentModelOptions(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode, Azure.AI.DocumentIntelligence.BlobContentSource blobSource) { } + public BuildDocumentModelOptions(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource) { } public bool? AllowOverwrite { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } + public Azure.AI.DocumentIntelligence.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentBuildMode BuildMode { get { throw null; } } public string Description { get { throw null; } set { } } public float? MaxTrainingHours { get { throw null; } set { } } public string ModelId { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentModelContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentModelContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BuildDocumentModelOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BuildDocumentModelOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ClassifierCopyAuthorization : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, System.Uri targetClassifierLocation, string accessToken, System.DateTimeOffset expirationDateTime) { } + public ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, System.Uri targetClassifierLocation, string accessToken, System.DateTimeOffset expiresOn) { } public string AccessToken { get { throw null; } set { } } - public System.DateTimeOffset ExpirationDateTime { get { throw null; } set { } } + public System.DateTimeOffset ExpiresOn { get { throw null; } set { } } public string TargetClassifierId { get { throw null; } set { } } public System.Uri TargetClassifierLocation { get { throw null; } set { } } public string TargetResourceId { get { throw null; } set { } } @@ -250,9 +290,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ClassifierDocumentTypeDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClassifierDocumentTypeDetails() { } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } + public ClassifierDocumentTypeDetails(Azure.AI.DocumentIntelligence.BlobContentSource blobSource) { } + public ClassifierDocumentTypeDetails(Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource) { } + public Azure.AI.DocumentIntelligence.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } public Azure.AI.DocumentIntelligence.ContentSourceKind? SourceKind { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.ClassifierDocumentTypeDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -261,51 +302,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ClassifyDocumentContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ClassifyDocumentOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClassifyDocumentContent() { } - public System.BinaryData Base64Source { get { throw null; } set { } } - public System.Uri UrlSource { get { throw null; } set { } } + public ClassifyDocumentOptions(string classifierId, System.BinaryData bytesSource) { } + public ClassifyDocumentOptions(string classifierId, System.Uri uriSource) { } + public System.BinaryData BytesSource { get { throw null; } } + public string ClassifierId { get { throw null; } } + public string Pages { get { throw null; } set { } } + public Azure.AI.DocumentIntelligence.SplitMode? Split { get { throw null; } set { } } + public System.Uri UriSource { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ClassifyDocumentContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ClassifyDocumentContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.ClassifyDocumentOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.ClassifyDocumentOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ComposeDocumentModelContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ComposeModelOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ComposeDocumentModelContent(string modelId, string classifierId, System.Collections.Generic.IDictionary docTypes) { } + public ComposeModelOptions(string modelId, string classifierId, System.Collections.Generic.IDictionary documentTypes) { } public string ClassifierId { get { throw null; } } public string Description { get { throw null; } set { } } - public System.Collections.Generic.IDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IDictionary DocumentTypes { get { throw null; } } public string ModelId { get { throw null; } } public Azure.AI.DocumentIntelligence.SplitMode? Split { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ComposeDocumentModelContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ComposeDocumentModelContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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; } + Azure.AI.DocumentIntelligence.ComposeModelOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.ComposeModelOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContentSourceKind : System.IEquatable @@ -313,10 +340,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 static Azure.AI.DocumentIntelligence.ContentSourceKind Blob { get { throw null; } } + public static Azure.AI.DocumentIntelligence.ContentSourceKind BlobFileList { get { throw null; } } + public static Azure.AI.DocumentIntelligence.ContentSourceKind Bytes { get { throw null; } } + public static Azure.AI.DocumentIntelligence.ContentSourceKind Uri { 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; } @@ -327,22 +354,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - 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 { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.CopyAuthorization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.CopyAuthorization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class CurrencyValue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal CurrencyValue() { } @@ -375,12 +386,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 FontStyling { 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; } @@ -445,7 +456,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public DocumentBuildMode(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentBuildMode Generative { get { 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; } @@ -472,9 +482,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentClassifierBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentClassifierBuildOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentClassifierBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentClassifierBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentClassifierDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentClassifierBuildOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -483,9 +493,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentClassifierCopyToOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentClassifierCopyToOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentClassifierCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentClassifierCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentClassifierDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentClassifierCopyToOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -502,8 +512,9 @@ internal DocumentClassifierDetails() { } public string ClassifierId { get { throw null; } } public System.DateTimeOffset CreatedOn { get { throw null; } } public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DocumentTypes { get { throw null; } } public System.DateTimeOffset? ExpiresOn { get { throw null; } } + public System.DateTimeOffset? ModifiedOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentClassifierDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -512,23 +523,41 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentContentFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentContentFormat(string value) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentContentFormat Markdown { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentContentFormat Text { get { throw null; } } + public bool Equals(Azure.AI.DocumentIntelligence.DocumentContentFormat 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.DocumentContentFormat left, Azure.AI.DocumentIntelligence.DocumentContentFormat right) { throw null; } + public static implicit operator Azure.AI.DocumentIntelligence.DocumentContentFormat (string value) { throw null; } + public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentContentFormat left, Azure.AI.DocumentIntelligence.DocumentContentFormat right) { throw null; } + public override string ToString() { throw null; } + } public partial class DocumentField : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal DocumentField() { } public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } public float? Confidence { get { throw null; } } public string Content { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentFieldType FieldType { 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 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 System.Collections.Generic.IReadOnlyDictionary ValueDictionary { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentFieldDictionary ValueDictionary { get { throw null; } } public double? ValueDouble { get { throw null; } } + public long? ValueInt64 { get { throw null; } } public System.Collections.Generic.IReadOnlyList ValueList { get { throw null; } } - public long? ValueLong { get { throw null; } } public string ValuePhoneNumber { get { throw null; } } public System.Collections.Generic.IReadOnlyList ValueSelectionGroup { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentSelectionMarkState? ValueSelectionMark { get { throw null; } } @@ -542,14 +571,26 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DocumentFieldDictionary : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.Generic.IReadOnlyDictionary, System.Collections.IEnumerable + { + internal DocumentFieldDictionary() { } + public int Count { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentField this[string key] { get { throw null; } } + public System.Collections.Generic.IEnumerable Keys { get { throw null; } } + public System.Collections.Generic.IEnumerable Values { get { throw null; } } + public bool ContainsKey(string key) { throw null; } + public System.Collections.Generic.IEnumerator> GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + public bool TryGetValue(string key, out Azure.AI.DocumentIntelligence.DocumentField value) { throw null; } + } public partial class DocumentFieldSchema : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DocumentFieldSchema(Azure.AI.DocumentIntelligence.DocumentFieldType type) { } + public DocumentFieldSchema(Azure.AI.DocumentIntelligence.DocumentFieldType fieldType) { } public string Description { get { throw null; } set { } } public string Example { get { throw null; } set { } } + public Azure.AI.DocumentIntelligence.DocumentFieldType FieldType { get { throw null; } set { } } public Azure.AI.DocumentIntelligence.DocumentFieldSchema Items { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentFieldType Type { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentFieldSchema System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -570,8 +611,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.AI.DocumentIntelligence.DocumentFieldType Date { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType Dictionary { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType Double { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentFieldType Int64 { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType List { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Long { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType PhoneNumber { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType SelectionGroup { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType SelectionMark { get { throw null; } } @@ -695,33 +736,33 @@ public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Azure public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Response AuthorizeClassifierCopy(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AuthorizeClassifierCopy(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response AuthorizeClassifierCopy(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AuthorizeClassifierCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AuthorizeClassifierCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AuthorizeClassifierCopyAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response AuthorizeModelCopy(Azure.AI.DocumentIntelligence.AuthorizeCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AuthorizeModelCopy(Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions options, 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.AuthorizeCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AuthorizeModelCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions options, 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.BuildDocumentClassifierContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation BuildClassifier(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildClassifierOptions options, 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.BuildDocumentClassifierContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BuildClassifierAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildClassifierOptions options, 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.BuildDocumentModelContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation BuildDocumentModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelOptions options, 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.BuildDocumentModelContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BuildDocumentModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelOptions options, 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.ComposeDocumentModelContent composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation ComposeModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeModelOptions options, 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.ComposeDocumentModelContent composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ComposeModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeModelOptions options, 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 CopyClassifierTo(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization copyToRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyClassifierTo(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization authorization, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation CopyClassifierTo(Azure.WaitUntil waitUntil, string classifierId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CopyClassifierToAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization copyToRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CopyClassifierToAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization authorization, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CopyClassifierToAsync(Azure.WaitUntil waitUntil, string classifierId, 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.AI.DocumentIntelligence.ModelCopyAuthorization authorization, 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.AI.DocumentIntelligence.ModelCopyAuthorization authorization, 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; } @@ -744,17 +785,17 @@ public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Core. 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(string operationId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetOperation(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetOperation(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetOperationAsync(string operationId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetOperationAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperationAsync(string 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.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 virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetResourceDetails(Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetResourceDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetResourceDetailsAsync(Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetResourceDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DocumentIntelligenceClient { @@ -764,33 +805,49 @@ public DocumentIntelligenceClient(System.Uri endpoint, Azure.AzureKeyCredential public DocumentIntelligenceClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } public DocumentIntelligenceClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Operation AnalyzeBatchDocuments(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent analyzeBatchRequest = 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeBatchDocuments(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation AnalyzeBatchDocuments(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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AnalyzeBatchDocumentsAsync(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent analyzeBatchRequest = 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeBatchDocumentsAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AnalyzeBatchDocumentsAsync(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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentContent 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions options, 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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentContent 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, System.BinaryData bytesSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, System.Uri uriSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions options, 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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation ClassifyDocument(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifyDocumentContent classifyRequest, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), string pages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, System.BinaryData bytesSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, System.Uri uriSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation ClassifyDocument(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ClassifyDocumentOptions options, 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, string pages = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> ClassifyDocumentAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifyDocumentContent classifyRequest, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), string pages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ClassifyDocumentAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ClassifyDocumentOptions options, 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, string pages = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetAnalyzeResultFigure(string modelId, System.Guid resultId, string figureId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAnalyzeResultFigure(string modelId, System.Guid resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetAnalyzeResultFigureAsync(string modelId, System.Guid resultId, string figureId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAnalyzeResultFigureAsync(string modelId, System.Guid resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetAnalyzeResultPdf(string modelId, System.Guid resultId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAnalyzeResultPdf(string modelId, System.Guid resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetAnalyzeResultPdfAsync(string modelId, System.Guid resultId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAnalyzeResultPdfAsync(string modelId, System.Guid resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteAnalyzeBatchResult(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAnalyzeBatchResultAsync(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteAnalyzeResult(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAnalyzeResultAsync(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetAnalyzeBatchResult(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAnalyzeBatchResult(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAnalyzeBatchResultAsync(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAnalyzeBatchResultAsync(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAnalyzeBatchResults(string modelId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetAnalyzeBatchResults(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAnalyzeBatchResultsAsync(string modelId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetAnalyzeBatchResultsAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAnalyzeResultFigure(string modelId, string resultId, string figureId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAnalyzeResultFigure(string modelId, string resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAnalyzeResultFigureAsync(string modelId, string resultId, string figureId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAnalyzeResultFigureAsync(string modelId, string resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAnalyzeResultPdf(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAnalyzeResultPdf(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAnalyzeResultPdfAsync(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAnalyzeResultPdfAsync(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DocumentIntelligenceClientOptions : Azure.Core.ClientOptions { - public DocumentIntelligenceClientOptions(Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion version = Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion.V2024_07_31_Preview) { } + public DocumentIntelligenceClientOptions(Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion version = Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion.V2024_11_30) { } public enum ServiceVersion { - V2024_07_31_Preview = 1, + V2024_11_30 = 1, } } public partial class DocumentIntelligenceError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -798,7 +855,7 @@ public partial class DocumentIntelligenceError : System.ClientModel.Primitives.I 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 Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError InnerError { get { throw null; } } public string Message { get { throw null; } } public string Target { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -808,53 +865,120 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DocumentIntelligenceInnerError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentIntelligenceInnerError() { } + public string Code { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError InnerError { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class DocumentIntelligenceModelFactory { 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.AnalyzeBatchDocumentsContent AnalyzeBatchDocumentsContent(Azure.AI.DocumentIntelligence.AzureBlobContentSource azureBlobSource = null, Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource azureBlobFileListSource = null, System.Uri resultContainerUrl = null, string resultPrefix = null, bool? overwriteExisting = default(bool?)) { throw null; } - public static Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetail AnalyzeBatchOperationDetail(Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), System.Uri sourceUrl = null, System.Uri resultUrl = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AnalyzeBatchResult AnalyzeBatchResult(int succeededCount = 0, int failedCount = 0, int skippedCount = 0, System.Collections.Generic.IEnumerable details = 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 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, System.Collections.Generic.IEnumerable warnings = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent AuthorizeClassifierCopyContent(string classifierId = null, string description = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AuthorizeCopyContent AuthorizeCopyContent(string modelId = null, string description = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions AnalyzeBatchDocumentsOptions(Azure.AI.DocumentIntelligence.BlobContentSource blobSource = null, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource = null, System.Uri resultContainerUri = null, string resultPrefix = null, bool? overwriteExisting = default(bool?)) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetails AnalyzeBatchOperationDetails(string resultId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), int? percentCompleted = default(int?), Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.AnalyzeBatchResult result = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchResult AnalyzeBatchResult(int succeededCount = 0, int failedCount = 0, int skippedCount = 0, System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchResultDetails AnalyzeBatchResultDetails(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), System.Uri sourceUri = null, System.Uri resultUri = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzedDocument AnalyzedDocument(string documentType = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, Azure.AI.DocumentIntelligence.DocumentFieldDictionary fields = null, float confidence = 0f) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeResult AnalyzeResult(string apiVersion = null, string modelId = null, Azure.AI.DocumentIntelligence.DocumentContentFormat? contentFormat = default(Azure.AI.DocumentIntelligence.DocumentContentFormat?), 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 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, System.Collections.Generic.IEnumerable warnings = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions AuthorizeClassifierCopyOptions(string classifierId = null, string description = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions AuthorizeModelCopyOptions(string modelId = null, string description = null, System.Collections.Generic.IDictionary tags = 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.BuildDocumentClassifierContent BuildDocumentClassifierContent(string classifierId = null, string description = null, string baseClassifierId = null, System.Collections.Generic.IDictionary docTypes = null, bool? allowOverwrite = default(bool?)) { throw null; } - public static Azure.AI.DocumentIntelligence.BuildDocumentModelContent BuildDocumentModelContent(string modelId = null, string description = 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.IDictionary tags = null, float? maxTrainingHours = default(float?), bool? allowOverwrite = default(bool?)) { throw null; } - public static Azure.AI.DocumentIntelligence.ComposeDocumentModelContent ComposeDocumentModelContent(string modelId = null, string description = null, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IDictionary docTypes = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.BuildClassifierOptions BuildClassifierOptions(string classifierId = null, string description = null, string baseClassifierId = null, System.Collections.Generic.IDictionary documentTypes = null, bool? allowOverwrite = default(bool?)) { throw null; } + public static Azure.AI.DocumentIntelligence.BuildDocumentModelOptions BuildDocumentModelOptions(string modelId = null, string description = null, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode), Azure.AI.DocumentIntelligence.BlobContentSource blobSource = null, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource = null, System.Collections.Generic.IDictionary tags = null, float? maxTrainingHours = default(float?), bool? allowOverwrite = default(bool?)) { throw null; } + public static Azure.AI.DocumentIntelligence.ComposeModelOptions ComposeModelOptions(string modelId = null, string description = null, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IDictionary documentTypes = null, System.Collections.Generic.IDictionary tags = 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.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 = default(Azure.AI.DocumentIntelligence.DocumentSpan), 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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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.DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), string apiVersion = null, string baseClassifierId = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null, System.Collections.Generic.IEnumerable warnings = 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? valueDouble = default(double?), long? valueLong = 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 valueList = null, System.Collections.Generic.IReadOnlyDictionary valueDictionary = null, Azure.AI.DocumentIntelligence.CurrencyValue valueCurrency = null, Azure.AI.DocumentIntelligence.AddressValue valueAddress = null, bool? valueBoolean = default(bool?), System.Collections.Generic.IEnumerable valueSelectionGroup = null, 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.DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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.DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), string apiVersion = null, string baseClassifierId = null, System.Collections.Generic.IReadOnlyDictionary documentTypes = null, System.Collections.Generic.IEnumerable warnings = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentField DocumentField(Azure.AI.DocumentIntelligence.DocumentFieldType fieldType = default(Azure.AI.DocumentIntelligence.DocumentFieldType), string valueString = null, System.DateTimeOffset? valueDate = default(System.DateTimeOffset?), System.TimeSpan? valueTime = default(System.TimeSpan?), string valuePhoneNumber = null, double? valueDouble = default(double?), long? valueInt64 = 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 valueList = null, Azure.AI.DocumentIntelligence.DocumentFieldDictionary valueDictionary = null, Azure.AI.DocumentIntelligence.CurrencyValue valueCurrency = null, Azure.AI.DocumentIntelligence.AddressValue valueAddress = null, bool? valueBoolean = default(bool?), System.Collections.Generic.IEnumerable valueSelectionGroup = null, 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.DocumentFieldDictionary DocumentFieldDictionary(System.Collections.Generic.IReadOnlyDictionary items) { 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, string id = 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.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 = default(Azure.AI.DocumentIntelligence.DocumentSpan), 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.DocumentIntelligenceInnerError innerError = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError DocumentIntelligenceInnerError(string code = null, string message = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError innerError = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails DocumentIntelligenceOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), string kind = null, 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.DocumentIntelligenceResourceDetails DocumentIntelligenceResourceDetails(Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails customDocumentModels = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentIntelligenceWarning DocumentIntelligenceWarning(string code = null, string message = null, string target = 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.DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = 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, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IReadOnlyDictionary docTypes = null, System.Collections.Generic.IEnumerable warnings = null, float? trainingHours = default(float?)) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = 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.BlobContentSource blobSource = null, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource = null, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IReadOnlyDictionary documentTypes = null, System.Collections.Generic.IEnumerable warnings = null, float? trainingHours = default(float?)) { 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.DocumentSelectionMark DocumentSelectionMark(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState state = default(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState), System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = default(Azure.AI.DocumentIntelligence.DocumentSpan), 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.DocumentFontStyle? fontStyle = default(Azure.AI.DocumentIntelligence.DocumentFontStyle?), Azure.AI.DocumentIntelligence.DocumentFontWeight? fontWeight = default(Azure.AI.DocumentIntelligence.DocumentFontWeight?), 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.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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), string kind = null, 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.ResourceDetails ResourceDetails(Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails customDocumentModels = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentWord DocumentWord(string content = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = default(Azure.AI.DocumentIntelligence.DocumentSpan), float confidence = 0f) { throw null; } + } + public abstract partial class DocumentIntelligenceOperationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DocumentIntelligenceOperationDetails(string operationId, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status, System.DateTimeOffset createdOn, System.DateTimeOffset lastUpdatedOn, System.Uri resourceLocation) { } + public string ApiVersion { get { throw null; } } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } + public string OperationId { get { throw null; } } + public int? PercentCompleted { get { throw null; } } + public System.Uri ResourceLocation { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentIntelligenceOperationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentIntelligenceOperationStatus(string value) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Canceled { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Failed { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus NotStarted { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Running { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Skipped { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Succeeded { get { throw null; } } + public bool Equals(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus 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.DocumentIntelligenceOperationStatus left, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus right) { throw null; } + public static implicit operator Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus (string value) { throw null; } + public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus left, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DocumentIntelligenceResourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentIntelligenceResourceDetails() { } + public Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModels { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceResourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceResourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentIntelligenceWarning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -921,9 +1045,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentModelBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentModelBuildOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentModelBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentModelBuildOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -932,9 +1056,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentModelComposeOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentModelComposeOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentModelComposeOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelComposeOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentModelComposeOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -943,9 +1067,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentModelCopyToOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentModelCopyToOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentModelCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentModelCopyToOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -958,15 +1082,16 @@ public partial class DocumentModelDetails : System.ClientModel.Primitives.IJsonM { 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.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentBuildMode? BuildMode { get { throw null; } } public string ClassifierId { get { throw null; } } public System.DateTimeOffset CreatedOn { get { throw null; } } public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DocumentTypes { get { throw null; } } public System.DateTimeOffset? ExpiresOn { get { throw null; } } public string ModelId { get { throw null; } } + public System.DateTimeOffset? ModifiedOn { get { throw null; } } public Azure.AI.DocumentIntelligence.SplitMode? Split { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } public float? TrainingHours { get { throw null; } } @@ -1075,17 +1200,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentSpan : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentSpan() { } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentSpan() { throw null; } public int Length { get { throw null; } } public int Offset { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentSpan System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + object System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentSpan System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + object System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentStyle : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1195,19 +1327,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class InnerError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal InnerError() { } - public string Code { get { throw null; } } - public Azure.AI.DocumentIntelligence.InnerError InnerErrorObject { get { throw null; } } - public string Message { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.InnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.InnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LengthUnit : System.IEquatable { @@ -1226,46 +1345,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ModelCopyAuthorization : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - protected OperationDetails(string operationId, Azure.AI.DocumentIntelligence.OperationStatus status, System.DateTimeOffset createdOn, System.DateTimeOffset lastUpdatedOn, System.Uri resourceLocation) { } - public string ApiVersion { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } - public System.DateTimeOffset LastUpdatedOn { get { throw null; } } - public string 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; } } + public ModelCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, System.Uri targetModelLocation, string accessToken, System.DateTimeOffset expiresOn) { } + public string AccessToken { get { throw null; } set { } } + public System.DateTimeOffset ExpiresOn { 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 { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.OperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.OperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 Completed { 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; } + Azure.AI.DocumentIntelligence.ModelCopyAuthorization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.ModelCopyAuthorization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ParagraphRole : System.IEquatable @@ -1290,17 +1384,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 ResourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ResourceDetails() { } - public Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModels { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ResourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ResourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SplitMode : System.IEquatable { @@ -1320,25 +1403,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 { 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 index 7cfdd97ec19a..1453566d6d12 100644 --- 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 @@ -24,39 +24,50 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AnalyzeBatchDocumentsContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public AnalyzeBatchDocumentsContent(System.Uri resultContainerUrl) { } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } + public partial class AnalyzeBatchDocumentsOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AnalyzeBatchDocumentsOptions(string modelId, Azure.AI.DocumentIntelligence.BlobContentSource blobSource, System.Uri resultContainerUri) { } + public AnalyzeBatchDocumentsOptions(string modelId, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource, System.Uri resultContainerUri) { } + public Azure.AI.DocumentIntelligence.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } + public System.Collections.Generic.ICollection Features { get { throw null; } } + public string Locale { get { throw null; } set { } } + public string ModelId { get { throw null; } } + public System.Collections.Generic.ICollection Output { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentContentFormat? OutputContentFormat { get { throw null; } set { } } public bool? OverwriteExisting { get { throw null; } set { } } - public System.Uri ResultContainerUrl { get { throw null; } } + public string Pages { get { throw null; } set { } } + public System.Collections.Generic.ICollection QueryFields { get { throw null; } } + public System.Uri ResultContainerUri { get { throw null; } } public string ResultPrefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AnalyzeBatchOperationDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AnalyzeBatchOperationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal AnalyzeBatchOperationDetail() { } + internal AnalyzeBatchOperationDetails() { } + public System.DateTimeOffset CreatedOn { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } - public System.Uri ResultUrl { get { throw null; } } - public System.Uri SourceUrl { get { throw null; } } - public Azure.AI.DocumentIntelligence.OperationStatus Status { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } + public int? PercentCompleted { get { throw null; } } + public Azure.AI.DocumentIntelligence.AnalyzeBatchResult Result { get { throw null; } } + public string ResultId { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Status { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class AnalyzeBatchResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AnalyzeBatchResult() { } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } public int FailedCount { get { throw null; } } public int SkippedCount { get { throw null; } } public int SucceededCount { get { throw null; } } @@ -67,13 +78,27 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AnalyzeBatchResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AnalyzeBatchResultDetails() { } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } + public System.Uri ResultUri { get { throw null; } } + public System.Uri SourceUri { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeBatchResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class AnalyzedDocument : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { 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 string DocumentType { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentFieldDictionary Fields { get { throw null; } } public System.Collections.Generic.IReadOnlyList Spans { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.AnalyzedDocument System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -82,17 +107,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AnalyzeDocumentContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AnalyzeDocumentOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AnalyzeDocumentContent() { } - public System.BinaryData Base64Source { get { throw null; } set { } } - public System.Uri UrlSource { get { throw null; } set { } } + public AnalyzeDocumentOptions(string modelId, System.BinaryData bytesSource) { } + public AnalyzeDocumentOptions(string modelId, System.Uri uriSource) { } + public System.BinaryData BytesSource { get { throw null; } } + public System.Collections.Generic.ICollection Features { get { throw null; } } + public string Locale { get { throw null; } set { } } + public string ModelId { get { throw null; } } + public System.Collections.Generic.ICollection Output { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentContentFormat? OutputContentFormat { get { throw null; } set { } } + public string Pages { get { throw null; } set { } } + public System.Collections.Generic.ICollection QueryFields { get { throw null; } } + public System.Uri UriSource { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeDocumentContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AnalyzeDocumentContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AnalyzeOutputOption : System.IEquatable @@ -117,7 +150,7 @@ public partial class AnalyzeResult : System.ClientModel.Primitives.IJsonModel Documents { get { throw null; } } public System.Collections.Generic.IReadOnlyList Figures { get { throw null; } } public System.Collections.Generic.IReadOnlyList KeyValuePairs { get { throw null; } } @@ -126,7 +159,6 @@ internal AnalyzeResult() { } 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 System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } @@ -137,106 +169,114 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AuthorizeClassifierCopyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AuthorizeClassifierCopyOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AuthorizeClassifierCopyContent(string classifierId) { } + public AuthorizeClassifierCopyOptions(string classifierId) { } public string ClassifierId { get { throw null; } } public string Description { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AuthorizeCopyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AuthorizeModelCopyOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AuthorizeCopyContent(string modelId) { } + public AuthorizeModelCopyOptions(string modelId) { } public string Description { get { throw null; } set { } } public string ModelId { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeCopyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AuthorizeCopyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzureBlobContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BlobContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureBlobContentSource(System.Uri containerUrl) { } - public System.Uri ContainerUrl { get { throw null; } set { } } + public BlobContentSource(System.Uri containerUri) { } + public System.Uri ContainerUri { get { throw null; } set { } } public string Prefix { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BlobContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BlobContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class AzureBlobFileListContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BlobFileListContentSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public AzureBlobFileListContentSource(System.Uri containerUrl, string fileList) { } - public System.Uri ContainerUrl { get { throw null; } set { } } + public BlobFileListContentSource(System.Uri containerUri, string fileList) { } + public System.Uri ContainerUri { get { throw null; } set { } } public string FileList { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BlobFileListContentSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BlobFileListContentSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BoundingRegion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BoundingRegion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel, System.ClientModel.Primitives.IPersistableModel { - internal BoundingRegion() { } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BoundingRegion() { throw null; } public int PageNumber { get { throw null; } } public System.Collections.Generic.IReadOnlyList Polygon { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.BoundingRegion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + object System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.BoundingRegion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + object System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BuildDocumentClassifierContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BuildClassifierOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BuildDocumentClassifierContent(string classifierId, System.Collections.Generic.IDictionary docTypes) { } + public BuildClassifierOptions(string classifierId, System.Collections.Generic.IDictionary documentTypes) { } public bool? AllowOverwrite { get { throw null; } set { } } public string BaseClassifierId { get { throw null; } set { } } public string ClassifierId { get { throw null; } } public string Description { get { throw null; } set { } } - public System.Collections.Generic.IDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IDictionary DocumentTypes { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentClassifierContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentClassifierContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BuildClassifierOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BuildClassifierOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BuildDocumentModelContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class BuildDocumentModelOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public BuildDocumentModelContent(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode) { } + public BuildDocumentModelOptions(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode, Azure.AI.DocumentIntelligence.BlobContentSource blobSource) { } + public BuildDocumentModelOptions(string modelId, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource) { } public bool? AllowOverwrite { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } + public Azure.AI.DocumentIntelligence.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentBuildMode BuildMode { get { throw null; } } public string Description { get { throw null; } set { } } public float? MaxTrainingHours { get { throw null; } set { } } public string ModelId { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentModelContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.BuildDocumentModelContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.BuildDocumentModelOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.BuildDocumentModelOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ClassifierCopyAuthorization : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, System.Uri targetClassifierLocation, string accessToken, System.DateTimeOffset expirationDateTime) { } + public ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, System.Uri targetClassifierLocation, string accessToken, System.DateTimeOffset expiresOn) { } public string AccessToken { get { throw null; } set { } } - public System.DateTimeOffset ExpirationDateTime { get { throw null; } set { } } + public System.DateTimeOffset ExpiresOn { get { throw null; } set { } } public string TargetClassifierId { get { throw null; } set { } } public System.Uri TargetClassifierLocation { get { throw null; } set { } } public string TargetResourceId { get { throw null; } set { } } @@ -250,9 +290,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ClassifierDocumentTypeDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClassifierDocumentTypeDetails() { } - public Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource AzureBlobFileListSource { get { throw null; } set { } } - public Azure.AI.DocumentIntelligence.AzureBlobContentSource AzureBlobSource { get { throw null; } set { } } + public ClassifierDocumentTypeDetails(Azure.AI.DocumentIntelligence.BlobContentSource blobSource) { } + public ClassifierDocumentTypeDetails(Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource) { } + public Azure.AI.DocumentIntelligence.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } public Azure.AI.DocumentIntelligence.ContentSourceKind? SourceKind { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.ClassifierDocumentTypeDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -261,51 +302,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ClassifyDocumentContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ClassifyDocumentOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ClassifyDocumentContent() { } - public System.BinaryData Base64Source { get { throw null; } set { } } - public System.Uri UrlSource { get { throw null; } set { } } + public ClassifyDocumentOptions(string classifierId, System.BinaryData bytesSource) { } + public ClassifyDocumentOptions(string classifierId, System.Uri uriSource) { } + public System.BinaryData BytesSource { get { throw null; } } + public string ClassifierId { get { throw null; } } + public string Pages { get { throw null; } set { } } + public Azure.AI.DocumentIntelligence.SplitMode? Split { get { throw null; } set { } } + public System.Uri UriSource { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ClassifyDocumentContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ClassifyDocumentContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.AI.DocumentIntelligence.ClassifyDocumentOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.ClassifyDocumentOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ComposeDocumentModelContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ComposeModelOptions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ComposeDocumentModelContent(string modelId, string classifierId, System.Collections.Generic.IDictionary docTypes) { } + public ComposeModelOptions(string modelId, string classifierId, System.Collections.Generic.IDictionary documentTypes) { } public string ClassifierId { get { throw null; } } public string Description { get { throw null; } set { } } - public System.Collections.Generic.IDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IDictionary DocumentTypes { get { throw null; } } public string ModelId { get { throw null; } } public Azure.AI.DocumentIntelligence.SplitMode? Split { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ComposeDocumentModelContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ComposeDocumentModelContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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; } + Azure.AI.DocumentIntelligence.ComposeModelOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.ComposeModelOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContentSourceKind : System.IEquatable @@ -313,10 +340,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 static Azure.AI.DocumentIntelligence.ContentSourceKind Blob { get { throw null; } } + public static Azure.AI.DocumentIntelligence.ContentSourceKind BlobFileList { get { throw null; } } + public static Azure.AI.DocumentIntelligence.ContentSourceKind Bytes { get { throw null; } } + public static Azure.AI.DocumentIntelligence.ContentSourceKind Uri { 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; } @@ -327,22 +354,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - 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 { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.CopyAuthorization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.CopyAuthorization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class CurrencyValue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal CurrencyValue() { } @@ -375,12 +386,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 FontStyling { 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; } @@ -445,7 +456,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public DocumentBuildMode(string value) { throw null; } - public static Azure.AI.DocumentIntelligence.DocumentBuildMode Generative { get { 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; } @@ -472,9 +482,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentClassifierBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentClassifierBuildOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentClassifierBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentClassifierBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentClassifierDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentClassifierBuildOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -483,9 +493,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentClassifierCopyToOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentClassifierCopyToOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentClassifierCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentClassifierCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentClassifierDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentClassifierCopyToOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -502,8 +512,9 @@ internal DocumentClassifierDetails() { } public string ClassifierId { get { throw null; } } public System.DateTimeOffset CreatedOn { get { throw null; } } public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DocumentTypes { get { throw null; } } public System.DateTimeOffset? ExpiresOn { get { throw null; } } + public System.DateTimeOffset? ModifiedOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentClassifierDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -512,23 +523,41 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentContentFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentContentFormat(string value) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentContentFormat Markdown { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentContentFormat Text { get { throw null; } } + public bool Equals(Azure.AI.DocumentIntelligence.DocumentContentFormat 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.DocumentContentFormat left, Azure.AI.DocumentIntelligence.DocumentContentFormat right) { throw null; } + public static implicit operator Azure.AI.DocumentIntelligence.DocumentContentFormat (string value) { throw null; } + public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentContentFormat left, Azure.AI.DocumentIntelligence.DocumentContentFormat right) { throw null; } + public override string ToString() { throw null; } + } public partial class DocumentField : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal DocumentField() { } public System.Collections.Generic.IReadOnlyList BoundingRegions { get { throw null; } } public float? Confidence { get { throw null; } } public string Content { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentFieldType FieldType { 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 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 System.Collections.Generic.IReadOnlyDictionary ValueDictionary { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentFieldDictionary ValueDictionary { get { throw null; } } public double? ValueDouble { get { throw null; } } + public long? ValueInt64 { get { throw null; } } public System.Collections.Generic.IReadOnlyList ValueList { get { throw null; } } - public long? ValueLong { get { throw null; } } public string ValuePhoneNumber { get { throw null; } } public System.Collections.Generic.IReadOnlyList ValueSelectionGroup { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentSelectionMarkState? ValueSelectionMark { get { throw null; } } @@ -542,14 +571,26 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DocumentFieldDictionary : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.Generic.IReadOnlyDictionary, System.Collections.IEnumerable + { + internal DocumentFieldDictionary() { } + public int Count { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentField this[string key] { get { throw null; } } + public System.Collections.Generic.IEnumerable Keys { get { throw null; } } + public System.Collections.Generic.IEnumerable Values { get { throw null; } } + public bool ContainsKey(string key) { throw null; } + public System.Collections.Generic.IEnumerator> GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + public bool TryGetValue(string key, out Azure.AI.DocumentIntelligence.DocumentField value) { throw null; } + } public partial class DocumentFieldSchema : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DocumentFieldSchema(Azure.AI.DocumentIntelligence.DocumentFieldType type) { } + public DocumentFieldSchema(Azure.AI.DocumentIntelligence.DocumentFieldType fieldType) { } public string Description { get { throw null; } set { } } public string Example { get { throw null; } set { } } + public Azure.AI.DocumentIntelligence.DocumentFieldType FieldType { get { throw null; } set { } } public Azure.AI.DocumentIntelligence.DocumentFieldSchema Items { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentFieldType Type { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentFieldSchema System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -570,8 +611,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.AI.DocumentIntelligence.DocumentFieldType Date { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType Dictionary { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType Double { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentFieldType Int64 { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType List { get { throw null; } } - public static Azure.AI.DocumentIntelligence.DocumentFieldType Long { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType PhoneNumber { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType SelectionGroup { get { throw null; } } public static Azure.AI.DocumentIntelligence.DocumentFieldType SelectionMark { get { throw null; } } @@ -695,33 +736,33 @@ public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Azure public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Response AuthorizeClassifierCopy(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AuthorizeClassifierCopy(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response AuthorizeClassifierCopy(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AuthorizeClassifierCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AuthorizeClassifierCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task AuthorizeClassifierCopyAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response AuthorizeModelCopy(Azure.AI.DocumentIntelligence.AuthorizeCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AuthorizeModelCopy(Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions options, 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.AuthorizeCopyContent authorizeCopyRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AuthorizeModelCopyAsync(Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions options, 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.BuildDocumentClassifierContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation BuildClassifier(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildClassifierOptions options, 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.BuildDocumentClassifierContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BuildClassifierAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildClassifierOptions options, 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.BuildDocumentModelContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation BuildDocumentModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelOptions options, 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.BuildDocumentModelContent buildRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> BuildDocumentModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.BuildDocumentModelOptions options, 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.ComposeDocumentModelContent composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation ComposeModel(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeModelOptions options, 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.ComposeDocumentModelContent composeRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ComposeModelAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ComposeModelOptions options, 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 CopyClassifierTo(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization copyToRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation CopyClassifierTo(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization authorization, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation CopyClassifierTo(Azure.WaitUntil waitUntil, string classifierId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CopyClassifierToAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization copyToRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CopyClassifierToAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifierCopyAuthorization authorization, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CopyClassifierToAsync(Azure.WaitUntil waitUntil, string classifierId, 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.AI.DocumentIntelligence.ModelCopyAuthorization authorization, 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.AI.DocumentIntelligence.ModelCopyAuthorization authorization, 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; } @@ -744,17 +785,17 @@ public DocumentIntelligenceAdministrationClient(System.Uri endpoint, Azure.Core. 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(string operationId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetOperation(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetOperation(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task GetOperationAsync(string operationId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetOperationAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperationAsync(string 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.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 virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetResourceDetails(Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetResourceDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetResourceDetailsAsync(Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetResourceDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DocumentIntelligenceClient { @@ -764,33 +805,49 @@ public DocumentIntelligenceClient(System.Uri endpoint, Azure.AzureKeyCredential public DocumentIntelligenceClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } public DocumentIntelligenceClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Operation AnalyzeBatchDocuments(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent analyzeBatchRequest = 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeBatchDocuments(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Operation AnalyzeBatchDocuments(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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AnalyzeBatchDocumentsAsync(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsContent analyzeBatchRequest = 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeBatchDocumentsAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AnalyzeBatchDocumentsAsync(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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentContent 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions options, 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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, Azure.AI.DocumentIntelligence.AnalyzeDocumentContent 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.Collections.Generic.IEnumerable output = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, System.BinaryData bytesSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation AnalyzeDocument(Azure.WaitUntil waitUntil, string modelId, System.Uri uriSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions options, 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, System.Collections.Generic.IEnumerable output = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Operation ClassifyDocument(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifyDocumentContent classifyRequest, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), string pages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, System.BinaryData bytesSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalyzeDocumentAsync(Azure.WaitUntil waitUntil, string modelId, System.Uri uriSource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Operation ClassifyDocument(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ClassifyDocumentOptions options, 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, string pages = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> ClassifyDocumentAsync(Azure.WaitUntil waitUntil, string classifierId, Azure.AI.DocumentIntelligence.ClassifyDocumentContent classifyRequest, Azure.AI.DocumentIntelligence.StringIndexType? stringIndexType = default(Azure.AI.DocumentIntelligence.StringIndexType?), Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), string pages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ClassifyDocumentAsync(Azure.WaitUntil waitUntil, Azure.AI.DocumentIntelligence.ClassifyDocumentOptions options, 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, string pages = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response GetAnalyzeResultFigure(string modelId, System.Guid resultId, string figureId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAnalyzeResultFigure(string modelId, System.Guid resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetAnalyzeResultFigureAsync(string modelId, System.Guid resultId, string figureId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAnalyzeResultFigureAsync(string modelId, System.Guid resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetAnalyzeResultPdf(string modelId, System.Guid resultId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAnalyzeResultPdf(string modelId, System.Guid resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetAnalyzeResultPdfAsync(string modelId, System.Guid resultId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAnalyzeResultPdfAsync(string modelId, System.Guid resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteAnalyzeBatchResult(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAnalyzeBatchResultAsync(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response DeleteAnalyzeResult(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAnalyzeResultAsync(string modelId, string resultId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetAnalyzeBatchResult(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAnalyzeBatchResult(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAnalyzeBatchResultAsync(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAnalyzeBatchResultAsync(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAnalyzeBatchResults(string modelId, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetAnalyzeBatchResults(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAnalyzeBatchResultsAsync(string modelId, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetAnalyzeBatchResultsAsync(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAnalyzeResultFigure(string modelId, string resultId, string figureId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAnalyzeResultFigure(string modelId, string resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAnalyzeResultFigureAsync(string modelId, string resultId, string figureId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAnalyzeResultFigureAsync(string modelId, string resultId, string figureId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAnalyzeResultPdf(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAnalyzeResultPdf(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAnalyzeResultPdfAsync(string modelId, string resultId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAnalyzeResultPdfAsync(string modelId, string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DocumentIntelligenceClientOptions : Azure.Core.ClientOptions { - public DocumentIntelligenceClientOptions(Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion version = Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion.V2024_07_31_Preview) { } + public DocumentIntelligenceClientOptions(Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion version = Azure.AI.DocumentIntelligence.DocumentIntelligenceClientOptions.ServiceVersion.V2024_11_30) { } public enum ServiceVersion { - V2024_07_31_Preview = 1, + V2024_11_30 = 1, } } public partial class DocumentIntelligenceError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -798,7 +855,7 @@ public partial class DocumentIntelligenceError : System.ClientModel.Primitives.I 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 Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError InnerError { get { throw null; } } public string Message { get { throw null; } } public string Target { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -808,53 +865,120 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DocumentIntelligenceInnerError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentIntelligenceInnerError() { } + public string Code { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError InnerError { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class DocumentIntelligenceModelFactory { 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.AnalyzeBatchDocumentsContent AnalyzeBatchDocumentsContent(Azure.AI.DocumentIntelligence.AzureBlobContentSource azureBlobSource = null, Azure.AI.DocumentIntelligence.AzureBlobFileListContentSource azureBlobFileListSource = null, System.Uri resultContainerUrl = null, string resultPrefix = null, bool? overwriteExisting = default(bool?)) { throw null; } - public static Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetail AnalyzeBatchOperationDetail(Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), System.Uri sourceUrl = null, System.Uri resultUrl = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AnalyzeBatchResult AnalyzeBatchResult(int succeededCount = 0, int failedCount = 0, int skippedCount = 0, System.Collections.Generic.IEnumerable details = 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 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, System.Collections.Generic.IEnumerable warnings = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyContent AuthorizeClassifierCopyContent(string classifierId = null, string description = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.AI.DocumentIntelligence.AuthorizeCopyContent AuthorizeCopyContent(string modelId = null, string description = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions AnalyzeBatchDocumentsOptions(Azure.AI.DocumentIntelligence.BlobContentSource blobSource = null, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource = null, System.Uri resultContainerUri = null, string resultPrefix = null, bool? overwriteExisting = default(bool?)) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchOperationDetails AnalyzeBatchOperationDetails(string resultId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), int? percentCompleted = default(int?), Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null, Azure.AI.DocumentIntelligence.AnalyzeBatchResult result = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchResult AnalyzeBatchResult(int succeededCount = 0, int failedCount = 0, int skippedCount = 0, System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeBatchResultDetails AnalyzeBatchResultDetails(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), System.Uri sourceUri = null, System.Uri resultUri = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceError error = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzedDocument AnalyzedDocument(string documentType = null, System.Collections.Generic.IEnumerable boundingRegions = null, System.Collections.Generic.IEnumerable spans = null, Azure.AI.DocumentIntelligence.DocumentFieldDictionary fields = null, float confidence = 0f) { throw null; } + public static Azure.AI.DocumentIntelligence.AnalyzeResult AnalyzeResult(string apiVersion = null, string modelId = null, Azure.AI.DocumentIntelligence.DocumentContentFormat? contentFormat = default(Azure.AI.DocumentIntelligence.DocumentContentFormat?), 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 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, System.Collections.Generic.IEnumerable warnings = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions AuthorizeClassifierCopyOptions(string classifierId = null, string description = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions AuthorizeModelCopyOptions(string modelId = null, string description = null, System.Collections.Generic.IDictionary tags = 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.BuildDocumentClassifierContent BuildDocumentClassifierContent(string classifierId = null, string description = null, string baseClassifierId = null, System.Collections.Generic.IDictionary docTypes = null, bool? allowOverwrite = default(bool?)) { throw null; } - public static Azure.AI.DocumentIntelligence.BuildDocumentModelContent BuildDocumentModelContent(string modelId = null, string description = 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.IDictionary tags = null, float? maxTrainingHours = default(float?), bool? allowOverwrite = default(bool?)) { throw null; } - public static Azure.AI.DocumentIntelligence.ComposeDocumentModelContent ComposeDocumentModelContent(string modelId = null, string description = null, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IDictionary docTypes = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.AI.DocumentIntelligence.BuildClassifierOptions BuildClassifierOptions(string classifierId = null, string description = null, string baseClassifierId = null, System.Collections.Generic.IDictionary documentTypes = null, bool? allowOverwrite = default(bool?)) { throw null; } + public static Azure.AI.DocumentIntelligence.BuildDocumentModelOptions BuildDocumentModelOptions(string modelId = null, string description = null, Azure.AI.DocumentIntelligence.DocumentBuildMode buildMode = default(Azure.AI.DocumentIntelligence.DocumentBuildMode), Azure.AI.DocumentIntelligence.BlobContentSource blobSource = null, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource = null, System.Collections.Generic.IDictionary tags = null, float? maxTrainingHours = default(float?), bool? allowOverwrite = default(bool?)) { throw null; } + public static Azure.AI.DocumentIntelligence.ComposeModelOptions ComposeModelOptions(string modelId = null, string description = null, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IDictionary documentTypes = null, System.Collections.Generic.IDictionary tags = 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.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 = default(Azure.AI.DocumentIntelligence.DocumentSpan), 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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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.DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), string apiVersion = null, string baseClassifierId = null, System.Collections.Generic.IReadOnlyDictionary docTypes = null, System.Collections.Generic.IEnumerable warnings = 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? valueDouble = default(double?), long? valueLong = 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 valueList = null, System.Collections.Generic.IReadOnlyDictionary valueDictionary = null, Azure.AI.DocumentIntelligence.CurrencyValue valueCurrency = null, Azure.AI.DocumentIntelligence.AddressValue valueAddress = null, bool? valueBoolean = default(bool?), System.Collections.Generic.IEnumerable valueSelectionGroup = null, 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.DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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.DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), string apiVersion = null, string baseClassifierId = null, System.Collections.Generic.IReadOnlyDictionary documentTypes = null, System.Collections.Generic.IEnumerable warnings = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentField DocumentField(Azure.AI.DocumentIntelligence.DocumentFieldType fieldType = default(Azure.AI.DocumentIntelligence.DocumentFieldType), string valueString = null, System.DateTimeOffset? valueDate = default(System.DateTimeOffset?), System.TimeSpan? valueTime = default(System.TimeSpan?), string valuePhoneNumber = null, double? valueDouble = default(double?), long? valueInt64 = 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 valueList = null, Azure.AI.DocumentIntelligence.DocumentFieldDictionary valueDictionary = null, Azure.AI.DocumentIntelligence.CurrencyValue valueCurrency = null, Azure.AI.DocumentIntelligence.AddressValue valueAddress = null, bool? valueBoolean = default(bool?), System.Collections.Generic.IEnumerable valueSelectionGroup = null, 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.DocumentFieldDictionary DocumentFieldDictionary(System.Collections.Generic.IReadOnlyDictionary items) { 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, string id = 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.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 = default(Azure.AI.DocumentIntelligence.DocumentSpan), 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.DocumentIntelligenceInnerError innerError = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError DocumentIntelligenceInnerError(string code = null, string message = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceInnerError innerError = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails DocumentIntelligenceOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), string kind = null, 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.DocumentIntelligenceResourceDetails DocumentIntelligenceResourceDetails(Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails customDocumentModels = null) { throw null; } public static Azure.AI.DocumentIntelligence.DocumentIntelligenceWarning DocumentIntelligenceWarning(string code = null, string message = null, string target = 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.DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = 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, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IReadOnlyDictionary docTypes = null, System.Collections.Generic.IEnumerable warnings = null, float? trainingHours = default(float?)) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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(string operationId = null, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status = default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = 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 createdOn = default(System.DateTimeOffset), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = 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.BlobContentSource blobSource = null, Azure.AI.DocumentIntelligence.BlobFileListContentSource blobFileListSource = null, string classifierId = null, Azure.AI.DocumentIntelligence.SplitMode? split = default(Azure.AI.DocumentIntelligence.SplitMode?), System.Collections.Generic.IReadOnlyDictionary documentTypes = null, System.Collections.Generic.IEnumerable warnings = null, float? trainingHours = default(float?)) { 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.DocumentSelectionMark DocumentSelectionMark(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState state = default(Azure.AI.DocumentIntelligence.DocumentSelectionMarkState), System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = default(Azure.AI.DocumentIntelligence.DocumentSpan), 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.DocumentFontStyle? fontStyle = default(Azure.AI.DocumentIntelligence.DocumentFontStyle?), Azure.AI.DocumentIntelligence.DocumentFontWeight? fontWeight = default(Azure.AI.DocumentIntelligence.DocumentFontWeight?), 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.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(string operationId = null, Azure.AI.DocumentIntelligence.OperationStatus status = default(Azure.AI.DocumentIntelligence.OperationStatus), int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), string kind = null, 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.ResourceDetails ResourceDetails(Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails customDocumentModels = null) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentWord DocumentWord(string content = null, System.Collections.Generic.IEnumerable polygon = null, Azure.AI.DocumentIntelligence.DocumentSpan span = default(Azure.AI.DocumentIntelligence.DocumentSpan), float confidence = 0f) { throw null; } + } + public abstract partial class DocumentIntelligenceOperationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DocumentIntelligenceOperationDetails(string operationId, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus status, System.DateTimeOffset createdOn, System.DateTimeOffset lastUpdatedOn, System.Uri resourceLocation) { } + public string ApiVersion { get { throw null; } } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } + public string OperationId { get { throw null; } } + public int? PercentCompleted { get { throw null; } } + public System.Uri ResourceLocation { get { throw null; } } + public Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentIntelligenceOperationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentIntelligenceOperationStatus(string value) { throw null; } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Canceled { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Failed { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus NotStarted { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Running { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Skipped { get { throw null; } } + public static Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus Succeeded { get { throw null; } } + public bool Equals(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus 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.DocumentIntelligenceOperationStatus left, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus right) { throw null; } + public static implicit operator Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus (string value) { throw null; } + public static bool operator !=(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus left, Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DocumentIntelligenceResourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DocumentIntelligenceResourceDetails() { } + public Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModels { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceResourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.DocumentIntelligenceResourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentIntelligenceWarning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -921,9 +1045,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentModelBuildOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentModelBuildOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentModelBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelBuildOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentModelBuildOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -932,9 +1056,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentModelComposeOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentModelComposeOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentModelComposeOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelComposeOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentModelComposeOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -943,9 +1067,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DocumentModelCopyToOperationDetails : Azure.AI.DocumentIntelligence.OperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DocumentModelCopyToOperationDetails : Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationDetails, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentModelCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.OperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } + internal DocumentModelCopyToOperationDetails() : base (default(string), default(Azure.AI.DocumentIntelligence.DocumentIntelligenceOperationStatus), default(System.DateTimeOffset), default(System.DateTimeOffset), default(System.Uri)) { } public Azure.AI.DocumentIntelligence.DocumentModelDetails Result { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentModelCopyToOperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -958,15 +1082,16 @@ public partial class DocumentModelDetails : System.ClientModel.Primitives.IJsonM { 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.BlobFileListContentSource BlobFileListSource { get { throw null; } } + public Azure.AI.DocumentIntelligence.BlobContentSource BlobSource { get { throw null; } } public Azure.AI.DocumentIntelligence.DocumentBuildMode? BuildMode { get { throw null; } } public string ClassifierId { get { throw null; } } public System.DateTimeOffset CreatedOn { get { throw null; } } public string Description { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DocTypes { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DocumentTypes { get { throw null; } } public System.DateTimeOffset? ExpiresOn { get { throw null; } } public string ModelId { get { throw null; } } + public System.DateTimeOffset? ModifiedOn { get { throw null; } } public Azure.AI.DocumentIntelligence.SplitMode? Split { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } public float? TrainingHours { get { throw null; } } @@ -1075,17 +1200,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DocumentSpan : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel, System.ClientModel.Primitives.IPersistableModel { - internal DocumentSpan() { } + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DocumentSpan() { throw null; } public int Length { get { throw null; } } public int Offset { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentSpan System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + object System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.DocumentIntelligence.DocumentSpan System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + object System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class DocumentStyle : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1195,19 +1327,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class InnerError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal InnerError() { } - public string Code { get { throw null; } } - public Azure.AI.DocumentIntelligence.InnerError InnerErrorObject { get { throw null; } } - public string Message { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.InnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.InnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LengthUnit : System.IEquatable { @@ -1226,46 +1345,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ModelCopyAuthorization : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - protected OperationDetails(string operationId, Azure.AI.DocumentIntelligence.OperationStatus status, System.DateTimeOffset createdOn, System.DateTimeOffset lastUpdatedOn, System.Uri resourceLocation) { } - public string ApiVersion { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public Azure.AI.DocumentIntelligence.DocumentIntelligenceError Error { get { throw null; } } - public System.DateTimeOffset LastUpdatedOn { get { throw null; } } - public string 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; } } + public ModelCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, System.Uri targetModelLocation, string accessToken, System.DateTimeOffset expiresOn) { } + public string AccessToken { get { throw null; } set { } } + public System.DateTimeOffset ExpiresOn { 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 { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.OperationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.OperationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 Completed { 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; } + Azure.AI.DocumentIntelligence.ModelCopyAuthorization System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.DocumentIntelligence.ModelCopyAuthorization System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ParagraphRole : System.IEquatable @@ -1290,17 +1384,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 ResourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ResourceDetails() { } - public Azure.AI.DocumentIntelligence.CustomDocumentModelsDetails CustomDocumentModels { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ResourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.AI.DocumentIntelligence.ResourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SplitMode : System.IEquatable { @@ -1320,25 +1403,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 { diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json index 82a37d28ea5c..55470268ec8b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/documentintelligence/Azure.AI.DocumentIntelligence", - "Tag": "net/documentintelligence/Azure.AI.DocumentIntelligence_ac9b1a968f" + "Tag": "net/documentintelligence/Azure.AI.DocumentIntelligence_9aad7e91a7" } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AddOnCapabilities.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AddOnCapabilities.md index 05821f5b86f3..27d640acf526 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AddOnCapabilities.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AddOnCapabilities.md @@ -2,15 +2,15 @@ This sample demonstrates how to analyze a document with add-on capabilities. For more information about the supported features, see the [service documentation][docint_addon]. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. When analyzing a document, you can specify a list of optional [analysis features][sdk_docfeature] to enable certain add-on capabilities. Some of the capabilities are free, while others incur additional charges, see [pricing][docint_pricing] for more information. ## Creating a `DocumentIntelligenceClient` -To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceClient string endpoint = ""; @@ -27,17 +27,12 @@ To extract formulas from a given file at a URI with the add-on formulas capabili ```C# Snippet:DocumentIntelligenceSampleFormulaExtraction Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() +var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - UrlSource = uriSource + Features = { DocumentAnalysisFeature.Formulas } }; -List features = new List -{ - DocumentAnalysisFeature.Formulas -}; - -var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); +var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -66,17 +61,12 @@ To extract font information from a given file at a URI with the add-on font styl ```C# Snippet:DocumentIntelligenceSampleFontStyling Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -List features = new List +var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - DocumentAnalysisFeature.StyleFont + Features = { DocumentAnalysisFeature.FontStyling } }; -var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); +var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; // Handwritten styles @@ -220,17 +210,12 @@ To extract barcodes from a given file at a URI with the add-on barcodes capabili ```C# Snippet:DocumentIntelligenceSampleBarcodeExtraction Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() +var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - UrlSource = uriSource + Features = { DocumentAnalysisFeature.Barcodes } }; -List features = new List -{ - DocumentAnalysisFeature.Barcodes -}; - -var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); +var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -261,17 +246,12 @@ To detect languages from a given file at a URI with the add-on languages capabil ```C# Snippet:DocumentIntelligenceSampleLanguageDetection Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -List features = new List +var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - DocumentAnalysisFeature.Languages + Features = { DocumentAnalysisFeature.Languages } }; -var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); +var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine("----Languages detected in the document----"); @@ -294,17 +274,12 @@ To extract key-value pairs from a given file at a URI with the add-on keyValuePa ```C# Snippet:DocumentIntelligenceSampleKeyValuePairsExtraction Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -List features = new List +var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - DocumentAnalysisFeature.KeyValuePairs + Features = { DocumentAnalysisFeature.KeyValuePairs } }; -var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); +var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine("----Key Value Pair Options detected in the document----"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AnalyzeWithPrebuiltModel.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AnalyzeWithPrebuiltModel.md index 192bbf5273e4..7cdf55a1abfa 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AnalyzeWithPrebuiltModel.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_AnalyzeWithPrebuiltModel.md @@ -2,13 +2,13 @@ This sample demonstrates how to analyze data from certain types of common documents with prebuilt models, using an invoice as an example. For more information about prebuilt models and which types of documents are supported, see the [service documentation][docint_models]. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceClient` -To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceClient string endpoint = ""; @@ -24,13 +24,7 @@ For simplicity, we are not showing all the fields that the service returns. To s ```C# Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelFromUriAsync Uri uriSource = new Uri(""); - -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", uriSource); AnalyzeResult result = operation.Value; // To see the list of all the supported fields returned by service and its corresponding types for the @@ -44,39 +38,39 @@ for (int i = 0; i < result.Documents.Count; i++) AnalyzedDocument document = result.Documents[i]; if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField) - && vendorNameField.Type == DocumentFieldType.String) + && vendorNameField.FieldType == DocumentFieldType.String) { string vendorName = vendorNameField.ValueString; Console.WriteLine($"Vendor Name: '{vendorName}', with confidence {vendorNameField.Confidence}"); } if (document.Fields.TryGetValue("CustomerName", out DocumentField customerNameField) - && customerNameField.Type == DocumentFieldType.String) + && customerNameField.FieldType == DocumentFieldType.String) { string customerName = customerNameField.ValueString; Console.WriteLine($"Customer Name: '{customerName}', with confidence {customerNameField.Confidence}"); } if (document.Fields.TryGetValue("Items", out DocumentField itemsField) - && itemsField.Type == DocumentFieldType.List) + && itemsField.FieldType == DocumentFieldType.List) { foreach (DocumentField itemField in itemsField.ValueList) { Console.WriteLine("Item:"); - if (itemField.Type == DocumentFieldType.Dictionary) + if (itemField.FieldType == DocumentFieldType.Dictionary) { IReadOnlyDictionary itemFields = itemField.ValueDictionary; if (itemFields.TryGetValue("Description", out DocumentField itemDescriptionField) - && itemDescriptionField.Type == DocumentFieldType.String) + && itemDescriptionField.FieldType == DocumentFieldType.String) { string itemDescription = itemDescriptionField.ValueString; Console.WriteLine($" Description: '{itemDescription}', with confidence {itemDescriptionField.Confidence}"); } if (itemFields.TryGetValue("Amount", out DocumentField itemAmountField) - && itemAmountField.Type == DocumentFieldType.Currency) + && itemAmountField.FieldType == DocumentFieldType.Currency) { CurrencyValue itemAmount = itemAmountField.ValueCurrency; Console.WriteLine($" Amount: '{itemAmount.CurrencySymbol}{itemAmount.Amount}', with confidence {itemAmountField.Confidence}"); @@ -86,21 +80,21 @@ for (int i = 0; i < result.Documents.Count; i++) } if (document.Fields.TryGetValue("SubTotal", out DocumentField subTotalField) - && subTotalField.Type == DocumentFieldType.Currency) + && subTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue subTotal = subTotalField.ValueCurrency; Console.WriteLine($"Sub Total: '{subTotal.CurrencySymbol}{subTotal.Amount}', with confidence {subTotalField.Confidence}"); } if (document.Fields.TryGetValue("TotalTax", out DocumentField totalTaxField) - && totalTaxField.Type == DocumentFieldType.Currency) + && totalTaxField.FieldType == DocumentFieldType.Currency) { CurrencyValue totalTax = totalTaxField.ValueCurrency; Console.WriteLine($"Total Tax: '{totalTax.CurrencySymbol}{totalTax.Amount}', with confidence {totalTaxField.Confidence}"); } if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField) - && invoiceTotalField.Type == DocumentFieldType.Currency) + && invoiceTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency; Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}', with confidence {invoiceTotalField.Confidence}"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildCustomModel.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildCustomModel.md index a902cd6a55f5..b3dee9c57eae 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildCustomModel.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildCustomModel.md @@ -4,13 +4,13 @@ This sample demonstrates how to build a custom model with your own data. A custo Please note that models can also be created using a graphical user interface such as the [Document Intelligence Studio][di_studio]. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceAdministrationClient` -To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceAdministrationClient string endpoint = ""; @@ -44,19 +44,17 @@ Uri blobContainerUri = new Uri(""); // build modes and their differences, see: // https://aka.ms/azsdk/formrecognizer/buildmode -var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) -{ - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) -}; +var blobSource = new BlobContentSource(blobContainerUri); +var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource); -Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, options); DocumentModelDetails model = operation.Value; Console.WriteLine($"Model ID: {model.ModelId}"); Console.WriteLine($"Created on: {model.CreatedOn}"); Console.WriteLine("Document types the model can recognize:"); -foreach (KeyValuePair docType in model.DocTypes) +foreach (KeyValuePair docType in model.DocumentTypes) { Console.WriteLine($" Document type: '{docType.Key}', which has the following fields:"); foreach (KeyValuePair schema in docType.Value.FieldSchema) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildDocumentClassifier.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildDocumentClassifier.md index 4486d3a2a3b2..c922722f8817 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildDocumentClassifier.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_BuildDocumentClassifier.md @@ -4,13 +4,13 @@ This sample demonstrates how to build a document classifier with your own data. Please note that document classifiers can also be created using a graphical user interface such as the [Document Intelligence Studio][di_studio]. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceAdministrationClient` -To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceAdministrationClient string endpoint = ""; @@ -35,26 +35,26 @@ After building, a `DocumentClassifierDetails` instance is returned indicating th string classifierId = ""; Uri blobContainerUri = new Uri(""); -var sourceA = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; -var sourceB = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; -var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; -var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; +var sourceA = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; +var sourceB = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; +var docTypeA = new ClassifierDocumentTypeDetails(sourceA); +var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; -var content = new BuildDocumentClassifierContent(classifierId, docTypes); +var options = new BuildClassifierOptions(classifierId, docTypes); -Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); +Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, options); DocumentClassifierDetails classifier = operation.Value; Console.WriteLine($"Classifier ID: {classifier.ClassifierId}"); Console.WriteLine($"Created on: {classifier.CreatedOn}"); Console.WriteLine("Document types the classifier can recognize:"); -foreach (KeyValuePair docType in classifier.DocTypes) +foreach (KeyValuePair docType in classifier.DocumentTypes) { Console.WriteLine($" {docType.Key}"); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ClassifyDocument.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ClassifyDocument.md index 6bcf6bfa4c7a..420c3bec5d4b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ClassifyDocument.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ClassifyDocument.md @@ -2,13 +2,13 @@ This sample demonstrates how to use document classifiers to accurately detect and identify documents you process within your application. Document classifiers are trained with your own data, so they're tailored to your documents. For more information on how to do the training, see [build a document classifier][build_classifier]. -To get started you'll need a Cognitive Services resource or a Form Recognizer resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceClient` -To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceClient string endpoint = ""; @@ -24,19 +24,16 @@ To classify a given file at a URI, use the `ClassifyDocument` method. The return string classifierId = ""; Uri uriSource = new Uri(""); -var content = new ClassifyDocumentContent() -{ - UrlSource = uriSource -}; +var options = new ClassifyDocumentOptions(classifierId, uriSource); -Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, classifierId, content); +Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine($"Input was classified by the classifier with ID '{result.ModelId}'."); foreach (AnalyzedDocument document in result.Documents) { - Console.WriteLine($"Found a document of type: {document.DocType}"); + Console.WriteLine($"Found a document of type: {document.DocumentType}"); } ``` diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_CopyCustomModel.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_CopyCustomModel.md index a09ad62aa5d4..d9960fcf8188 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_CopyCustomModel.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_CopyCustomModel.md @@ -2,7 +2,7 @@ This sample demonstrates how to copy a custom model between Document Intelligence resources. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Copy a custom model @@ -16,9 +16,9 @@ For this sample, you will copy a model across Document Intelligence resources. I ## Creating the source and target `DocumentIntelligenceAdministrationClient` -To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object. +To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ### Source client @@ -42,11 +42,11 @@ var targetClient = new DocumentIntelligenceAdministrationClient(new Uri(targetEn ### Authorize the copy -Before starting, we need to get a `CopyAuthorization` from the target resource that will give us permission to execute the copy. +Before starting, we need to get a `ModelCopyAuthorization` from the target resource that will give us permission to execute the copy. ```C# Snippet:DocumentIntelligenceSampleGetCopyAuthorization string targetModelId = ""; -var authorizeCopyContent = new AuthorizeCopyContent(targetModelId); -CopyAuthorization copyAuthorization = await targetClient.AuthorizeModelCopyAsync(authorizeCopyContent); +var authorizeCopyOptions = new AuthorizeModelCopyOptions(targetModelId); +ModelCopyAuthorization copyAuthorization = await targetClient.AuthorizeModelCopyAsync(authorizeCopyOptions); ``` ### Execute the copy diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayout.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayout.md index 2d1b1f5f04d2..0e8413df9a82 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayout.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayout.md @@ -2,13 +2,13 @@ This sample demonstrates how to extract text, paragraphs, styles, table structures, and selection marks, along with their bounding region coordinates from documents. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceClient` -To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceClient string endpoint = ""; @@ -22,13 +22,7 @@ To extract the layout from a given file at a URI, use the `AnalyzeDocument` meth ```C# Snippet:DocumentIntelligenceExtractLayoutFromUriAsync Uri uriSource = new Uri(""); - -var content = new AnalyzeDocumentContent() -{ - UrlSource = uriSource -}; - -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", uriSource); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -95,8 +89,8 @@ foreach (DocumentStyle style in result.Styles) foreach (DocumentSpan span in style.Spans) { - var handwrittenContent = result.Content.Substring(span.Offset, span.Length); - Console.WriteLine($" {handwrittenContent}"); + var handwrittenOptions = result.Content.Substring(span.Offset, span.Length); + Console.WriteLine($" {handwrittenOptions}"); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayoutAsMarkdown.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayoutAsMarkdown.md index 0dd816583ebe..8911a8a2ca95 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayoutAsMarkdown.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ExtractLayoutAsMarkdown.md @@ -2,13 +2,13 @@ This sample demonstrates how to extract text, paragraphs, styles, table structures, and selection marks, along with their bounding region coordinates from documents, presenting the output text in Markdown syntax. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceClient` -To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceClient string endpoint = ""; @@ -18,17 +18,17 @@ var client = new DocumentIntelligenceClient(new Uri(endpoint), credential); ## Extract the layout of a document as Markdown -To extract the layout from a given file at a URI, use the `AnalyzeDocument` method and pass `prebuilt-layout` as the model ID. The output format can be selected with the optional parameter `outputContentFormat`, which we will set to `Markdown` in the sample below. The returned value is an `AnalyzeResult` object containing data about the submitted document. +To extract the layout from a given file at a URI, use the `AnalyzeDocument` method and pass `prebuilt-layout` as the model ID. The output format can be selected with the option `OutputContentFormat`, which we will set to `Markdown` in the sample below. The returned value is an `AnalyzeResult` object containing data about the submitted document. ```C# Snippet:DocumentIntelligenceExtractLayoutAsMarkdownAsync Uri uriSource = new Uri(""); -var content = new AnalyzeDocumentContent() +var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - UrlSource = uriSource + OutputContentFormat = DocumentContentFormat.Markdown }; -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, outputContentFormat: ContentFormat.Markdown); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine(result.Content); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_GetAndListOperations.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_GetAndListOperations.md index 4f261237cf1e..22a8c57f2237 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_GetAndListOperations.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_GetAndListOperations.md @@ -2,13 +2,13 @@ This sample demonstrates how to get and list operations of a Document Intelligence resource. Note that operation information only persists for 24 hours. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceAdministrationClient` -To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceAdministrationClient string endpoint = ""; @@ -18,22 +18,23 @@ var client = new DocumentIntelligenceAdministrationClient(new Uri(endpoint), cre ## Get and List Document Model Operations -The method `GetOperations` returns a list of `OperationDetails` instances. The instances returned by this method contain general information about the operation, such as its ID, its status, and the `PercentCompleted` property to track progress, but it does not include details about the result or errors that happened during its execution. +The method `GetOperations` returns a list of `DocumentIntelligenceOperationDetails` instances. The instances returned by this method contain general information about the operation, such as its ID, its status, and the `PercentCompleted` property to track progress, but it does not include details about the result or errors that happened during its execution. -The method `GetOperation` can be called to get these extra properties. It returns a single `OperationDetails` instance, including the result of the operation and errors, if any. However, in order to access the `Result` property, you need to cast it to one of its derived types: +The method `GetOperation` can be called to get these extra properties. It returns a single `DocumentIntelligenceOperationDetails` instance, including the result of the operation and errors, if any. However, in order to access the `Result` property, you need to cast it to one of its derived types: - A `DocumentModelBuildOperationDetails` for `BuildDocumentModel` operations. - A `DocumentModelCopyToOperationDetails` for `CopyModelTo` operations. - A `DocumentModelComposeOperationDetails` for `ComposeModel` operations. - A `DocumentClassifierBuildOperationDetails` for `BuildClassifier` operations. +- A `DocumentClassifierCopyTolOperationDetails` for `CopyClassifierTo` operations. Note that operation information only persists for 24 hours. ```C# Snippet:DocumentIntelligenceSampleGetAndListOperations // Get an operation by ID. string operationId = ""; -OperationDetails operationDetails = await client.GetOperationAsync(operationId); +DocumentIntelligenceOperationDetails operationDetails = await client.GetOperationAsync(operationId); -if (operationDetails.Status == OperationStatus.Succeeded) +if (operationDetails.Status == DocumentIntelligenceOperationStatus.Succeeded) { Console.WriteLine($"Operation with ID '{operationDetails.OperationId}' has succeeded."); @@ -55,9 +56,13 @@ if (operationDetails.Status == OperationStatus.Succeeded) case DocumentClassifierBuildOperationDetails classifierOperation: Console.WriteLine($"Classifier ID: {classifierOperation.Result.ClassifierId}"); break; + + case DocumentClassifierCopyToOperationDetails classifierOperation: + Console.WriteLine($"Classifier ID: {classifierOperation.Result.ClassifierId}"); + break; } } -else if (operationDetails.Status == OperationStatus.Failed) +else if (operationDetails.Status == DocumentIntelligenceOperationStatus.Failed) { Console.WriteLine($"Operation with ID '{operationDetails.OperationId}' has failed."); Console.WriteLine($"Error code: {operationDetails.Error.Code}"); @@ -71,7 +76,7 @@ else // List up to 10 operations that have been executed in the last 24 hours. int count = 0; -await foreach (OperationDetails operationItem in client.GetOperationsAsync()) +await foreach (DocumentIntelligenceOperationDetails operationItem in client.GetOperationsAsync()) { Console.WriteLine($"Operation details:"); Console.WriteLine($" Operation ID: {operationItem.OperationId}"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ManageModels.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ManageModels.md index d29f14b500a8..7419c484e37b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ManageModels.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ManageModels.md @@ -2,13 +2,13 @@ This sample demonstrates how to manage the models stored in your resource. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceAdministrationClient` -To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceAdministrationClient string endpoint = ""; @@ -30,7 +30,7 @@ Supported operations: // Check number of custom models in the Document Intelligence resource, and the maximum number // of custom models that can be stored. -ResourceDetails resourceDetails = await client.GetResourceInfoAsync(); +DocumentIntelligenceResourceDetails resourceDetails = await client.GetResourceDetailsAsync(); Console.WriteLine($"Resource has {resourceDetails.CustomDocumentModels.Count} custom models."); Console.WriteLine($"It can have at most {resourceDetails.CustomDocumentModels.Limit} custom models."); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ModelCompose.md b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ModelCompose.md index c3796d2b90cd..b4df3aaf37a1 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ModelCompose.md +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/samples/Sample_ModelCompose.md @@ -2,13 +2,13 @@ Model compose allows multiple models to be composed and called with a single model ID. This is useful when you have created different models and want to aggregate a group of them into a single model that could be used to analyze a document. When doing so, you can let the service decide which model more accurately represents the document, instead of manually trying each model against the document. -To get started you'll need a Cognitive Services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. +To get started you'll need an Azure AI services resource or a Document Intelligence resource. See [README][README] for prerequisites and instructions. ## Creating a `DocumentIntelligenceAdministrationClient` -To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Document Intelligence API key credential by creating an `AzureKeyCredential` object that, if needed, will allow you to update the API key without creating a new client. +To create a new `DocumentIntelligenceAdministrationClient` you need the endpoint and credentials from your resource. In the sample below you'll make use of identity-based authentication by creating a `DefaultAzureCredential` object. -You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application. +You can set `endpoint` based on an environment variable, a configuration setting, or any way that works for your application. ```C# Snippet:CreateDocumentIntelligenceAdministrationClient string endpoint = ""; @@ -28,46 +28,46 @@ We will be writing an application that collects the expenses a company is making string officeSuppliesModelId = ""; Uri officeSuppliesUri = new Uri(""); -var officeSuppliesContent = new BuildDocumentModelContent(officeSuppliesModelId, DocumentBuildMode.Template) +var officeSuppliesSource = new BlobContentSource(officeSuppliesUri); +var officeSuppliesOptions = new BuildDocumentModelOptions(officeSuppliesModelId, DocumentBuildMode.Template, officeSuppliesSource) { - AzureBlobSource = new AzureBlobContentSource(officeSuppliesUri), Description = "Purchase order - Office supplies" }; -Operation officeSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeSuppliesContent); +Operation officeSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeSuppliesOptions); DocumentModelDetails officeSuppliesModel = officeSuppliesOperation.Value; string officeEquipmentModelId = ""; Uri officeEquipmentUri = new Uri(""); -var officeEquipmentContent = new BuildDocumentModelContent(officeEquipmentModelId, DocumentBuildMode.Template) +var officeEquipmentSource = new BlobContentSource(officeEquipmentUri); +var officeEquipmentOptions = new BuildDocumentModelOptions(officeEquipmentModelId, DocumentBuildMode.Template, officeEquipmentSource) { - AzureBlobSource = new AzureBlobContentSource(officeEquipmentUri), Description = "Purchase order - Office Equipment" }; -Operation officeEquipmentOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeEquipmentContent); +Operation officeEquipmentOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeEquipmentOptions); DocumentModelDetails officeEquipmentModel = officeEquipmentOperation.Value; string furnitureModelId = ""; Uri furnitureUri = new Uri(""); -var furnitureContent = new BuildDocumentModelContent(furnitureModelId, DocumentBuildMode.Template) +var furnitureSource = new BlobContentSource(furnitureUri); +var furnitureOptions = new BuildDocumentModelOptions(furnitureModelId, DocumentBuildMode.Template, furnitureSource) { - AzureBlobSource = new AzureBlobContentSource(furnitureUri), Description = "Purchase order - Furniture" }; -Operation furnitureOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, furnitureContent); +Operation furnitureOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, furnitureOptions); DocumentModelDetails furnitureModel = furnitureOperation.Value; string cleaningSuppliesModelId = ""; Uri cleaningSuppliesUri = new Uri(""); -var cleaningSuppliesContent = new BuildDocumentModelContent(cleaningSuppliesModelId, DocumentBuildMode.Template) +var cleaningSuppliesSource = new BlobContentSource(cleaningSuppliesUri); +var cleaningSuppliesOptions = new BuildDocumentModelOptions(cleaningSuppliesModelId, DocumentBuildMode.Template, cleaningSuppliesSource) { - AzureBlobSource = new AzureBlobContentSource(cleaningSuppliesUri), Description = "Purchase order - Cleaning Supplies" }; -Operation cleaningSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, cleaningSuppliesContent); +Operation cleaningSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, cleaningSuppliesOptions); DocumentModelDetails cleaningSuppliesModel = cleaningSuppliesOperation.Value; ``` @@ -87,12 +87,12 @@ var docTypes = new Dictionary() { "furniture", new DocumentTypeDetails() { ModelId = furnitureModelId } }, { "cleaningSupplies", new DocumentTypeDetails() { ModelId = cleaningSuppliesModelId } } }; -var purchaseOrderContent = new ComposeDocumentModelContent(purchaseOrderModelId, classifierId, docTypes) +var purchaseOrderOptions = new ComposeModelOptions(purchaseOrderModelId, classifierId, docTypes) { Description = "Composed Purchase order" }; -Operation purchaseOrderOperation = await client.ComposeModelAsync(WaitUntil.Completed, purchaseOrderContent); +Operation purchaseOrderOperation = await client.ComposeModelAsync(WaitUntil.Completed, purchaseOrderOptions); DocumentModelDetails purchaseOrderModel = purchaseOrderOperation.Value; Console.WriteLine($"Model ID: {purchaseOrderModel.ModelId}"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeBatchDocumentsOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeBatchDocumentsOptions.cs new file mode 100644 index 000000000000..2f4462e3416c --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeBatchDocumentsOptions.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.AI.DocumentIntelligence +{ + [CodeGenSuppress(nameof(AnalyzeBatchDocumentsOptions), typeof(Uri))] + public partial class AnalyzeBatchDocumentsOptions + { + // CUSTOM CODE NOTE: since either BlobSource or BlobFileListSource must be specified + // when building this object, we're suppressing the creation of one of its constructors, + // adding custom constructors, and making both properties readonly. + + /// Initializes a new instance of . + /// Unique document model name. + /// Azure Blob Storage location containing the batch documents. + /// Azure Blob Storage container URL where analyze result files will be stored. + /// , , or is null. + /// is an empty string, and was expected to be non-empty. + public AnalyzeBatchDocumentsOptions(string modelId, BlobContentSource blobSource, Uri resultContainerUri) : this(modelId) + { + Argument.AssertNotNull(blobSource, nameof(blobSource)); + Argument.AssertNotNull(resultContainerUri, nameof(resultContainerUri)); + + BlobSource = blobSource; + ResultContainerUri = resultContainerUri; + } + + /// Initializes a new instance of . + /// Unique document model name. + /// Azure Blob Storage file list specifying the batch documents. + /// Azure Blob Storage container URL where analyze result files will be stored. + /// , , or is null. + /// is an empty string, and was expected to be non-empty. + public AnalyzeBatchDocumentsOptions(string modelId, BlobFileListContentSource blobFileListSource, Uri resultContainerUri) : this(modelId) + { + Argument.AssertNotNull(blobFileListSource, nameof(blobFileListSource)); + Argument.AssertNotNull(resultContainerUri, nameof(resultContainerUri)); + + BlobFileListSource = blobFileListSource; + ResultContainerUri = resultContainerUri; + } + + // NOTE: keeping this constructor so it doesn't break autogenerated samples. + internal AnalyzeBatchDocumentsOptions(Uri resultContainerUri) + { + } + + private AnalyzeBatchDocumentsOptions(string modelId) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + ModelId = modelId; + Features = new ChangeTrackingList(); + QueryFields = new ChangeTrackingList(); + Output = new ChangeTrackingList(); + } + + /// Unique document model name. + public string ModelId { get; } + + /// + /// Azure Blob Storage location containing the batch documents. + /// + public BlobContentSource BlobSource { get; } + + /// + /// Azure Blob Storage file list specifying the batch documents. + /// + public BlobFileListContentSource BlobFileListSource { get; } + + /// + /// 1-based page numbers to analyze. Ex. "1-3,5,7-9". + /// + public string Pages { get; set; } + + /// + /// 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"). + /// + public string Locale { get; set; } + + /// + /// List of optional analysis features. + /// + public ICollection Features { get; } + + /// + /// List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber". + /// + public ICollection QueryFields { get; } + + /// + /// Format of the analyze result top-level content. + /// + public DocumentContentFormat? OutputContentFormat { get; set; } + + /// + /// Additional outputs to generate during analysis. + /// + public ICollection Output { get; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeDocumentOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeDocumentOptions.cs new file mode 100644 index 000000000000..8041e2fc4773 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeDocumentOptions.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class AnalyzeDocumentOptions + { + // CUSTOM CODE NOTE: since either UriSource or BytesSource must be specified + // when building this object, we're hiding its parameterless constructor, adding + // custom constructors, and making both properties readonly. + + /// + /// Initializes a new instance of . + /// + /// Unique document model name. + /// Document URL to analyze. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public AnalyzeDocumentOptions(string modelId, Uri uriSource) : this(modelId) + { + Argument.AssertNotNull(uriSource, nameof(uriSource)); + + UriSource = uriSource; + } + + /// + /// Initializes a new instance of . + /// + /// Unique document model name. + /// + /// Bytes of the document to analyze. + /// + /// 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". + /// + /// + /// + /// + /// or is null. + /// is an empty string, and was expected to be non-empty. + public AnalyzeDocumentOptions(string modelId, BinaryData bytesSource) : this(modelId) + { + Argument.AssertNotNull(bytesSource, nameof(bytesSource)); + + BytesSource = bytesSource; + } + + private AnalyzeDocumentOptions(string modelId) : this() + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + ModelId = modelId; + } + + internal AnalyzeDocumentOptions() + { + Features = new ChangeTrackingList(); + QueryFields = new ChangeTrackingList(); + Output = new ChangeTrackingList(); + } + + /// Unique document model name. + public string ModelId { get; } + + /// Document URL to analyze. + public Uri UriSource { get; } + + /// + /// Bytes of the document to analyze. + /// + /// 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 BytesSource { get; } + + /// + /// 1-based page numbers to analyze. Ex. "1-3,5,7-9". + /// + public string Pages { get; set; } + + /// + /// 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"). + /// + public string Locale { get; set; } + + /// + /// List of optional analysis features. + /// + public ICollection Features { get; } + + /// + /// List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber". + /// + public ICollection QueryFields { get; } + + /// + /// Format of the analyze result top-level content. + /// + public DocumentContentFormat? OutputContentFormat { get; set; } + + /// + /// Additional outputs to generate during analysis. + /// + public ICollection Output { get; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzedDocument.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzedDocument.cs new file mode 100644 index 000000000000..0e8e353a72f0 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzedDocument.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class AnalyzedDocument + { + /// Dictionary of named field values. + public DocumentFieldDictionary Fields { get; private set; } + + [CodeGenMember("Fields")] + private IReadOnlyDictionary FieldsPrivate + { + get => Fields.Source; + set => Fields = (value is DocumentFieldDictionary instance) ? instance : new(value); + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj index 1e1dfa49ada2..2c5d78f27a4f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Azure.AI.DocumentIntelligence.csproj @@ -2,7 +2,9 @@ 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.4 + 1.1.0-beta.1 + + 1.0.0 Microsoft Azure Document Intelligence Cognitive Services Applied AI Form Recognizer $(RequiredTargetFrameworks) true diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/BuildDocumentModelOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/BuildDocumentModelOptions.cs new file mode 100644 index 000000000000..daf9442dcb9a --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/BuildDocumentModelOptions.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class BuildDocumentModelOptions + { + // CUSTOM CODE NOTE: since either BlobSource or BlobFileListSource must be specified + // when building this object, we're hiding its generated constructor, adding custom + // constructors, and making both properties readonly. + + /// Initializes a new instance of . + /// Unique document model name. + /// Custom document model build mode. + /// Azure Blob Storage location containing the training data. + /// or is null. + public BuildDocumentModelOptions(string modelId, DocumentBuildMode buildMode, BlobContentSource blobSource) : this(modelId, buildMode) + { + Argument.AssertNotNull(blobSource, nameof(blobSource)); + + BlobSource = blobSource; + } + + /// Initializes a new instance of . + /// Unique document model name. + /// Custom document model build mode. + /// Azure Blob Storage file list specifying the training data. + /// or is null. + public BuildDocumentModelOptions(string modelId, DocumentBuildMode buildMode, BlobFileListContentSource blobFileListSource) : this(modelId, buildMode) + { + Argument.AssertNotNull(blobFileListSource, nameof(blobFileListSource)); + + BlobFileListSource = blobFileListSource; + } + + internal BuildDocumentModelOptions(string modelId, DocumentBuildMode buildMode) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; + BuildMode = buildMode; + Tags = new ChangeTrackingDictionary(); + } + + /// + /// Azure Blob Storage location containing the training data. + /// + public BlobContentSource BlobSource { get; } + + /// + /// Azure Blob Storage file list specifying the training data. + /// + public BlobFileListContentSource BlobFileListSource { get; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/ClassifierDocumentTypeDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/ClassifierDocumentTypeDetails.cs new file mode 100644 index 000000000000..e0845e8dc200 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/ClassifierDocumentTypeDetails.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class ClassifierDocumentTypeDetails + { + // CUSTOM CODE NOTE: since either BlobSource or BlobFileListSource must be specified + // when building this object, we're hiding its generated constructor, adding custom + // constructors, and making both properties readonly. + + /// Initializes a new instance of . + /// Azure Blob Storage location containing the training data for a classifier document type. + /// is null. + public ClassifierDocumentTypeDetails(BlobContentSource blobSource) + { + Argument.AssertNotNull(blobSource, nameof(blobSource)); + + BlobSource = blobSource; + } + + /// Initializes a new instance of . + /// Azure Blob Storage file list specifying the training data for a classifier document type. + /// is null. + public ClassifierDocumentTypeDetails(BlobFileListContentSource blobFileListSource) + { + Argument.AssertNotNull(blobFileListSource, nameof(blobFileListSource)); + + BlobFileListSource = blobFileListSource; + } + + /// Initializes a new instance of . + internal ClassifierDocumentTypeDetails() + { + } + + /// + /// Azure Blob Storage location containing the training data for a classifier + /// document type. + /// + public BlobContentSource BlobSource { get; } + + /// + /// Azure Blob Storage file list specifying the training data for a classifier + /// document type. + /// + public BlobFileListContentSource BlobFileListSource { get; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/ClassifyDocumentOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/ClassifyDocumentOptions.cs new file mode 100644 index 000000000000..30a825d4ae88 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/ClassifyDocumentOptions.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class ClassifyDocumentOptions + { + // CUSTOM CODE NOTE: since either UriSource or BytesSource must be specified + // when building this object, we're hiding its parameterless constructor, adding + // custom constructors, and making both properties readonly. + + /// + /// Initializes a new instance of . + /// + /// Unique document classifier name. + /// Document URL to analyze. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public ClassifyDocumentOptions(string classifierId, Uri uriSource) + { + Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); + Argument.AssertNotNull(uriSource, nameof(uriSource)); + + ClassifierId = classifierId; + UriSource = uriSource; + } + + /// + /// Initializes a new instance of . + /// + /// Unique document classifier name. + /// + /// Bytes of the document to analyze. + /// + /// 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". + /// + /// + /// + /// + /// or is null. + /// is an empty string, and was expected to be non-empty. + public ClassifyDocumentOptions(string classifierId, BinaryData bytesSource) + { + Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); + Argument.AssertNotNull(bytesSource, nameof(bytesSource)); + + ClassifierId = classifierId; + BytesSource = bytesSource; + } + + internal ClassifyDocumentOptions() + { + } + + /// + /// Unique document classifier name. + /// + public string ClassifierId { get; } + + // NOTE: keeping the internal setter so it doesn't break autogenerated samples. + /// Document URL to classify. + public Uri UriSource { get; internal set; } + + /// + /// Bytes of the document to classify. + /// + /// 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 BytesSource { get; } + + /// + /// Document splitting mode. + /// + public SplitMode? Split { get; set; } + + /// + /// 1-based page numbers to analyze. Ex. "1-3,5,7-9". + /// + public string Pages { get; set; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentField.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentField.cs new file mode 100644 index 000000000000..93e3ef33933d --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentField.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class DocumentField + { + /// Dictionary of named field values. + public DocumentFieldDictionary ValueDictionary { get; private set; } + + private IReadOnlyDictionary ValueObject + { + get => ValueDictionary.Source; + set => ValueDictionary = (value is DocumentFieldDictionary instance) ? instance : new(value); + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentFieldDictionary.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentFieldDictionary.cs new file mode 100644 index 000000000000..cc118d5bfebc --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentFieldDictionary.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.DocumentIntelligence +{ + // CUSTOM CODE NOTE: this class is used to replace any occurrence of + // IReadOnlyDictionary in case we want to add + // helper methods to it in the future. Those helper methods could + // facilitate extracting field values, similarly to the pattern seen + // when parsing JSON with System.Text.Json. + + /// + /// A dictionary of named field values. + /// + public class DocumentFieldDictionary : IReadOnlyDictionary + { + internal DocumentFieldDictionary() + { + Source = new Dictionary(); + } + + internal DocumentFieldDictionary(IReadOnlyDictionary source) + { + Source = source; + } + + internal IReadOnlyDictionary Source { get; } + + /// + public DocumentField this[string key] => Source[key]; + + /// + public IEnumerable Keys => Source.Keys; + + /// + public IEnumerable Values => Source.Values; + + /// + public int Count => Source.Count; + + /// + public bool ContainsKey(string key) => Source.ContainsKey(key); + + /// + public IEnumerator> GetEnumerator() => Source.GetEnumerator(); + + /// + public bool TryGetValue(string key, out DocumentField value) => Source.TryGetValue(key, out value); + + /// + IEnumerator IEnumerable.GetEnumerator() => (Source as IEnumerable).GetEnumerator(); + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceAdministrationClient.cs index 5e0de253f30e..ac31ef5c737e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceAdministrationClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceAdministrationClient.cs @@ -10,6 +10,257 @@ namespace Azure.AI.DocumentIntelligence { public partial class DocumentIntelligenceAdministrationClient { + // CUSTOM CODE NOTE: we're overwriting methods AuthorizeClassifierCopy, AuthorizeModelCopy, + // BuildClassifier, BuildDocumentModel, and ComposeModel for the sole reason of renaming + // 'request' parameters to 'options'. + + /// + /// Generates authorization to copy a document classifier to this location with + /// specified classifierId and optional description. + /// + /// Authorize copy request options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> AuthorizeClassifierCopyAsync(AuthorizeClassifierCopyOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AuthorizeClassifierCopyAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ClassifierCopyAuthorization.FromResponse(response), response); + } + + /// + /// Generates authorization to copy a document classifier to this location with + /// specified classifierId and optional description. + /// + /// Authorize copy request options. + /// The cancellation token to use. + /// is null. + /// + public virtual Response AuthorizeClassifierCopy(AuthorizeClassifierCopyOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AuthorizeClassifierCopy(content, context); + return Response.FromValue(ClassifierCopyAuthorization.FromResponse(response), response); + } + + /// + /// Generates authorization to copy a document model to this location with + /// specified modelId and optional description. + /// + /// Authorize copy request options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> AuthorizeModelCopyAsync(AuthorizeModelCopyOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AuthorizeModelCopyAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ModelCopyAuthorization.FromResponse(response), response); + } + + /// + /// Generates authorization to copy a document model to this location with + /// specified modelId and optional description. + /// + /// Authorize copy request options. + /// The cancellation token to use. + /// is null. + /// + public virtual Response AuthorizeModelCopy(AuthorizeModelCopyOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = AuthorizeModelCopy(content, context); + return Response.FromValue(ModelCopyAuthorization.FromResponse(response), response); + } + + /// 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 options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> BuildClassifierAsync(WaitUntil waitUntil, BuildClassifierOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await BuildClassifierAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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 options. + /// The cancellation token to use. + /// is null. + /// + public virtual Operation BuildClassifier(WaitUntil waitUntil, BuildClassifierOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = BuildClassifier(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.BuildClassifier"); + } + + /// 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 options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> BuildDocumentModelAsync(WaitUntil waitUntil, BuildDocumentModelOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await BuildDocumentModelAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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 options. + /// The cancellation token to use. + /// is null. + /// + public virtual Operation BuildDocumentModel(WaitUntil waitUntil, BuildDocumentModelOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = BuildDocumentModel(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.BuildDocumentModel"); + } + + /// 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 options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> ComposeModelAsync(WaitUntil waitUntil, ComposeModelOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await ComposeModelAsync(waitUntil, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelComposeOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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 options. + /// The cancellation token to use. + /// is null. + /// + public virtual Operation ComposeModel(WaitUntil waitUntil, ComposeModelOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = ComposeModel(waitUntil, content, context); + return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelComposeOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.ComposeModel"); + } + + // CUSTOM CODE NOTE: we're overwriting methods CopyClassifierTo and CopyModelTo for the + // sole reason of renaming 'request' parameters to 'authorization'. + + /// Copies document classifier to the target resource, region, and classifierId. + /// 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. + /// Copy to request authorization. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CopyClassifierToAsync(WaitUntil waitUntil, string classifierId, ClassifierCopyAuthorization authorization, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); + Argument.AssertNotNull(authorization, nameof(authorization)); + + using RequestContent content = authorization.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CopyClassifierToAsync(waitUntil, classifierId, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.CopyClassifierTo"); + } + + /// Copies document classifier to the target resource, region, and classifierId. + /// 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. + /// Copy to request authorization. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation CopyClassifierTo(WaitUntil waitUntil, string classifierId, ClassifierCopyAuthorization authorization, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); + Argument.AssertNotNull(authorization, nameof(authorization)); + + using RequestContent content = authorization.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CopyClassifierTo(waitUntil, classifierId, content, context); + return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.CopyClassifierTo"); + } + + /// 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 authorization. + /// 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, ModelCopyAuthorization authorization, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + Argument.AssertNotNull(authorization, nameof(authorization)); + + using RequestContent content = authorization.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CopyModelToAsync(waitUntil, modelId, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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 authorization. + /// 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, ModelCopyAuthorization authorization, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + Argument.AssertNotNull(authorization, nameof(authorization)); + + using RequestContent content = authorization.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CopyModelTo(waitUntil, modelId, content, context); + return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.CopyModelTo"); + } + // CUSTOM CODE NOTE: we're overwriting the behavior of the BuildDocumentModel, ComposeModel, // CopyModelTo, BuildClassifier, and CopyClassifierTo APIs to return an instance of OperationWithId. // This is a workaround since Operation.Id is not supported by our generator yet (it throws a @@ -25,7 +276,7 @@ public partial class DocumentIntelligenceAdministrationClient /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -66,7 +317,7 @@ public virtual async Task> BuildDocumentModelAsync(WaitUnt /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -107,7 +358,7 @@ public virtual Operation BuildDocumentModel(WaitUntil waitUntil, Req /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -148,7 +399,7 @@ public virtual async Task> ComposeModelAsync(WaitUntil wai /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -189,7 +440,7 @@ public virtual Operation ComposeModel(WaitUntil waitUntil, RequestCo /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -233,7 +484,7 @@ public virtual async Task> CopyModelToAsync(WaitUntil wait /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -277,7 +528,7 @@ public virtual Operation CopyModelTo(WaitUntil waitUntil, string mod /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -318,7 +569,7 @@ public virtual async Task> BuildClassifierAsync(WaitUntil /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClient.cs index 9be981b55e2c..11b698d498f7 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClient.cs @@ -10,13 +10,230 @@ namespace Azure.AI.DocumentIntelligence { - [CodeGenSuppress("FetchAnalyzeResultFromAnalyzeResultOperation", typeof(Response))] + [CodeGenSuppress("FetchAnalyzeResultFromAnalyzeOperation", typeof(Response))] + [CodeGenSuppress("AnalyzeDocumentAsync", typeof(WaitUntil), typeof(string), typeof(AnalyzeDocumentOptions), typeof(string), typeof(string), typeof(StringIndexType?), typeof(IEnumerable), typeof(IEnumerable), typeof(DocumentContentFormat?), typeof(IEnumerable), typeof(CancellationToken))] + [CodeGenSuppress("AnalyzeDocument", typeof(WaitUntil), typeof(string), typeof(AnalyzeDocumentOptions), typeof(string), typeof(string), typeof(StringIndexType?), typeof(IEnumerable), typeof(IEnumerable), typeof(DocumentContentFormat?), typeof(IEnumerable), typeof(CancellationToken))] + [CodeGenSuppress("AnalyzeBatchDocumentsAsync", typeof(WaitUntil), typeof(string), typeof(AnalyzeBatchDocumentsOptions), typeof(string), typeof(string), typeof(StringIndexType?), typeof(IEnumerable), typeof(IEnumerable), typeof(DocumentContentFormat?), typeof(IEnumerable), typeof(CancellationToken))] + [CodeGenSuppress("AnalyzeBatchDocuments", typeof(WaitUntil), typeof(string), typeof(AnalyzeBatchDocumentsOptions), typeof(string), typeof(string), typeof(StringIndexType?), typeof(IEnumerable), typeof(IEnumerable), typeof(DocumentContentFormat?), typeof(IEnumerable), typeof(CancellationToken))] + [CodeGenSuppress("ClassifyDocumentAsync", typeof(WaitUntil), typeof(string), typeof(ClassifyDocumentOptions), typeof(StringIndexType?), typeof(SplitMode?), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("ClassifyDocument", typeof(WaitUntil), typeof(string), typeof(ClassifyDocumentOptions), typeof(StringIndexType?), typeof(SplitMode?), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeResultPdfAsync", typeof(string), typeof(Guid), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeResultPdf", typeof(string), typeof(Guid), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeResultPdfAsync", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("GetAnalyzeResultPdf", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("GetAnalyzeResultFigureAsync", typeof(string), typeof(Guid), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeResultFigure", typeof(string), typeof(Guid), typeof(string), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeResultFigureAsync", typeof(string), typeof(Guid), typeof(string), typeof(RequestContext))] + [CodeGenSuppress("GetAnalyzeResultFigure", typeof(string), typeof(Guid), typeof(string), typeof(RequestContext))] + [CodeGenSuppress("DeleteAnalyzeResultAsync", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("DeleteAnalyzeResult", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("DeleteAnalyzeBatchResultAsync", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("DeleteAnalyzeBatchResult", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("GetAnalyzeBatchResultAsync", typeof(string), typeof(Guid), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeBatchResult", typeof(string), typeof(Guid), typeof(CancellationToken))] + [CodeGenSuppress("GetAnalyzeBatchResultAsync", typeof(string), typeof(Guid), typeof(RequestContext))] + [CodeGenSuppress("GetAnalyzeBatchResult", typeof(string), typeof(Guid), typeof(RequestContext))] public partial class DocumentIntelligenceClient { - // CUSTOM CODE NOTE: we're overwriting the behavior of the AnalyzeDocument API to - // return an instance of OperationWithId. This is a workaround since Operation.Id - // is not supported by our generator yet (it throws a NotSupportedException), but - // this ID is needed for the GetAnalyzeResultPdf and the GetAnalyzeResultImage APIs. + // CUSTOM CODE NOTE: we're suppressing the generation of the AnalyzeDocument, + // AnalyzeBatchDocuments, and ClassifyDocument methods and adding methods manually + // below for the following reasons: + // - Hiding the StringIndexType parameter. We're making its value default to 'utf16CodeUnit'. + // - Hiding other parameters (e.g. 'modelId', 'pages') inside the 'options' property bag. + // - Renaming 'request' parameters to 'options'. + // - Making the 'options' parameter required in all methods. + + private const string DefaultStringIndexType = "utf16CodeUnit"; + + /// 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. + /// Analyze request options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> AnalyzeDocumentAsync(WaitUntil waitUntil, AnalyzeDocumentOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await AnalyzeDocumentAsync(waitUntil, options.ModelId, content, options.Pages, options.Locale, DefaultStringIndexType, options.Features, options.QueryFields, options.OutputContentFormat?.ToString(), options.Output, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeOperation, ClientDiagnostics, "DocumentIntelligenceClient.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. + /// Analyze request options. + /// The cancellation token to use. + /// is null. + /// + public virtual Operation AnalyzeDocument(WaitUntil waitUntil, AnalyzeDocumentOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = AnalyzeDocument(waitUntil, options.ModelId, content, options.Pages, options.Locale, DefaultStringIndexType, options.Features, options.QueryFields, options.OutputContentFormat?.ToString(), options.Output, context); + return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeOperation, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeDocument"); + } + + /// Analyzes batch documents 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. + /// Analyze batch request options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> AnalyzeBatchDocumentsAsync(WaitUntil waitUntil, AnalyzeBatchDocumentsOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await AnalyzeBatchDocumentsAsync(waitUntil, options.ModelId, content, options.Pages, options.Locale, DefaultStringIndexType, options.Features, options.QueryFields, options.OutputContentFormat?.ToString(), options.Output, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchAnalyzeBatchResultFromAnalyzeBatchOperationDetails, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments"); + } + + /// Analyzes batch documents 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. + /// Analyze batch request parameters. + /// The cancellation token to use. + /// is null. + /// + public virtual Operation AnalyzeBatchDocuments(WaitUntil waitUntil, AnalyzeBatchDocumentsOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = AnalyzeBatchDocuments(waitUntil, options.ModelId, content, options.Pages, options.Locale, DefaultStringIndexType, options.Features, options.QueryFields, options.OutputContentFormat?.ToString(), options.Output, context); + return ProtocolOperationHelpers.Convert(response, FetchAnalyzeBatchResultFromAnalyzeBatchOperationDetails, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments"); + } + + /// 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. + /// Classify request options. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> ClassifyDocumentAsync(WaitUntil waitUntil, ClassifyDocumentOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await ClassifyDocumentAsync(waitUntil, options.ClassifierId, content, DefaultStringIndexType, options.Split?.ToString(), options.Pages, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeOperation, ClientDiagnostics, "DocumentIntelligenceClient.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. + /// Classify request options. + /// The cancellation token to use. + /// is null. + /// + public virtual Operation ClassifyDocument(WaitUntil waitUntil, ClassifyDocumentOptions options, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(options, nameof(options)); + + using RequestContent content = options.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = ClassifyDocument(waitUntil, options.ClassifierId, content, DefaultStringIndexType, options.Split?.ToString(), options.Pages, context); + return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeOperation, ClientDiagnostics, "DocumentIntelligenceClient.ClassifyDocument"); + } + + // CUSTOM CODE NOTE: adding overloads for common scenarios of the AnalyzeDocument method. + + /// 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. + /// Document URL to analyze. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> AnalyzeDocumentAsync(WaitUntil waitUntil, string modelId, Uri uriSource, CancellationToken cancellationToken = default) + { + var options = new AnalyzeDocumentOptions(modelId, uriSource); + + return await AnalyzeDocumentAsync(waitUntil, options, cancellationToken).ConfigureAwait(false); + } + + /// 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. + /// Document URL to analyze. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation AnalyzeDocument(WaitUntil waitUntil, string modelId, Uri uriSource, CancellationToken cancellationToken = default) + { + var options = new AnalyzeDocumentOptions(modelId, uriSource); + + return AnalyzeDocument(waitUntil, options, cancellationToken); + } + + /// 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. + /// + /// Bytes of the document to analyze. + /// + /// 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". + /// + /// + /// + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> AnalyzeDocumentAsync(WaitUntil waitUntil, string modelId, BinaryData bytesSource, CancellationToken cancellationToken = default) + { + var options = new AnalyzeDocumentOptions(modelId, bytesSource); + + return await AnalyzeDocumentAsync(waitUntil, options, cancellationToken).ConfigureAwait(false); + } + + /// 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. + /// + /// Bytes of the document to analyze. + /// + /// 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". + /// + /// + /// + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public virtual Operation AnalyzeDocument(WaitUntil waitUntil, string modelId, BinaryData bytesSource, CancellationToken cancellationToken = default) + { + var options = new AnalyzeDocumentOptions(modelId, bytesSource); + + return AnalyzeDocument(waitUntil, options, cancellationToken); + } + + // CUSTOM CODE NOTE: we're overwriting the behavior of the AnalyzeDocument, + // AnalyzeBatchDocuments, and ClassifyDocument protocol methods to return an + // instance of OperationWithId. This is a workaround since Operation.Id is not + // supported by our generator yet (it throws a NotSupportedException), but this + // ID is needed for multiple APIs. /// /// [Protocol Method] Analyzes document with document model. @@ -28,7 +245,7 @@ public partial class DocumentIntelligenceClient /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -36,7 +253,7 @@ public partial class DocumentIntelligenceClient /// 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". + /// 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"). @@ -92,7 +309,7 @@ public virtual async Task> AnalyzeDocumentAsync(WaitUntil /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -100,7 +317,7 @@ public virtual async Task> AnalyzeDocumentAsync(WaitUntil /// 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". + /// 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"). @@ -146,12 +363,851 @@ public virtual Operation AnalyzeDocument(WaitUntil waitUntil, string } } + /// + /// [Protocol Method] Analyzes batch documents 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. + /// 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". + /// Additional outputs to generate during analysis. + /// 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> AnalyzeBatchDocumentsAsync(WaitUntil waitUntil, string modelId, RequestContent content, string pages = null, string locale = null, string stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, string outputContentFormat = null, IEnumerable output = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.AnalyzeBatchDocuments"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeBatchDocumentsRequest(modelId, content, pages, locale, stringIndexType, features, queryFields, outputContentFormat, output, context); + var internalOperation = await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments", OperationFinalStateVia.OperationLocation, context, WaitUntil.Started).ConfigureAwait(false); + var operationWithId = new OperationWithId(internalOperation); + + // Workaround to obtain the operation ID. The operation-location header is only returned after + // the first request that starts the LRO. Because of this we're setting waitUntil to 'Started' + // above so we have time to extract the operation ID in the OperationWithId constructor. + + if (waitUntil == WaitUntil.Completed) + { + operationWithId.WaitForCompletion(context?.CancellationToken ?? default); + } + + return operationWithId; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Analyzes batch documents 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. + /// 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". + /// Additional outputs to generate during analysis. + /// 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 AnalyzeBatchDocuments(WaitUntil waitUntil, string modelId, RequestContent content, string pages = null, string locale = null, string stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, string outputContentFormat = null, IEnumerable output = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.AnalyzeBatchDocuments"); + scope.Start(); + try + { + using HttpMessage message = CreateAnalyzeBatchDocumentsRequest(modelId, content, pages, locale, stringIndexType, features, queryFields, outputContentFormat, output, context); + var internalOperation = ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments", OperationFinalStateVia.OperationLocation, context, WaitUntil.Started); + var operationWithId = new OperationWithId(internalOperation); + + // Workaround to obtain the operation ID. The operation-location header is only returned after + // the first request that starts the LRO. Because of this we're setting waitUntil to 'Started' + // above so we have time to extract the operation ID in the OperationWithId constructor. + + if (waitUntil == WaitUntil.Completed) + { + operationWithId.WaitForCompletion(context?.CancellationToken ?? default); + } + + return operationWithId; + } + 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". + /// 1-based page numbers to analyze. Ex. "1-3,5,7-9". + /// 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, string pages = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.ClassifyDocument"); + scope.Start(); + try + { + using HttpMessage message = CreateClassifyDocumentRequest(classifierId, content, stringIndexType, split, pages, context); + var internalOperation = await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.ClassifyDocument", OperationFinalStateVia.OperationLocation, context, WaitUntil.Started).ConfigureAwait(false); + var operationWithId = new OperationWithId(internalOperation); + + // Workaround to obtain the operation ID. The operation-location header is only returned after + // the first request that starts the LRO. Because of this we're setting waitUntil to 'Started' + // above so we have time to extract the operation ID in the OperationWithId constructor. + + if (waitUntil == WaitUntil.Completed) + { + operationWithId.WaitForCompletion(context?.CancellationToken ?? default); + } + + return operationWithId; + } + 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". + /// 1-based page numbers to analyze. Ex. "1-3,5,7-9". + /// 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, string pages = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.ClassifyDocument"); + scope.Start(); + try + { + using HttpMessage message = CreateClassifyDocumentRequest(classifierId, content, stringIndexType, split, pages, context); + var internalOperation = ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.ClassifyDocument", OperationFinalStateVia.OperationLocation, context, WaitUntil.Started); + var operationWithId = new OperationWithId(internalOperation); + + // Workaround to obtain the operation ID. The operation-location header is only returned after + // the first request that starts the LRO. Because of this we're setting waitUntil to 'Started' + // above so we have time to extract the operation ID in the OperationWithId constructor. + + if (waitUntil == WaitUntil.Completed) + { + operationWithId.WaitForCompletion(context?.CancellationToken ?? default); + } + + return operationWithId; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // CUSTOM CODE: we're suppressing the generation of GetAnalyzeResultPdf, GetAnalyzeResultFigure, + // DeleteAnalyzeResult, DeleteAnalyzeBatchResult, and GetAnalyzeBatchResult and overwriting their + // behavior below to make the parameter 'resultId' to accept a string instead of a Guid. + + /// Gets the generated searchable PDF output from document analysis. + /// Unique document model name. + /// Analyze operation result ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAnalyzeResultPdfAsync(string modelId, string resultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAnalyzeResultPdfAsync(modelId, resultId, context).ConfigureAwait(false); + return Response.FromValue(response.Content, response); + } + + /// Gets the generated searchable PDF output from document analysis. + /// Unique document model name. + /// Analyze operation result ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAnalyzeResultPdf(string modelId, string resultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAnalyzeResultPdf(modelId, resultId, context); + return Response.FromValue(response.Content, response); + } + + /// + /// [Protocol Method] Gets the generated searchable PDF output from document analysis. + /// + /// + /// + /// 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. + /// Analyze operation result ID. + /// 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 GetAnalyzeResultPdfAsync(string modelId, string resultId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultPdf"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAnalyzeResultPdfRequest(modelId, resultId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the generated searchable PDF output from document analysis. + /// + /// + /// + /// 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. + /// Analyze operation result ID. + /// 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 GetAnalyzeResultPdf(string modelId, string resultId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultPdf"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAnalyzeResultPdfRequest(modelId, resultId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the generated cropped image of specified figure from document analysis. + /// Unique document model name. + /// Analyze operation result ID. + /// Figure ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAnalyzeResultFigureAsync(string modelId, string resultId, string figureId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAnalyzeResultFigureAsync(modelId, resultId, figureId, context).ConfigureAwait(false); + return Response.FromValue(response.Content, response); + } + + /// Gets the generated cropped image of specified figure from document analysis. + /// Unique document model name. + /// Analyze operation result ID. + /// Figure ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAnalyzeResultFigure(string modelId, string resultId, string figureId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAnalyzeResultFigure(modelId, resultId, figureId, context); + return Response.FromValue(response.Content, response); + } + + /// + /// [Protocol Method] Gets the generated cropped image of specified figure from document analysis. + /// + /// + /// + /// 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. + /// Analyze operation result ID. + /// Figure ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetAnalyzeResultFigureAsync(string modelId, string resultId, string figureId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultFigure"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAnalyzeResultFigureRequest(modelId, resultId, figureId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the generated cropped image of specified figure from document analysis. + /// + /// + /// + /// 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. + /// Analyze operation result ID. + /// Figure ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or 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 GetAnalyzeResultFigure(string modelId, string resultId, string figureId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultFigure"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAnalyzeResultFigureRequest(modelId, resultId, figureId, 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] Mark the result of document analysis for deletion. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Unique document model name. + /// Analyze operation result ID. + /// 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 DeleteAnalyzeResultAsync(string modelId, string resultId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.DeleteAnalyzeResult"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteAnalyzeResultRequest(modelId, resultId, 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] Mark the result of document analysis for deletion. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Unique document model name. + /// Analyze operation result ID. + /// 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 DeleteAnalyzeResult(string modelId, string resultId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.DeleteAnalyzeResult"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteAnalyzeResultRequest(modelId, resultId, 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] Mark the batch document analysis result for deletion. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Unique document model name. + /// Analyze batch operation result ID. + /// 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 DeleteAnalyzeBatchResultAsync(string modelId, string resultId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.DeleteAnalyzeBatchResult"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteAnalyzeBatchResultRequest(modelId, resultId, 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] Mark the batch document analysis result for deletion. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Unique document model name. + /// Analyze batch operation result ID. + /// 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 DeleteAnalyzeBatchResult(string modelId, string resultId, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.DeleteAnalyzeBatchResult"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteAnalyzeBatchResultRequest(modelId, resultId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the result of batch document analysis. + /// Unique document model name. + /// Analyze batch operation result ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAnalyzeBatchResultAsync(string modelId, string resultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAnalyzeBatchResultAsync(modelId, resultId, context).ConfigureAwait(false); + return Response.FromValue(AnalyzeBatchOperationDetails.FromResponse(response), response); + } + + /// Gets the result of batch document analysis. + /// Unique document model name. + /// Analyze batch operation result ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAnalyzeBatchResult(string modelId, string resultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAnalyzeBatchResult(modelId, resultId, context); + return Response.FromValue(AnalyzeBatchOperationDetails.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the result of batch document analysis. + /// + /// + /// + /// 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. + /// Analyze batch operation result ID. + /// 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 GetAnalyzeBatchResultAsync(string modelId, string resultId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeBatchResult"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAnalyzeBatchResultRequest(modelId, resultId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the result of batch document analysis. + /// + /// + /// + /// 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. + /// Analyze batch operation result ID. + /// 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 GetAnalyzeBatchResult(string modelId, string resultId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); + + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeBatchResult"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAnalyzeBatchResultRequest(modelId, resultId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetAnalyzeResultPdfRequest(string modelId, string resultId, 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.AppendPath("/analyzeResults/", false); + uri.AppendPath(resultId, true); + uri.AppendPath("/pdf", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/pdf"); + return message; + } + + internal HttpMessage CreateGetAnalyzeResultFigureRequest(string modelId, string resultId, string figureId, 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.AppendPath("/analyzeResults/", false); + uri.AppendPath(resultId, true); + uri.AppendPath("/figures/", false); + uri.AppendPath(figureId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "image/png"); + return message; + } + + internal HttpMessage CreateDeleteAnalyzeResultRequest(string modelId, string resultId, 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.AppendPath("/analyzeResults/", false); + uri.AppendPath(resultId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteAnalyzeBatchResultRequest(string modelId, string resultId, 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.AppendPath("/analyzeBatchResults/", false); + uri.AppendPath(resultId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAnalyzeBatchResultRequest(string modelId, string resultId, 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.AppendPath("/analyzeBatchResults/", false); + uri.AppendPath(resultId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + // CUSTOM CODE NOTE: code generation is mistakenly creating two copies of the - // FetchAnalyzeResultFromAnalyzeResultOperation method, breaking the build. + // FetchAnalyzeResultFromAnalyzeOperation method, breaking the build. // We're forcibly suppressing their creation with the CodeGenSuppress attribute // and adding a single copy here. - private AnalyzeResult FetchAnalyzeResultFromAnalyzeResultOperation(Response response) + private AnalyzeResult FetchAnalyzeResultFromAnalyzeOperation(Response response) { var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("analyzeResult"); return AnalyzeResult.DeserializeAnalyzeResult(resultJsonElement); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClientOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClientOptions.cs new file mode 100644 index 000000000000..ae4f4d90c80e --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceClientOptions.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.AI.DocumentIntelligence +{ + [CodeGenModel("AzureAIDocumentIntelligenceClientOptions")] + public partial class DocumentIntelligenceClientOptions + { + // CUSTOM CODE NOTE: overwriting the behavior of the constructor + // to enable logging of the apim-request-id header by default. + + /// Initializes new instance of DocumentIntelligenceClientOptions. + public DocumentIntelligenceClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_11_30 => "2024-11-30", + _ => throw new NotSupportedException() + }; + + Diagnostics.LoggedHeaderNames.Add("apim-request-id"); + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceModelFactory.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceModelFactory.cs new file mode 100644 index 000000000000..b9b4b877e712 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/DocumentIntelligenceModelFactory.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.AI.DocumentIntelligence +{ + // CUSTOM CODE NOTE: the generator started including AnalyzeDocumentOptions, ClassifierDocumentTypeDetails, + // and ClassifyDocumentOptions in the factory after we hid their parameterless constructors. This is unnecessary + // given that they are input-only models that can be directly instantiated by users. For this reason we're + // suppressing their generation here. + + [CodeGenModel("AIDocumentIntelligenceModelFactory")] + [CodeGenSuppress("AnalyzeDocumentOptions", typeof(Uri), typeof(BinaryData))] + [CodeGenSuppress("ClassifierDocumentTypeDetails", typeof(ContentSourceKind?), typeof(BlobContentSource), typeof(BlobFileListContentSource))] + [CodeGenSuppress("ClassifyDocumentOptions", typeof(Uri), typeof(BinaryData))] + public partial class DocumentIntelligenceModelFactory + { + // CUSTOM CODE NOTE: the AnalyzeResult method must be added manually to the factory. + // It stopped being autogenerated after we hid its 'StringIndexType' property. + + private const string DefaultStringIndexType = "utf16CodeUnit"; + + /// Initializes a new instance of . + /// API version used to produce this result. + /// Document model ID used to produce this result. + /// 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 sections. + /// Extracted key-value pairs. + /// Extracted font styles. + /// Detected languages. + /// Extracted documents. + /// List of warnings encountered. + /// A new instance for mocking. + public static AnalyzeResult AnalyzeResult(string apiVersion = null, string modelId = null, DocumentContentFormat? contentFormat = null, string content = null, IEnumerable pages = null, IEnumerable paragraphs = null, IEnumerable tables = null, IEnumerable figures = null, IEnumerable sections = null, IEnumerable keyValuePairs = null, IEnumerable styles = null, IEnumerable languages = null, IEnumerable documents = null, IEnumerable warnings = null) + { + pages ??= new List(); + paragraphs ??= new List(); + tables ??= new List(); + figures ??= new List(); + sections ??= new List(); + keyValuePairs ??= new List(); + styles ??= new List(); + languages ??= new List(); + documents ??= new List(); + warnings ??= new List(); + + return new AnalyzeResult( + apiVersion, + modelId, + DefaultStringIndexType, + contentFormat, + content, + pages?.ToList(), + paragraphs?.ToList(), + tables?.ToList(), + figures?.ToList(), + sections?.ToList(), + keyValuePairs?.ToList(), + styles?.ToList(), + languages?.ToList(), + documents?.ToList(), + warnings?.ToList(), + serializedAdditionalRawData: null); + } + + // CUSTOM CODE NOTE: the AnalyzedDocument and DocumentField methods must be added manually to + // the factory. It stopped being autogenerated after we replaced their + // IReadOnlyDictionary with our custom DocumentFieldDictionary type. + + /// Initializes a new instance of . + /// 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 documentType = null, IEnumerable boundingRegions = null, IEnumerable spans = null, DocumentFieldDictionary fields = null, float confidence = default) + { + boundingRegions ??= new List(); + spans ??= new List(); + fields ??= new DocumentFieldDictionary(); + + return new AnalyzedDocument( + documentType, + boundingRegions?.ToList(), + spans?.ToList(), + fields, + confidence, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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. + /// Selection group 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 fieldType = default, string valueString = null, DateTimeOffset? valueDate = null, TimeSpan? valueTime = null, string valuePhoneNumber = null, double? valueDouble = null, long? valueInt64 = null, DocumentSelectionMarkState? valueSelectionMark = null, DocumentSignatureType? valueSignature = null, string valueCountryRegion = null, IEnumerable valueList = null, DocumentFieldDictionary valueDictionary = null, CurrencyValue valueCurrency = null, AddressValue valueAddress = null, bool? valueBoolean = null, IEnumerable valueSelectionGroup = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, float? confidence = null) + { + valueList ??= new List(); + valueDictionary ??= new DocumentFieldDictionary(); + valueSelectionGroup ??= new List(); + boundingRegions ??= new List(); + spans ??= new List(); + + return new DocumentField( + fieldType, + valueString, + valueDate, + valueTime, + valuePhoneNumber, + valueDouble, + valueInt64, + valueSelectionMark, + valueSignature, + valueCountryRegion, + valueList?.ToList(), + valueDictionary, + valueCurrency, + valueAddress, + valueBoolean, + valueSelectionGroup?.ToList(), + content, + boundingRegions?.ToList(), + spans?.ToList(), + confidence, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The items of the dictionary. + /// A new instance for mocking. + public static DocumentFieldDictionary DocumentFieldDictionary(IReadOnlyDictionary items) + { + items ??= new Dictionary(); + + return new DocumentFieldDictionary(items); + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsOptions.Serialization.cs similarity index 73% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsOptions.Serialization.cs index 10206e699984..c9b8c2ac55f9 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AnalyzeBatchDocumentsContent : IUtf8JsonSerializable, IJsonModel + public partial class AnalyzeBatchDocumentsOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,24 +28,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsOptions)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AzureBlobSource)) + if (Optional.IsDefined(BlobSource)) { writer.WritePropertyName("azureBlobSource"u8); - writer.WriteObjectValue(AzureBlobSource, options); + writer.WriteObjectValue(BlobSource, options); } - if (Optional.IsDefined(AzureBlobFileListSource)) + if (Optional.IsDefined(BlobFileListSource)) { writer.WritePropertyName("azureBlobFileListSource"u8); - writer.WriteObjectValue(AzureBlobFileListSource, options); + writer.WriteObjectValue(BlobFileListSource, options); } writer.WritePropertyName("resultContainerUrl"u8); - writer.WriteStringValue(ResultContainerUrl.AbsoluteUri); + writer.WriteStringValue(ResultContainerUri.AbsoluteUri); if (Optional.IsDefined(ResultPrefix)) { writer.WritePropertyName("resultPrefix"u8); @@ -73,19 +73,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AnalyzeBatchDocumentsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AnalyzeBatchDocumentsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAnalyzeBatchDocumentsContent(document.RootElement, options); + return DeserializeAnalyzeBatchDocumentsOptions(document.RootElement, options); } - internal static AnalyzeBatchDocumentsContent DeserializeAnalyzeBatchDocumentsContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static AnalyzeBatchDocumentsOptions DeserializeAnalyzeBatchDocumentsOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,8 +93,8 @@ internal static AnalyzeBatchDocumentsContent DeserializeAnalyzeBatchDocumentsCon { return null; } - AzureBlobContentSource azureBlobSource = default; - AzureBlobFileListContentSource azureBlobFileListSource = default; + BlobContentSource azureBlobSource = default; + BlobFileListContentSource azureBlobFileListSource = default; Uri resultContainerUrl = default; string resultPrefix = default; bool? overwriteExisting = default; @@ -108,7 +108,7 @@ internal static AnalyzeBatchDocumentsContent DeserializeAnalyzeBatchDocumentsCon { continue; } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value, options); + azureBlobSource = BlobContentSource.DeserializeBlobContentSource(property.Value, options); continue; } if (property.NameEquals("azureBlobFileListSource"u8)) @@ -117,7 +117,7 @@ internal static AnalyzeBatchDocumentsContent DeserializeAnalyzeBatchDocumentsCon { continue; } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value, options); + azureBlobFileListSource = BlobFileListContentSource.DeserializeBlobFileListContentSource(property.Value, options); continue; } if (property.NameEquals("resultContainerUrl"u8)) @@ -145,7 +145,7 @@ internal static AnalyzeBatchDocumentsContent DeserializeAnalyzeBatchDocumentsCon } } serializedAdditionalRawData = rawDataDictionary; - return new AnalyzeBatchDocumentsContent( + return new AnalyzeBatchDocumentsOptions( azureBlobSource, azureBlobFileListSource, resultContainerUrl, @@ -154,43 +154,43 @@ internal static AnalyzeBatchDocumentsContent DeserializeAnalyzeBatchDocumentsCon serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsOptions)} does not support writing '{options.Format}' format."); } } - AnalyzeBatchDocumentsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AnalyzeBatchDocumentsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAnalyzeBatchDocumentsContent(document.RootElement, options); + return DeserializeAnalyzeBatchDocumentsOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchDocumentsOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AnalyzeBatchDocumentsContent FromResponse(Response response) + internal static AnalyzeBatchDocumentsOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAnalyzeBatchDocumentsContent(document.RootElement); + return DeserializeAnalyzeBatchDocumentsOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsOptions.cs similarity index 60% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsOptions.cs index 1a09e68fd9a4..b7e025c4847d 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchDocumentsOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Batch document analysis parameters. - public partial class AnalyzeBatchDocumentsContent + public partial class AnalyzeBatchDocumentsOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,56 +45,35 @@ public partial class AnalyzeBatchDocumentsContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Azure Blob Storage container URL where analyze result files will be stored. - /// is null. - public AnalyzeBatchDocumentsContent(Uri resultContainerUrl) - { - Argument.AssertNotNull(resultContainerUrl, nameof(resultContainerUrl)); - - ResultContainerUrl = resultContainerUrl; - } - - /// Initializes a new instance of . - /// + /// Initializes a new instance of . + /// /// Azure Blob Storage location containing the batch documents. Either /// azureBlobSource or azureBlobFileListSource must be specified. /// - /// + /// /// Azure Blob Storage file list specifying the batch documents. Either /// azureBlobSource or azureBlobFileListSource must be specified. /// - /// Azure Blob Storage container URL where analyze result files will be stored. + /// Azure Blob Storage container URL where analyze result files will be stored. /// Blob name prefix of result files. /// Overwrite existing analyze result files?. /// Keeps track of any properties unknown to the library. - internal AnalyzeBatchDocumentsContent(AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, Uri resultContainerUrl, string resultPrefix, bool? overwriteExisting, IDictionary serializedAdditionalRawData) + internal AnalyzeBatchDocumentsOptions(BlobContentSource blobSource, BlobFileListContentSource blobFileListSource, Uri resultContainerUri, string resultPrefix, bool? overwriteExisting, IDictionary serializedAdditionalRawData) { - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; - ResultContainerUrl = resultContainerUrl; + BlobSource = blobSource; + BlobFileListSource = blobFileListSource; + ResultContainerUri = resultContainerUri; ResultPrefix = resultPrefix; OverwriteExisting = overwriteExisting; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AnalyzeBatchDocumentsContent() + /// Initializes a new instance of for deserialization. + internal AnalyzeBatchDocumentsOptions() { } - - /// - /// Azure Blob Storage location containing the batch documents. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - public AzureBlobContentSource AzureBlobSource { get; set; } - /// - /// Azure Blob Storage file list specifying the batch documents. Either - /// azureBlobSource or azureBlobFileListSource must be specified. - /// - public AzureBlobFileListContentSource AzureBlobFileListSource { get; set; } /// Azure Blob Storage container URL where analyze result files will be stored. - public Uri ResultContainerUrl { get; } + public Uri ResultContainerUri { get; } /// Blob name prefix of result files. public string ResultPrefix { get; set; } /// Overwrite existing analyze result files?. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetails.Serialization.cs new file mode 100644 index 000000000000..aecdcee40fc7 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetails.Serialization.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class AnalyzeBatchOperationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResultId)) + { + writer.WritePropertyName("resultId"u8); + writer.WriteStringValue(ResultId); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedOn, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedOn, "O"); + if (Optional.IsDefined(PercentCompleted)) + { + writer.WritePropertyName("percentCompleted"u8); + writer.WriteNumberValue(PercentCompleted.Value); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, options); + } + if (Optional.IsDefined(Result)) + { + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AnalyzeBatchOperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnalyzeBatchOperationDetails(document.RootElement, options); + } + + internal static AnalyzeBatchOperationDetails DeserializeAnalyzeBatchOperationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resultId = default; + DocumentIntelligenceOperationStatus status = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + int? percentCompleted = default; + DocumentIntelligenceError error = default; + AnalyzeBatchResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resultId"u8)) + { + resultId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); + 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("percentCompleted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentCompleted = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = DocumentIntelligenceError.DeserializeDocumentIntelligenceError(property.Value, options); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = AnalyzeBatchResult.DeserializeAnalyzeBatchResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AnalyzeBatchOperationDetails( + resultId, + status, + createdDateTime, + lastUpdatedDateTime, + percentCompleted, + error, + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetails)} does not support writing '{options.Format}' format."); + } + } + + AnalyzeBatchOperationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAnalyzeBatchOperationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AnalyzeBatchOperationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAnalyzeBatchOperationDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetails.cs new file mode 100644 index 000000000000..3360286387b6 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetails.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.DocumentIntelligence +{ + /// Status and result of the analyze batch operation. + public partial class AnalyzeBatchOperationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Operation status. notStarted, running, succeeded, or failed. + /// Date and time (UTC) when the operation was submitted. + /// Date and time (UTC) when the status was last updated. + internal AnalyzeBatchOperationDetails(DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn) + { + Status = status; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + } + + /// Initializes a new instance of . + /// Analyze batch operation result ID. + /// Operation status. notStarted, running, succeeded, or failed. + /// Date and time (UTC) when the operation was submitted. + /// Date and time (UTC) when the status was last updated. + /// Operation progress (0-100). + /// Encountered error during batch document analysis. + /// Batch document analysis result. + /// Keeps track of any properties unknown to the library. + internal AnalyzeBatchOperationDetails(string resultId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, int? percentCompleted, DocumentIntelligenceError error, AnalyzeBatchResult result, IDictionary serializedAdditionalRawData) + { + ResultId = resultId; + Status = status; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; + PercentCompleted = percentCompleted; + Error = error; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AnalyzeBatchOperationDetails() + { + } + /// Operation status. notStarted, running, succeeded, or failed. + public DocumentIntelligenceOperationStatus Status { get; } + /// Date and time (UTC) when the operation was submitted. + public DateTimeOffset CreatedOn { get; } + /// Date and time (UTC) when the status was last updated. + public DateTimeOffset LastUpdatedOn { get; } + /// Operation progress (0-100). + public int? PercentCompleted { get; } + /// Encountered error during batch document analysis. + public DocumentIntelligenceError Error { get; } + /// Batch document analysis result. + public AnalyzeBatchResult Result { get; } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.Serialization.cs index 1718dc34c60c..120e38791f16 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.Serialization.cs @@ -40,13 +40,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNumberValue(FailedCount); writer.WritePropertyName("skippedCount"u8); writer.WriteNumberValue(SkippedCount); - writer.WritePropertyName("details"u8); - writer.WriteStartArray(); - foreach (var item in Details) + if (Optional.IsCollectionDefined(Details)) { - writer.WriteObjectValue(item, options); + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); } - writer.WriteEndArray(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,7 +90,7 @@ internal static AnalyzeBatchResult DeserializeAnalyzeBatchResult(JsonElement ele int succeededCount = default; int failedCount = default; int skippedCount = default; - IReadOnlyList details = default; + IReadOnlyList details = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -109,10 +112,14 @@ internal static AnalyzeBatchResult DeserializeAnalyzeBatchResult(JsonElement ele } if (property.NameEquals("details"u8)) { - List array = new List(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(AnalyzeBatchOperationDetail.DeserializeAnalyzeBatchOperationDetail(item, options)); + array.Add(AnalyzeBatchResultDetails.DeserializeAnalyzeBatchResultDetails(item, options)); } details = array; continue; @@ -123,7 +130,7 @@ internal static AnalyzeBatchResult DeserializeAnalyzeBatchResult(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new AnalyzeBatchResult(succeededCount, failedCount, skippedCount, details, serializedAdditionalRawData); + return new AnalyzeBatchResult(succeededCount, failedCount, skippedCount, details ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.cs index 5c4b1d9f881c..0888c8319562 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResult.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace Azure.AI.DocumentIntelligence { @@ -50,16 +49,12 @@ public partial class AnalyzeBatchResult /// Number of documents that completed with status succeeded. /// Number of documents that completed with status failed. /// Number of documents that completed with status skipped. - /// Operation detail for each document in the batch. - /// is null. - internal AnalyzeBatchResult(int succeededCount, int failedCount, int skippedCount, IEnumerable details) + internal AnalyzeBatchResult(int succeededCount, int failedCount, int skippedCount) { - Argument.AssertNotNull(details, nameof(details)); - SucceededCount = succeededCount; FailedCount = failedCount; SkippedCount = skippedCount; - Details = details.ToList(); + Details = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -68,7 +63,7 @@ internal AnalyzeBatchResult(int succeededCount, int failedCount, int skippedCoun /// Number of documents that completed with status skipped. /// Operation detail for each document in the batch. /// Keeps track of any properties unknown to the library. - internal AnalyzeBatchResult(int succeededCount, int failedCount, int skippedCount, IReadOnlyList details, IDictionary serializedAdditionalRawData) + internal AnalyzeBatchResult(int succeededCount, int failedCount, int skippedCount, IReadOnlyList details, IDictionary serializedAdditionalRawData) { SucceededCount = succeededCount; FailedCount = failedCount; @@ -89,6 +84,6 @@ internal AnalyzeBatchResult() /// Number of documents that completed with status skipped. public int SkippedCount { get; } /// Operation detail for each document in the batch. - public IReadOnlyList Details { get; } + public IReadOnlyList Details { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetail.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResultDetails.Serialization.cs similarity index 68% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetail.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResultDetails.Serialization.cs index cba585d1c24b..c74aa0b768b2 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetail.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResultDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AnalyzeBatchOperationDetail : IUtf8JsonSerializable, IJsonModel + public partial class AnalyzeBatchResultDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,20 +28,20 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetail)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchResultDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); writer.WritePropertyName("sourceUrl"u8); - writer.WriteStringValue(SourceUrl.AbsoluteUri); - if (Optional.IsDefined(ResultUrl)) + writer.WriteStringValue(SourceUri.AbsoluteUri); + if (Optional.IsDefined(ResultUri)) { writer.WritePropertyName("resultUrl"u8); - writer.WriteStringValue(ResultUrl.AbsoluteUri); + writer.WriteStringValue(ResultUri.AbsoluteUri); } if (Optional.IsDefined(Error)) { @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AnalyzeBatchOperationDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AnalyzeBatchResultDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetail)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchResultDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAnalyzeBatchOperationDetail(document.RootElement, options); + return DeserializeAnalyzeBatchResultDetails(document.RootElement, options); } - internal static AnalyzeBatchOperationDetail DeserializeAnalyzeBatchOperationDetail(JsonElement element, ModelReaderWriterOptions options = null) + internal static AnalyzeBatchResultDetails DeserializeAnalyzeBatchResultDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -85,7 +85,7 @@ internal static AnalyzeBatchOperationDetail DeserializeAnalyzeBatchOperationDeta { return null; } - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; Uri sourceUrl = default; Uri resultUrl = default; DocumentIntelligenceError error = default; @@ -95,7 +95,7 @@ internal static AnalyzeBatchOperationDetail DeserializeAnalyzeBatchOperationDeta { if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("sourceUrl"u8)) @@ -127,46 +127,46 @@ internal static AnalyzeBatchOperationDetail DeserializeAnalyzeBatchOperationDeta } } serializedAdditionalRawData = rawDataDictionary; - return new AnalyzeBatchOperationDetail(status, sourceUrl, resultUrl, error, serializedAdditionalRawData); + return new AnalyzeBatchResultDetails(status, sourceUrl, resultUrl, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetail)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchResultDetails)} does not support writing '{options.Format}' format."); } } - AnalyzeBatchOperationDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AnalyzeBatchResultDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAnalyzeBatchOperationDetail(document.RootElement, options); + return DeserializeAnalyzeBatchResultDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AnalyzeBatchOperationDetail)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeBatchResultDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AnalyzeBatchOperationDetail FromResponse(Response response) + internal static AnalyzeBatchResultDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAnalyzeBatchOperationDetail(document.RootElement); + return DeserializeAnalyzeBatchResultDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetail.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResultDetails.cs similarity index 72% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetail.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResultDetails.cs index 11060881c143..fe6bac80bc82 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchOperationDetail.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeBatchResultDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Operation detail for a document in a batch analysis. - public partial class AnalyzeBatchOperationDetail + public partial class AnalyzeBatchResultDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,44 +45,44 @@ public partial class AnalyzeBatchOperationDetail /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Analyze status. succeeded, failed, or skipped. - /// URL of the source document. - /// is null. - internal AnalyzeBatchOperationDetail(OperationStatus status, Uri sourceUrl) + /// URL of the source document. + /// is null. + internal AnalyzeBatchResultDetails(DocumentIntelligenceOperationStatus status, Uri sourceUri) { - Argument.AssertNotNull(sourceUrl, nameof(sourceUrl)); + Argument.AssertNotNull(sourceUri, nameof(sourceUri)); Status = status; - SourceUrl = sourceUrl; + SourceUri = sourceUri; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Analyze status. succeeded, failed, or skipped. - /// URL of the source document. - /// URL of the analyze result JSON. + /// URL of the source document. + /// URL of the analyze result JSON. /// Encountered error. /// Keeps track of any properties unknown to the library. - internal AnalyzeBatchOperationDetail(OperationStatus status, Uri sourceUrl, Uri resultUrl, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData) + internal AnalyzeBatchResultDetails(DocumentIntelligenceOperationStatus status, Uri sourceUri, Uri resultUri, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData) { Status = status; - SourceUrl = sourceUrl; - ResultUrl = resultUrl; + SourceUri = sourceUri; + ResultUri = resultUri; Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AnalyzeBatchOperationDetail() + /// Initializes a new instance of for deserialization. + internal AnalyzeBatchResultDetails() { } /// Analyze status. succeeded, failed, or skipped. - public OperationStatus Status { get; } + public DocumentIntelligenceOperationStatus Status { get; } /// URL of the source document. - public Uri SourceUrl { get; } + public Uri SourceUri { get; } /// URL of the analyze result JSON. - public Uri ResultUrl { get; } + public Uri ResultUri { get; } /// Encountered error. public DocumentIntelligenceError Error { get; } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentOptions.Serialization.cs similarity index 75% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentOptions.Serialization.cs index 80677253dff4..a836e9fb524d 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AnalyzeDocumentContent : IUtf8JsonSerializable, IJsonModel + public partial class AnalyzeDocumentOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,21 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnalyzeDocumentContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeDocumentOptions)} does not support writing '{format}' format."); } - if (Optional.IsDefined(UrlSource)) + if (Optional.IsDefined(UriSource)) { writer.WritePropertyName("urlSource"u8); - writer.WriteStringValue(UrlSource.AbsoluteUri); + writer.WriteStringValue(UriSource.AbsoluteUri); } - if (Optional.IsDefined(Base64Source)) + if (Optional.IsDefined(BytesSource)) { writer.WritePropertyName("base64Source"u8); - writer.WriteBase64StringValue(Base64Source.ToArray(), "D"); + writer.WriteBase64StringValue(BytesSource.ToArray(), "D"); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AnalyzeDocumentContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AnalyzeDocumentOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AnalyzeDocumentContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AnalyzeDocumentOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAnalyzeDocumentContent(document.RootElement, options); + return DeserializeAnalyzeDocumentOptions(document.RootElement, options); } - internal static AnalyzeDocumentContent DeserializeAnalyzeDocumentContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static AnalyzeDocumentOptions DeserializeAnalyzeDocumentOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,46 +111,46 @@ internal static AnalyzeDocumentContent DeserializeAnalyzeDocumentContent(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new AnalyzeDocumentContent(urlSource, base64Source, serializedAdditionalRawData); + return new AnalyzeDocumentOptions(urlSource, base64Source, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AnalyzeDocumentContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeDocumentOptions)} does not support writing '{options.Format}' format."); } } - AnalyzeDocumentContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AnalyzeDocumentOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAnalyzeDocumentContent(document.RootElement, options); + return DeserializeAnalyzeDocumentOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AnalyzeDocumentContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AnalyzeDocumentOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AnalyzeDocumentContent FromResponse(Response response) + internal static AnalyzeDocumentOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAnalyzeDocumentContent(document.RootElement); + return DeserializeAnalyzeDocumentOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentOptions.cs similarity index 59% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentOptions.cs index 33d60f8cbb97..36b1d59f95fa 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeDocumentOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Document analysis parameters. - public partial class AnalyzeDocumentContent + public partial class AnalyzeDocumentOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,44 +45,18 @@ public partial class AnalyzeDocumentContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AnalyzeDocumentContent() - { - } - - /// Initializes a new instance of . - /// Document URL to analyze. Either urlSource or base64Source must be specified. - /// + /// Initializes a new instance of . + /// 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. /// /// Keeps track of any properties unknown to the library. - internal AnalyzeDocumentContent(Uri urlSource, BinaryData base64Source, IDictionary serializedAdditionalRawData) + internal AnalyzeDocumentOptions(Uri uriSource, BinaryData bytesSource, IDictionary serializedAdditionalRawData) { - UrlSource = urlSource; - Base64Source = base64Source; + UriSource = uriSource; + BytesSource = bytesSource; _serializedAdditionalRawData = serializedAdditionalRawData; } - - /// 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 index e5c8f2485cea..caeff1bb8e0d 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.Serialization.cs @@ -184,7 +184,7 @@ internal static AnalyzeResult DeserializeAnalyzeResult(JsonElement element, Mode string apiVersion = default; string modelId = default; StringIndexType stringIndexType = default; - ContentFormat? contentFormat = default; + DocumentContentFormat? contentFormat = default; string content = default; IReadOnlyList pages = default; IReadOnlyList paragraphs = default; @@ -221,7 +221,7 @@ internal static AnalyzeResult DeserializeAnalyzeResult(JsonElement element, Mode { continue; } - contentFormat = new ContentFormat(property.Value.GetString()); + contentFormat = new DocumentContentFormat(property.Value.GetString()); continue; } if (property.NameEquals("content"u8)) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs index 9a5c932ac12e..9f736fd4f89f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzeResult.cs @@ -99,7 +99,7 @@ internal AnalyzeResult(string apiVersion, string modelId, StringIndexType string /// Extracted documents. /// List of warnings encountered. /// Keeps track of any properties unknown to the library. - internal AnalyzeResult(string apiVersion, string modelId, StringIndexType stringIndexType, ContentFormat? contentFormat, string content, IReadOnlyList pages, IReadOnlyList paragraphs, IReadOnlyList tables, IReadOnlyList figures, IReadOnlyList sections, IReadOnlyList keyValuePairs, IReadOnlyList styles, IReadOnlyList languages, IReadOnlyList documents, IReadOnlyList warnings, IDictionary serializedAdditionalRawData) + internal AnalyzeResult(string apiVersion, string modelId, StringIndexType stringIndexType, DocumentContentFormat? contentFormat, string content, IReadOnlyList pages, IReadOnlyList paragraphs, IReadOnlyList tables, IReadOnlyList figures, IReadOnlyList sections, IReadOnlyList keyValuePairs, IReadOnlyList styles, IReadOnlyList languages, IReadOnlyList documents, IReadOnlyList warnings, IDictionary serializedAdditionalRawData) { ApiVersion = apiVersion; ModelId = modelId; @@ -128,10 +128,8 @@ internal AnalyzeResult() 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; } + public DocumentContentFormat? ContentFormat { get; } /// /// Concatenate string representation of all textual and visual elements in reading /// order. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs index 18123dc5e310..8b1a6e5d8db2 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("docType"u8); - writer.WriteStringValue(DocType); + writer.WriteStringValue(DocumentType); if (Optional.IsCollectionDefined(BoundingRegions)) { writer.WritePropertyName("boundingRegions"u8); @@ -53,14 +53,14 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - if (Optional.IsCollectionDefined(Fields)) + if (Optional.IsCollectionDefined(FieldsPrivate)) { writer.WritePropertyName("fields"u8); writer.WriteStartObject(); - foreach (var item in Fields) + foreach (var item in FieldsPrivate) { writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); + writer.WriteObjectValue(item.Value, options); } writer.WriteEndObject(); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs index a6d26d0ed43b..3e1baa90292c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AnalyzedDocument.cs @@ -47,35 +47,35 @@ public partial class AnalyzedDocument private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Document type. + /// 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) + /// or is null. + internal AnalyzedDocument(string documentType, IEnumerable spans, float confidence) { - Argument.AssertNotNull(docType, nameof(docType)); + Argument.AssertNotNull(documentType, nameof(documentType)); Argument.AssertNotNull(spans, nameof(spans)); - DocType = docType; + DocumentType = documentType; BoundingRegions = new ChangeTrackingList(); Spans = spans.ToList(); - Fields = new ChangeTrackingDictionary(); + FieldsPrivate = new ChangeTrackingDictionary(); Confidence = confidence; } /// Initializes a new instance of . - /// Document type. + /// Document type. /// Bounding regions covering the document. /// Location of the document in the reading order concatenated content. - /// Dictionary of named field values. + /// Dictionary of named field values. /// Confidence of correctly extracting the document. /// Keeps track of any properties unknown to the library. - internal AnalyzedDocument(string docType, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyDictionary fields, float confidence, IDictionary serializedAdditionalRawData) + internal AnalyzedDocument(string documentType, IReadOnlyList boundingRegions, IReadOnlyList spans, IReadOnlyDictionary fieldsPrivate, float confidence, IDictionary serializedAdditionalRawData) { - DocType = docType; + DocumentType = documentType; BoundingRegions = boundingRegions; Spans = spans; - Fields = fields; + FieldsPrivate = fieldsPrivate; Confidence = confidence; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,13 +86,11 @@ internal AnalyzedDocument() } /// Document type. - public string DocType { get; } + public string DocumentType { 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/AuthorizeClassifierCopyContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyOptions.Serialization.cs similarity index 79% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyOptions.Serialization.cs index 00f5b72fbb60..f7f2a1e30b8a 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AuthorizeClassifierCopyContent : IUtf8JsonSerializable, IJsonModel + public partial class AuthorizeClassifierCopyOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AuthorizeClassifierCopyContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AuthorizeClassifierCopyOptions)} does not support writing '{format}' format."); } writer.WritePropertyName("classifierId"u8); @@ -69,19 +69,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AuthorizeClassifierCopyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AuthorizeClassifierCopyOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AuthorizeClassifierCopyContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AuthorizeClassifierCopyOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAuthorizeClassifierCopyContent(document.RootElement, options); + return DeserializeAuthorizeClassifierCopyOptions(document.RootElement, options); } - internal static AuthorizeClassifierCopyContent DeserializeAuthorizeClassifierCopyContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static AuthorizeClassifierCopyOptions DeserializeAuthorizeClassifierCopyOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -126,46 +126,46 @@ internal static AuthorizeClassifierCopyContent DeserializeAuthorizeClassifierCop } } serializedAdditionalRawData = rawDataDictionary; - return new AuthorizeClassifierCopyContent(classifierId, description, tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new AuthorizeClassifierCopyOptions(classifierId, description, tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AuthorizeClassifierCopyContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AuthorizeClassifierCopyOptions)} does not support writing '{options.Format}' format."); } } - AuthorizeClassifierCopyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AuthorizeClassifierCopyOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAuthorizeClassifierCopyContent(document.RootElement, options); + return DeserializeAuthorizeClassifierCopyOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AuthorizeClassifierCopyContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AuthorizeClassifierCopyOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AuthorizeClassifierCopyContent FromResponse(Response response) + internal static AuthorizeClassifierCopyOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAuthorizeClassifierCopyContent(document.RootElement); + return DeserializeAuthorizeClassifierCopyOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyOptions.cs similarity index 89% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyOptions.cs index 5a932a7e0ae1..0c87499b2bd4 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeClassifierCopyOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Request body to authorize document classifier copy. - public partial class AuthorizeClassifierCopyContent + public partial class AuthorizeClassifierCopyOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,10 +45,10 @@ public partial class AuthorizeClassifierCopyContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document classifier name. /// is null. - public AuthorizeClassifierCopyContent(string classifierId) + public AuthorizeClassifierCopyOptions(string classifierId) { Argument.AssertNotNull(classifierId, nameof(classifierId)); @@ -56,12 +56,12 @@ public AuthorizeClassifierCopyContent(string classifierId) Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document classifier name. /// Document classifier description. /// List of key-value tag attributes associated with the document classifier. /// Keeps track of any properties unknown to the library. - internal AuthorizeClassifierCopyContent(string classifierId, string description, IDictionary tags, IDictionary serializedAdditionalRawData) + internal AuthorizeClassifierCopyOptions(string classifierId, string description, IDictionary tags, IDictionary serializedAdditionalRawData) { ClassifierId = classifierId; Description = description; @@ -69,8 +69,8 @@ internal AuthorizeClassifierCopyContent(string classifierId, string description, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AuthorizeClassifierCopyContent() + /// Initializes a new instance of for deserialization. + internal AuthorizeClassifierCopyOptions() { } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeModelCopyOptions.Serialization.cs similarity index 72% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeModelCopyOptions.Serialization.cs index 079e66d1ceef..91b8da1a144d 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeModelCopyOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AuthorizeCopyContent : IUtf8JsonSerializable, IJsonModel + public partial class AuthorizeModelCopyOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AuthorizeCopyContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AuthorizeModelCopyOptions)} does not support writing '{format}' format."); } writer.WritePropertyName("modelId"u8); @@ -69,19 +69,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AuthorizeCopyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AuthorizeModelCopyOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AuthorizeCopyContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AuthorizeModelCopyOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAuthorizeCopyContent(document.RootElement, options); + return DeserializeAuthorizeModelCopyOptions(document.RootElement, options); } - internal static AuthorizeCopyContent DeserializeAuthorizeCopyContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static AuthorizeModelCopyOptions DeserializeAuthorizeModelCopyOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -126,46 +126,46 @@ internal static AuthorizeCopyContent DeserializeAuthorizeCopyContent(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new AuthorizeCopyContent(modelId, description, tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new AuthorizeModelCopyOptions(modelId, description, tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AuthorizeCopyContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AuthorizeModelCopyOptions)} does not support writing '{options.Format}' format."); } } - AuthorizeCopyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AuthorizeModelCopyOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAuthorizeCopyContent(document.RootElement, options); + return DeserializeAuthorizeModelCopyOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AuthorizeCopyContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AuthorizeModelCopyOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AuthorizeCopyContent FromResponse(Response response) + internal static AuthorizeModelCopyOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAuthorizeCopyContent(document.RootElement); + return DeserializeAuthorizeModelCopyOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeModelCopyOptions.cs similarity index 87% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeModelCopyOptions.cs index 410192b66fd9..790d1a4065bc 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeCopyContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AuthorizeModelCopyOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Request body to authorize document model copy. - public partial class AuthorizeCopyContent + public partial class AuthorizeModelCopyOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,10 +45,10 @@ public partial class AuthorizeCopyContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document model name. /// is null. - public AuthorizeCopyContent(string modelId) + public AuthorizeModelCopyOptions(string modelId) { Argument.AssertNotNull(modelId, nameof(modelId)); @@ -56,12 +56,12 @@ public AuthorizeCopyContent(string modelId) Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document model name. /// Document model description. /// List of key-value tag attributes associated with the document model. /// Keeps track of any properties unknown to the library. - internal AuthorizeCopyContent(string modelId, string description, IDictionary tags, IDictionary serializedAdditionalRawData) + internal AuthorizeModelCopyOptions(string modelId, string description, IDictionary tags, IDictionary serializedAdditionalRawData) { ModelId = modelId; Description = description; @@ -69,8 +69,8 @@ internal AuthorizeCopyContent(string modelId, string description, IDictionary Initializes a new instance of for deserialization. - internal AuthorizeCopyContent() + /// Initializes a new instance of for deserialization. + internal AuthorizeModelCopyOptions() { } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobContentSource.Serialization.cs similarity index 66% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobContentSource.Serialization.cs index e6b7b78ddcfc..cbc0e677c947 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobContentSource.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AzureBlobContentSource : IUtf8JsonSerializable, IJsonModel + public partial class BlobContentSource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureBlobContentSource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BlobContentSource)} does not support writing '{format}' format."); } writer.WritePropertyName("containerUrl"u8); - writer.WriteStringValue(ContainerUrl.AbsoluteUri); + writer.WriteStringValue(ContainerUri.AbsoluteUri); if (Optional.IsDefined(Prefix)) { writer.WritePropertyName("prefix"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureBlobContentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BlobContentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureBlobContentSource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BlobContentSource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureBlobContentSource(document.RootElement, options); + return DeserializeBlobContentSource(document.RootElement, options); } - internal static AzureBlobContentSource DeserializeAzureBlobContentSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static BlobContentSource DeserializeBlobContentSource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,46 +100,46 @@ internal static AzureBlobContentSource DeserializeAzureBlobContentSource(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new AzureBlobContentSource(containerUrl, prefix, serializedAdditionalRawData); + return new BlobContentSource(containerUrl, prefix, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AzureBlobContentSource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BlobContentSource)} does not support writing '{options.Format}' format."); } } - AzureBlobContentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BlobContentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureBlobContentSource(document.RootElement, options); + return DeserializeBlobContentSource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureBlobContentSource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BlobContentSource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AzureBlobContentSource FromResponse(Response response) + internal static BlobContentSource FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureBlobContentSource(document.RootElement); + return DeserializeBlobContentSource(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobContentSource.cs similarity index 70% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobContentSource.cs index 674bb401a1f5..953d95a41fcc 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobContentSource.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobContentSource.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Azure Blob Storage content. - public partial class AzureBlobContentSource + public partial class BlobContentSource { /// /// Keeps track of any properties unknown to the library. @@ -45,34 +45,34 @@ public partial class AzureBlobContentSource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Azure Blob Storage container URL. - /// is null. - public AzureBlobContentSource(Uri containerUrl) + /// Initializes a new instance of . + /// Azure Blob Storage container URL. + /// is null. + public BlobContentSource(Uri containerUri) { - Argument.AssertNotNull(containerUrl, nameof(containerUrl)); + Argument.AssertNotNull(containerUri, nameof(containerUri)); - ContainerUrl = containerUrl; + ContainerUri = containerUri; } - /// Initializes a new instance of . - /// Azure Blob Storage container URL. + /// Initializes a new instance of . + /// Azure Blob Storage container URL. /// Blob name prefix. /// Keeps track of any properties unknown to the library. - internal AzureBlobContentSource(Uri containerUrl, string prefix, IDictionary serializedAdditionalRawData) + internal BlobContentSource(Uri containerUri, string prefix, IDictionary serializedAdditionalRawData) { - ContainerUrl = containerUrl; + ContainerUri = containerUri; Prefix = prefix; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AzureBlobContentSource() + /// Initializes a new instance of for deserialization. + internal BlobContentSource() { } /// Azure Blob Storage container URL. - public Uri ContainerUrl { get; set; } + public Uri ContainerUri { 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/BlobFileListContentSource.Serialization.cs similarity index 64% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobFileListContentSource.Serialization.cs index 74982baf9077..b76374fe934c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobFileListContentSource.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class AzureBlobFileListContentSource : IUtf8JsonSerializable, IJsonModel + public partial class BlobFileListContentSource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureBlobFileListContentSource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BlobFileListContentSource)} does not support writing '{format}' format."); } writer.WritePropertyName("containerUrl"u8); - writer.WriteStringValue(ContainerUrl.AbsoluteUri); + writer.WriteStringValue(ContainerUri.AbsoluteUri); writer.WritePropertyName("fileList"u8); writer.WriteStringValue(FileList); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureBlobFileListContentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BlobFileListContentSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureBlobFileListContentSource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BlobFileListContentSource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureBlobFileListContentSource(document.RootElement, options); + return DeserializeBlobFileListContentSource(document.RootElement, options); } - internal static AzureBlobFileListContentSource DeserializeAzureBlobFileListContentSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static BlobFileListContentSource DeserializeBlobFileListContentSource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -97,46 +97,46 @@ internal static AzureBlobFileListContentSource DeserializeAzureBlobFileListConte } } serializedAdditionalRawData = rawDataDictionary; - return new AzureBlobFileListContentSource(containerUrl, fileList, serializedAdditionalRawData); + return new BlobFileListContentSource(containerUrl, fileList, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AzureBlobFileListContentSource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BlobFileListContentSource)} does not support writing '{options.Format}' format."); } } - AzureBlobFileListContentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BlobFileListContentSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureBlobFileListContentSource(document.RootElement, options); + return DeserializeBlobFileListContentSource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureBlobFileListContentSource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BlobFileListContentSource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AzureBlobFileListContentSource FromResponse(Response response) + internal static BlobFileListContentSource FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureBlobFileListContentSource(document.RootElement); + return DeserializeBlobFileListContentSource(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobFileListContentSource.cs similarity index 71% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobFileListContentSource.cs index 8a41b5dd71bf..89829fa56a1b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/AzureBlobFileListContentSource.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BlobFileListContentSource.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// File list in Azure Blob Storage. - public partial class AzureBlobFileListContentSource + public partial class BlobFileListContentSource { /// /// Keeps track of any properties unknown to the library. @@ -45,37 +45,37 @@ public partial class AzureBlobFileListContentSource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Azure Blob Storage container URL. + /// Initializes a new instance of . + /// 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) + /// or is null. + public BlobFileListContentSource(Uri containerUri, string fileList) { - Argument.AssertNotNull(containerUrl, nameof(containerUrl)); + Argument.AssertNotNull(containerUri, nameof(containerUri)); Argument.AssertNotNull(fileList, nameof(fileList)); - ContainerUrl = containerUrl; + ContainerUri = containerUri; FileList = fileList; } - /// Initializes a new instance of . - /// Azure Blob Storage container URL. + /// Initializes a new instance of . + /// Azure Blob Storage container URL. /// Path to a JSONL file within the container specifying a subset of documents. /// Keeps track of any properties unknown to the library. - internal AzureBlobFileListContentSource(Uri containerUrl, string fileList, IDictionary serializedAdditionalRawData) + internal BlobFileListContentSource(Uri containerUri, string fileList, IDictionary serializedAdditionalRawData) { - ContainerUrl = containerUrl; + ContainerUri = containerUri; FileList = fileList; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AzureBlobFileListContentSource() + /// Initializes a new instance of for deserialization. + internal BlobFileListContentSource() { } /// Azure Blob Storage container URL. - public Uri ContainerUrl { get; set; } + public Uri ContainerUri { 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 index 94940df25623..49d21a490da5 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.AI.DocumentIntelligence { - public partial class BoundingRegion : IUtf8JsonSerializable, IJsonModel + public partial struct BoundingRegion : IUtf8JsonSerializable, IJsonModel, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The JSON writer. /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + private void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -72,14 +72,14 @@ BoundingRegion IJsonModel.Create(ref Utf8JsonReader reader, Mode return DeserializeBoundingRegion(document.RootElement, options); } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)this).Write(writer, options); + + object IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)this).Create(ref reader, options); + internal static BoundingRegion DeserializeBoundingRegion(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } int pageNumber = default; IReadOnlyList polygon = default; IDictionary serializedAdditionalRawData = default; @@ -141,6 +141,12 @@ BoundingRegion IPersistableModel.Create(BinaryData data, ModelRe string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ((IPersistableModel)this).Write(options); + + object IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ((IPersistableModel)this).Create(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)this).GetFormatFromOptions(options); + /// Deserializes the model from a raw response. /// The response to deserialize the model from. internal static BoundingRegion FromResponse(Response response) @@ -150,7 +156,7 @@ internal static BoundingRegion FromResponse(Response response) } /// Convert into a . - internal virtual RequestContent ToRequestContent() + internal RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs index e7c2201cf628..ced37dbd6d7b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BoundingRegion.cs @@ -12,7 +12,7 @@ namespace Azure.AI.DocumentIntelligence { /// Bounding polygon on a specific page of the input. - public partial class BoundingRegion + public readonly partial struct BoundingRegion { /// /// Keeps track of any properties unknown to the library. @@ -44,7 +44,7 @@ public partial class BoundingRegion /// /// /// - private IDictionary _serializedAdditionalRawData; + private readonly IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . /// 1-based page number of page containing the bounding region. @@ -80,7 +80,7 @@ internal BoundingRegion(int pageNumber, IReadOnlyList polygon, IDictionar } /// Initializes a new instance of for deserialization. - internal BoundingRegion() + public BoundingRegion() { } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildClassifierOptions.Serialization.cs similarity index 75% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildClassifierOptions.Serialization.cs index 5099537cd321..a336cee0363e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildClassifierOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class BuildDocumentClassifierContent : IUtf8JsonSerializable, IJsonModel + public partial class BuildClassifierOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BuildDocumentClassifierContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BuildClassifierOptions)} does not support writing '{format}' format."); } writer.WritePropertyName("classifierId"u8); @@ -48,7 +48,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("docTypes"u8); writer.WriteStartObject(); - foreach (var item in DocTypes) + foreach (var item in DocumentTypes) { writer.WritePropertyName(item.Key); writer.WriteObjectValue(item.Value, options); @@ -76,19 +76,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BuildDocumentClassifierContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BuildClassifierOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BuildDocumentClassifierContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BuildClassifierOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBuildDocumentClassifierContent(document.RootElement, options); + return DeserializeBuildClassifierOptions(document.RootElement, options); } - internal static BuildDocumentClassifierContent DeserializeBuildDocumentClassifierContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static BuildClassifierOptions DeserializeBuildClassifierOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -145,7 +145,7 @@ internal static BuildDocumentClassifierContent DeserializeBuildDocumentClassifie } } serializedAdditionalRawData = rawDataDictionary; - return new BuildDocumentClassifierContent( + return new BuildClassifierOptions( classifierId, description, baseClassifierId, @@ -154,43 +154,43 @@ internal static BuildDocumentClassifierContent DeserializeBuildDocumentClassifie serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(BuildDocumentClassifierContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BuildClassifierOptions)} does not support writing '{options.Format}' format."); } } - BuildDocumentClassifierContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BuildClassifierOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBuildDocumentClassifierContent(document.RootElement, options); + return DeserializeBuildClassifierOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BuildDocumentClassifierContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BuildClassifierOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static BuildDocumentClassifierContent FromResponse(Response response) + internal static BuildClassifierOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeBuildDocumentClassifierContent(document.RootElement); + return DeserializeBuildClassifierOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildClassifierOptions.cs similarity index 77% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildClassifierOptions.cs index 05e53d74b193..8d9cd134cd9c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentClassifierContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildClassifierOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Request body to build a new custom document classifier. - public partial class BuildDocumentClassifierContent + public partial class BuildClassifierOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,38 +45,38 @@ public partial class BuildDocumentClassifierContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document classifier name. - /// List of document types to classify against. - /// or is null. - public BuildDocumentClassifierContent(string classifierId, IDictionary docTypes) + /// List of document types to classify against. + /// or is null. + public BuildClassifierOptions(string classifierId, IDictionary documentTypes) { Argument.AssertNotNull(classifierId, nameof(classifierId)); - Argument.AssertNotNull(docTypes, nameof(docTypes)); + Argument.AssertNotNull(documentTypes, nameof(documentTypes)); ClassifierId = classifierId; - DocTypes = docTypes; + DocumentTypes = documentTypes; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document classifier name. /// Document classifier description. /// Base classifierId on top of which to train the classifier. - /// List of document types to classify against. + /// List of document types to classify against. /// Allow overwriting an existing classifier with the same name. /// Keeps track of any properties unknown to the library. - internal BuildDocumentClassifierContent(string classifierId, string description, string baseClassifierId, IDictionary docTypes, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + internal BuildClassifierOptions(string classifierId, string description, string baseClassifierId, IDictionary documentTypes, bool? allowOverwrite, IDictionary serializedAdditionalRawData) { ClassifierId = classifierId; Description = description; BaseClassifierId = baseClassifierId; - DocTypes = docTypes; + DocumentTypes = documentTypes; AllowOverwrite = allowOverwrite; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BuildDocumentClassifierContent() + /// Initializes a new instance of for deserialization. + internal BuildClassifierOptions() { } @@ -87,7 +87,7 @@ internal BuildDocumentClassifierContent() /// Base classifierId on top of which to train the classifier. public string BaseClassifierId { get; set; } /// List of document types to classify against. - public IDictionary DocTypes { get; } + public IDictionary DocumentTypes { get; } /// Allow overwriting an existing classifier with the same name. public bool? AllowOverwrite { get; set; } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelOptions.Serialization.cs similarity index 79% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelOptions.Serialization.cs index e86ab5a5e9b7..9f020a4d76d6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class BuildDocumentModelContent : IUtf8JsonSerializable, IJsonModel + public partial class BuildDocumentModelOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BuildDocumentModelContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BuildDocumentModelOptions)} does not support writing '{format}' format."); } writer.WritePropertyName("modelId"u8); @@ -43,15 +43,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("buildMode"u8); writer.WriteStringValue(BuildMode.ToString()); - if (Optional.IsDefined(AzureBlobSource)) + if (Optional.IsDefined(BlobSource)) { writer.WritePropertyName("azureBlobSource"u8); - writer.WriteObjectValue(AzureBlobSource, options); + writer.WriteObjectValue(BlobSource, options); } - if (Optional.IsDefined(AzureBlobFileListSource)) + if (Optional.IsDefined(BlobFileListSource)) { writer.WritePropertyName("azureBlobFileListSource"u8); - writer.WriteObjectValue(AzureBlobFileListSource, options); + writer.WriteObjectValue(BlobFileListSource, options); } if (Optional.IsCollectionDefined(Tags)) { @@ -91,19 +91,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BuildDocumentModelContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BuildDocumentModelOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BuildDocumentModelContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BuildDocumentModelOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBuildDocumentModelContent(document.RootElement, options); + return DeserializeBuildDocumentModelOptions(document.RootElement, options); } - internal static BuildDocumentModelContent DeserializeBuildDocumentModelContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static BuildDocumentModelOptions DeserializeBuildDocumentModelOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -114,8 +114,8 @@ internal static BuildDocumentModelContent DeserializeBuildDocumentModelContent(J string modelId = default; string description = default; DocumentBuildMode buildMode = default; - AzureBlobContentSource azureBlobSource = default; - AzureBlobFileListContentSource azureBlobFileListSource = default; + BlobContentSource azureBlobSource = default; + BlobFileListContentSource azureBlobFileListSource = default; IDictionary tags = default; float? maxTrainingHours = default; bool? allowOverwrite = default; @@ -144,7 +144,7 @@ internal static BuildDocumentModelContent DeserializeBuildDocumentModelContent(J { continue; } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value, options); + azureBlobSource = BlobContentSource.DeserializeBlobContentSource(property.Value, options); continue; } if (property.NameEquals("azureBlobFileListSource"u8)) @@ -153,7 +153,7 @@ internal static BuildDocumentModelContent DeserializeBuildDocumentModelContent(J { continue; } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value, options); + azureBlobFileListSource = BlobFileListContentSource.DeserializeBlobFileListContentSource(property.Value, options); continue; } if (property.NameEquals("tags"u8)) @@ -194,7 +194,7 @@ internal static BuildDocumentModelContent DeserializeBuildDocumentModelContent(J } } serializedAdditionalRawData = rawDataDictionary; - return new BuildDocumentModelContent( + return new BuildDocumentModelOptions( modelId, description, buildMode, @@ -206,43 +206,43 @@ internal static BuildDocumentModelContent DeserializeBuildDocumentModelContent(J serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(BuildDocumentModelContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BuildDocumentModelOptions)} does not support writing '{options.Format}' format."); } } - BuildDocumentModelContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BuildDocumentModelOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBuildDocumentModelContent(document.RootElement, options); + return DeserializeBuildDocumentModelOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BuildDocumentModelContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BuildDocumentModelOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static BuildDocumentModelContent FromResponse(Response response) + internal static BuildDocumentModelOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeBuildDocumentModelContent(document.RootElement); + return DeserializeBuildDocumentModelOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelOptions.cs similarity index 67% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelOptions.cs index 5196b9db1f82..4e763d90cf0f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/BuildDocumentModelOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Request body to build a new custom document model. - public partial class BuildDocumentModelContent + public partial class BuildDocumentModelOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,28 +45,15 @@ public partial class BuildDocumentModelContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Unique document model name. - /// Custom document model build mode. - /// is null. - public BuildDocumentModelContent(string modelId, DocumentBuildMode buildMode) - { - Argument.AssertNotNull(modelId, nameof(modelId)); - - ModelId = modelId; - BuildMode = buildMode; - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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. /// @@ -74,21 +61,21 @@ public BuildDocumentModelContent(string modelId, DocumentBuildMode buildMode) /// Max number of V100-equivalent GPU hours to use for model training. Default=0.5. /// Allow overwriting an existing model with the same name. /// Keeps track of any properties unknown to the library. - internal BuildDocumentModelContent(string modelId, string description, DocumentBuildMode buildMode, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, IDictionary tags, float? maxTrainingHours, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + internal BuildDocumentModelOptions(string modelId, string description, DocumentBuildMode buildMode, BlobContentSource blobSource, BlobFileListContentSource blobFileListSource, IDictionary tags, float? maxTrainingHours, bool? allowOverwrite, IDictionary serializedAdditionalRawData) { ModelId = modelId; Description = description; BuildMode = buildMode; - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; + BlobSource = blobSource; + BlobFileListSource = blobFileListSource; Tags = tags; MaxTrainingHours = maxTrainingHours; AllowOverwrite = allowOverwrite; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BuildDocumentModelContent() + /// Initializes a new instance of for deserialization. + internal BuildDocumentModelOptions() { } @@ -98,16 +85,6 @@ internal BuildDocumentModelContent() 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; } /// Max number of V100-equivalent GPU hours to use for model training. Default=0.5. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.Serialization.cs index 2e3289025ad3..881e7bfc1cee 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.Serialization.cs @@ -45,7 +45,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("accessToken"u8); writer.WriteStringValue(AccessToken); writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime, "O"); + writer.WriteStringValue(ExpiresOn, "O"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.cs index 3b729ee808c5..b87eccbb81a1 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierCopyAuthorization.cs @@ -57,9 +57,9 @@ public partial class ClassifierCopyAuthorization /// Identifier of the target document classifier. /// URL of the copied document classifier in the target account. /// Token used to authorize the request. - /// Date/time when the access token expires. + /// Date/time when the access token expires. /// , , , or is null. - public ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, Uri targetClassifierLocation, string accessToken, DateTimeOffset expirationDateTime) + public ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, Uri targetClassifierLocation, string accessToken, DateTimeOffset expiresOn) { Argument.AssertNotNull(targetResourceId, nameof(targetResourceId)); Argument.AssertNotNull(targetResourceRegion, nameof(targetResourceRegion)); @@ -72,7 +72,7 @@ public ClassifierCopyAuthorization(string targetResourceId, string targetResourc TargetClassifierId = targetClassifierId; TargetClassifierLocation = targetClassifierLocation; AccessToken = accessToken; - ExpirationDateTime = expirationDateTime; + ExpiresOn = expiresOn; } /// Initializes a new instance of . @@ -84,16 +84,16 @@ public ClassifierCopyAuthorization(string targetResourceId, string targetResourc /// Identifier of the target document classifier. /// URL of the copied document classifier in the target account. /// Token used to authorize the request. - /// Date/time when the access token expires. + /// Date/time when the access token expires. /// Keeps track of any properties unknown to the library. - internal ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, Uri targetClassifierLocation, string accessToken, DateTimeOffset expirationDateTime, IDictionary serializedAdditionalRawData) + internal ClassifierCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetClassifierId, Uri targetClassifierLocation, string accessToken, DateTimeOffset expiresOn, IDictionary serializedAdditionalRawData) { TargetResourceId = targetResourceId; TargetResourceRegion = targetResourceRegion; TargetClassifierId = targetClassifierId; TargetClassifierLocation = targetClassifierLocation; AccessToken = accessToken; - ExpirationDateTime = expirationDateTime; + ExpiresOn = expiresOn; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -116,6 +116,6 @@ internal ClassifierCopyAuthorization() /// Token used to authorize the request. public string AccessToken { get; set; } /// Date/time when the access token expires. - public DateTimeOffset ExpirationDateTime { get; set; } + public DateTimeOffset ExpiresOn { get; set; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs index 94022e6ae249..bd33ed3a6b2c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.Serialization.cs @@ -39,15 +39,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sourceKind"u8); writer.WriteStringValue(SourceKind.Value.ToString()); } - if (Optional.IsDefined(AzureBlobSource)) + if (Optional.IsDefined(BlobSource)) { writer.WritePropertyName("azureBlobSource"u8); - writer.WriteObjectValue(AzureBlobSource, options); + writer.WriteObjectValue(BlobSource, options); } - if (Optional.IsDefined(AzureBlobFileListSource)) + if (Optional.IsDefined(BlobFileListSource)) { writer.WritePropertyName("azureBlobFileListSource"u8); - writer.WriteObjectValue(AzureBlobFileListSource, options); + writer.WriteObjectValue(BlobFileListSource, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,8 +87,8 @@ internal static ClassifierDocumentTypeDetails DeserializeClassifierDocumentTypeD return null; } ContentSourceKind? sourceKind = default; - AzureBlobContentSource azureBlobSource = default; - AzureBlobFileListContentSource azureBlobFileListSource = default; + BlobContentSource azureBlobSource = default; + BlobFileListContentSource azureBlobFileListSource = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -108,7 +108,7 @@ internal static ClassifierDocumentTypeDetails DeserializeClassifierDocumentTypeD { continue; } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value, options); + azureBlobSource = BlobContentSource.DeserializeBlobContentSource(property.Value, options); continue; } if (property.NameEquals("azureBlobFileListSource"u8)) @@ -117,7 +117,7 @@ internal static ClassifierDocumentTypeDetails DeserializeClassifierDocumentTypeD { continue; } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value, options); + azureBlobFileListSource = BlobFileListContentSource.DeserializeBlobFileListContentSource(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs index 85627306f3bc..63712a4720e4 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifierDocumentTypeDetails.cs @@ -45,45 +45,28 @@ public partial class ClassifierDocumentTypeDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ClassifierDocumentTypeDetails() - { - } - /// Initializes a new instance of . /// 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. /// /// Keeps track of any properties unknown to the library. - internal ClassifierDocumentTypeDetails(ContentSourceKind? sourceKind, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, IDictionary serializedAdditionalRawData) + internal ClassifierDocumentTypeDetails(ContentSourceKind? sourceKind, BlobContentSource blobSource, BlobFileListContentSource blobFileListSource, IDictionary serializedAdditionalRawData) { SourceKind = sourceKind; - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; + BlobSource = blobSource; + BlobFileListSource = blobFileListSource; _serializedAdditionalRawData = serializedAdditionalRawData; } /// 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/ClassifyDocumentContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentOptions.Serialization.cs similarity index 73% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentOptions.Serialization.cs index ed47115e2677..8e2efe4a0c0b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class ClassifyDocumentContent : IUtf8JsonSerializable, IJsonModel + public partial class ClassifyDocumentOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,21 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClassifyDocumentContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ClassifyDocumentOptions)} does not support writing '{format}' format."); } - if (Optional.IsDefined(UrlSource)) + if (Optional.IsDefined(UriSource)) { writer.WritePropertyName("urlSource"u8); - writer.WriteStringValue(UrlSource.AbsoluteUri); + writer.WriteStringValue(UriSource.AbsoluteUri); } - if (Optional.IsDefined(Base64Source)) + if (Optional.IsDefined(BytesSource)) { writer.WritePropertyName("base64Source"u8); - writer.WriteBase64StringValue(Base64Source.ToArray(), "D"); + writer.WriteBase64StringValue(BytesSource.ToArray(), "D"); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ClassifyDocumentContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ClassifyDocumentOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ClassifyDocumentContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ClassifyDocumentOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeClassifyDocumentContent(document.RootElement, options); + return DeserializeClassifyDocumentOptions(document.RootElement, options); } - internal static ClassifyDocumentContent DeserializeClassifyDocumentContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static ClassifyDocumentOptions DeserializeClassifyDocumentOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,46 +111,46 @@ internal static ClassifyDocumentContent DeserializeClassifyDocumentContent(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new ClassifyDocumentContent(urlSource, base64Source, serializedAdditionalRawData); + return new ClassifyDocumentOptions(urlSource, base64Source, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ClassifyDocumentContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ClassifyDocumentOptions)} does not support writing '{options.Format}' format."); } } - ClassifyDocumentContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ClassifyDocumentOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeClassifyDocumentContent(document.RootElement, options); + return DeserializeClassifyDocumentOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ClassifyDocumentContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ClassifyDocumentOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ClassifyDocumentContent FromResponse(Response response) + internal static ClassifyDocumentOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeClassifyDocumentContent(document.RootElement); + return DeserializeClassifyDocumentOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentOptions.cs similarity index 59% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentOptions.cs index 3ba46a568ff9..8586a205ba1a 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ClassifyDocumentOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Document classification parameters. - public partial class ClassifyDocumentContent + public partial class ClassifyDocumentOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,44 +45,18 @@ public partial class ClassifyDocumentContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ClassifyDocumentContent() - { - } - - /// Initializes a new instance of . - /// Document URL to classify. Either urlSource or base64Source must be specified. - /// + /// Initializes a new instance of . + /// 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. /// /// Keeps track of any properties unknown to the library. - internal ClassifyDocumentContent(Uri urlSource, BinaryData base64Source, IDictionary serializedAdditionalRawData) + internal ClassifyDocumentOptions(Uri uriSource, BinaryData bytesSource, IDictionary serializedAdditionalRawData) { - UrlSource = urlSource; - Base64Source = base64Source; + UriSource = uriSource; + BytesSource = bytesSource; _serializedAdditionalRawData = serializedAdditionalRawData; } - - /// 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/ComposeDocumentModelContent.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeModelOptions.Serialization.cs similarity index 78% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelContent.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeModelOptions.Serialization.cs index 306bc5523dfd..4268224e7591 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelContent.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeModelOptions.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class ComposeDocumentModelContent : IUtf8JsonSerializable, IJsonModel + public partial class ComposeModelOptions : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ComposeDocumentModelContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ComposeModelOptions)} does not support writing '{format}' format."); } writer.WritePropertyName("modelId"u8); @@ -50,7 +50,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("docTypes"u8); writer.WriteStartObject(); - foreach (var item in DocTypes) + foreach (var item in DocumentTypes) { writer.WritePropertyName(item.Key); writer.WriteObjectValue(item.Value, options); @@ -84,19 +84,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ComposeDocumentModelContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ComposeModelOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ComposeDocumentModelContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ComposeModelOptions)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeComposeDocumentModelContent(document.RootElement, options); + return DeserializeComposeModelOptions(document.RootElement, options); } - internal static ComposeDocumentModelContent DeserializeComposeDocumentModelContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static ComposeModelOptions DeserializeComposeModelOptions(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -168,7 +168,7 @@ internal static ComposeDocumentModelContent DeserializeComposeDocumentModelConte } } serializedAdditionalRawData = rawDataDictionary; - return new ComposeDocumentModelContent( + return new ComposeModelOptions( modelId, description, classifierId, @@ -178,43 +178,43 @@ internal static ComposeDocumentModelContent DeserializeComposeDocumentModelConte serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ComposeDocumentModelContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ComposeModelOptions)} does not support writing '{options.Format}' format."); } } - ComposeDocumentModelContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ComposeModelOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeComposeDocumentModelContent(document.RootElement, options); + return DeserializeComposeModelOptions(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ComposeDocumentModelContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ComposeModelOptions)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static ComposeDocumentModelContent FromResponse(Response response) + internal static ComposeModelOptions FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeComposeDocumentModelContent(document.RootElement); + return DeserializeComposeModelOptions(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelContent.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeModelOptions.cs similarity index 78% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelContent.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeModelOptions.cs index 4e28672298d1..b0d66b96de9a 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeDocumentModelContent.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ComposeModelOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Request body to create a composed document model from component document models. - public partial class ComposeDocumentModelContent + public partial class ComposeModelOptions { /// /// Keeps track of any properties unknown to the library. @@ -45,44 +45,44 @@ public partial class ComposeDocumentModelContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document model name. /// Custom classifier to split and classify the input file. - /// Dictionary mapping supported docTypes to the corresponding document models. - /// , or is null. - public ComposeDocumentModelContent(string modelId, string classifierId, IDictionary docTypes) + /// Dictionary mapping supported docTypes to the corresponding document models. + /// , or is null. + public ComposeModelOptions(string modelId, string classifierId, IDictionary documentTypes) { Argument.AssertNotNull(modelId, nameof(modelId)); Argument.AssertNotNull(classifierId, nameof(classifierId)); - Argument.AssertNotNull(docTypes, nameof(docTypes)); + Argument.AssertNotNull(documentTypes, nameof(documentTypes)); ModelId = modelId; ClassifierId = classifierId; - DocTypes = docTypes; + DocumentTypes = documentTypes; Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document model name. /// Document model description. /// Custom classifier to split and classify the input file. /// File splitting behavior. - /// Dictionary mapping supported docTypes to the corresponding document models. + /// Dictionary mapping supported docTypes to the corresponding document models. /// List of key-value tag attributes associated with the document model. /// Keeps track of any properties unknown to the library. - internal ComposeDocumentModelContent(string modelId, string description, string classifierId, SplitMode? split, IDictionary docTypes, IDictionary tags, IDictionary serializedAdditionalRawData) + internal ComposeModelOptions(string modelId, string description, string classifierId, SplitMode? split, IDictionary documentTypes, IDictionary tags, IDictionary serializedAdditionalRawData) { ModelId = modelId; Description = description; ClassifierId = classifierId; Split = split; - DocTypes = docTypes; + DocumentTypes = documentTypes; Tags = tags; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ComposeDocumentModelContent() + /// Initializes a new instance of for deserialization. + internal ComposeModelOptions() { } @@ -95,7 +95,7 @@ internal ComposeDocumentModelContent() /// File splitting behavior. public SplitMode? Split { get; set; } /// Dictionary mapping supported docTypes to the corresponding document models. - public IDictionary DocTypes { get; } + public IDictionary DocumentTypes { 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/ContentSourceKind.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentSourceKind.cs index 0ecff76f4f87..1570553ec115 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentSourceKind.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentSourceKind.cs @@ -22,19 +22,19 @@ 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"; + private const string UriValue = "url"; + private const string BytesValue = "base64"; + private const string BlobValue = "azureBlob"; + private const string BlobFileListValue = "azureBlobFileList"; /// Content at a specific URL. - public static ContentSourceKind Url { get; } = new ContentSourceKind(UrlValue); + public static ContentSourceKind Uri { get; } = new ContentSourceKind(UriValue); /// Content represented via Base64 encoding. - public static ContentSourceKind Base64 { get; } = new ContentSourceKind(Base64Value); + public static ContentSourceKind Bytes { get; } = new ContentSourceKind(BytesValue); /// Files in a path within an Azure Blob Storage container. - public static ContentSourceKind AzureBlob { get; } = new ContentSourceKind(AzureBlobValue); + public static ContentSourceKind Blob { get; } = new ContentSourceKind(BlobValue); /// A file list specifying individual files in an Azure Blob Storage container. - public static ContentSourceKind AzureBlobFileList { get; } = new ContentSourceKind(AzureBlobFileListValue); + public static ContentSourceKind BlobFileList { get; } = new ContentSourceKind(BlobFileListValue); /// 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. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceAdministrationClient.xml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceAdministrationClient.xml index 99c79f304856..6406e0b9fd49 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceAdministrationClient.xml +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceAdministrationClient.xml @@ -1,7 +1,7 @@ - + This sample shows how to call AuthorizeModelCopyAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -AuthorizeCopyContent authorizeCopyRequest = new AuthorizeCopyContent("targetModel") +AuthorizeModelCopyOptions authorizeCopyRequest = new AuthorizeModelCopyOptions("targetModel") { Description = "Target model description", }; -Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); +Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); ]]> - + This sample shows how to call AuthorizeModelCopy. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -AuthorizeCopyContent authorizeCopyRequest = new AuthorizeCopyContent("targetModel") +AuthorizeModelCopyOptions authorizeCopyRequest = new AuthorizeModelCopyOptions("targetModel") { Description = "Target model description", }; -Response response = client.AuthorizeModelCopy(authorizeCopyRequest); +Response response = client.AuthorizeModelCopy(authorizeCopyRequest); ]]> @@ -197,52 +197,52 @@ Response response = client.DeleteModel("myCustomModel"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call GetResourceInfoAsync. +This sample shows how to call GetResourceDetailsAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -Response response = await client.GetResourceInfoAsync(); +Response response = await client.GetResourceDetailsAsync(); ]]> - + -This sample shows how to call GetResourceInfo. +This sample shows how to call GetResourceDetails. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -Response response = client.GetResourceInfo(); +Response response = client.GetResourceDetails(); ]]> - + -This sample shows how to call GetResourceInfoAsync and parse the result. +This sample shows how to call GetResourceDetailsAsync and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -Response response = await client.GetResourceInfoAsync(null); +Response response = await client.GetResourceDetailsAsync(null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("limit").ToString()); ]]> - + -This sample shows how to call GetResourceInfo and parse the result. +This sample shows how to call GetResourceDetails and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -Response response = client.GetResourceInfo(null); +Response response = client.GetResourceDetails(null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); @@ -257,7 +257,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -Response response = await client.GetOperationAsync("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); +Response response = await client.GetOperationAsync("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); ]]> @@ -268,7 +268,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -Response response = client.GetOperation("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); +Response response = client.GetOperation("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); ]]> @@ -309,7 +309,7 @@ Console.WriteLine(result.GetProperty("kind").ToString()); Console.WriteLine(result.GetProperty("resourceLocation").ToString()); ]]> - + This sample shows how to call AuthorizeClassifierCopyAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -AuthorizeClassifierCopyContent authorizeCopyRequest = new AuthorizeClassifierCopyContent("targetClassifier") +AuthorizeClassifierCopyOptions authorizeCopyRequest = new AuthorizeClassifierCopyOptions("targetClassifier") { Description = "Target classifier description", }; Response response = await client.AuthorizeClassifierCopyAsync(authorizeCopyRequest); ]]> - + This sample shows how to call AuthorizeClassifierCopy. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -AuthorizeClassifierCopyContent authorizeCopyRequest = new AuthorizeClassifierCopyContent("targetClassifier") +AuthorizeClassifierCopyOptions authorizeCopyRequest = new AuthorizeClassifierCopyOptions("targetClassifier") { Description = "Target classifier description", }; @@ -535,7 +535,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -await foreach (OperationDetails item in client.GetOperationsAsync()) +await foreach (DocumentIntelligenceOperationDetails item in client.GetOperationsAsync()) { } ]]> @@ -548,7 +548,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -foreach (OperationDetails item in client.GetOperations()) +foreach (DocumentIntelligenceOperationDetails item in client.GetOperations()) { } ]]> @@ -655,7 +655,7 @@ foreach (BinaryData item in client.GetClassifiers(null)) } ]]> - + This sample shows how to call BuildDocumentModelAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -BuildDocumentModelContent buildRequest = new BuildDocumentModelContent("myCustomModel", DocumentBuildMode.Template) +BuildDocumentModelOptions buildRequest = new BuildDocumentModelOptions("myCustomModel", DocumentBuildMode.Template) { Description = "Custom model description", - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "trainingDocs/", - }, Tags = { ["createdBy"] = "myUserId" @@ -679,7 +675,7 @@ Operation operation = await client.BuildDocumentModelAsync DocumentModelDetails responseData = operation.Value; ]]> - + This sample shows how to call BuildDocumentModel. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -BuildDocumentModelContent buildRequest = new BuildDocumentModelContent("myCustomModel", DocumentBuildMode.Template) +BuildDocumentModelOptions buildRequest = new BuildDocumentModelOptions("myCustomModel", DocumentBuildMode.Template) { Description = "Custom model description", - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "trainingDocs/", - }, Tags = { ["createdBy"] = "myUserId" @@ -765,7 +757,7 @@ Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> - + This sample shows how to call ComposeModelAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -ComposeDocumentModelContent composeRequest = new ComposeDocumentModelContent("composedModel", "customClassifier", new Dictionary +ComposeModelOptions composeRequest = new ComposeModelOptions("composedModel", "customClassifier", new Dictionary { ["formA"] = new DocumentTypeDetails { @@ -791,7 +783,7 @@ Operation operation = await client.ComposeModelAsync(WaitU DocumentModelDetails responseData = operation.Value; ]]> - + This sample shows how to call ComposeModel. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -ComposeDocumentModelContent composeRequest = new ComposeDocumentModelContent("composedModel", "customClassifier", new Dictionary +ComposeModelOptions composeRequest = new ComposeModelOptions("composedModel", "customClassifier", new Dictionary { ["formA"] = new DocumentTypeDetails { @@ -883,7 +875,7 @@ Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> - + This sample shows how to call CopyModelToAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -CopyAuthorization copyToRequest = new CopyAuthorization( +ModelCopyAuthorization copyToRequest = new ModelCopyAuthorization( "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService", "targetResourceRegion", "targetModel", @@ -902,7 +894,7 @@ Operation operation = await client.CopyModelToAsync(WaitUn DocumentModelDetails responseData = operation.Value; ]]> - + This sample shows how to call CopyModelTo. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -CopyAuthorization copyToRequest = new CopyAuthorization( +ModelCopyAuthorization copyToRequest = new ModelCopyAuthorization( "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService", "targetResourceRegion", "targetModel", @@ -971,7 +963,7 @@ Console.WriteLine(result.GetProperty("modelId").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); ]]> - + This sample shows how to call BuildClassifierAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -BuildDocumentClassifierContent buildRequest = new BuildDocumentClassifierContent("myClassifier", new Dictionary +BuildClassifierOptions buildRequest = new BuildClassifierOptions("myClassifier", new Dictionary { - ["formA"] = new ClassifierDocumentTypeDetails - { - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "formADocs/", - }, - }, - ["formB"] = new ClassifierDocumentTypeDetails - { - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken"), "formB.jsonl"), - } + ["formA"] = new ClassifierDocumentTypeDetails(), + ["formB"] = new ClassifierDocumentTypeDetails() }) { Description = "Classifier description", @@ -1000,7 +983,7 @@ Operation operation = await client.BuildClassifierAsy DocumentClassifierDetails responseData = operation.Value; ]]> - + This sample shows how to call BuildClassifier. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); -BuildDocumentClassifierContent buildRequest = new BuildDocumentClassifierContent("myClassifier", new Dictionary +BuildClassifierOptions buildRequest = new BuildClassifierOptions("myClassifier", new Dictionary { - ["formA"] = new ClassifierDocumentTypeDetails - { - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "formADocs/", - }, - }, - ["formB"] = new ClassifierDocumentTypeDetails - { - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken"), "formB.jsonl"), - } + ["formA"] = new ClassifierDocumentTypeDetails(), + ["formB"] = new ClassifierDocumentTypeDetails() }) { Description = "Classifier description", diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceClient.xml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceClient.xml index baec167febd7..d9b805ed41ea 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceClient.xml +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceClient.xml @@ -1,107 +1,67 @@ - + -This sample shows how to call GetAnalyzeResultPdfAsync. +This sample shows how to call GetAnalyzeBatchResultsAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Response response = await client.GetAnalyzeResultPdfAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034")); -]]> - - - -This sample shows how to call GetAnalyzeResultPdf. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - -Response response = client.GetAnalyzeResultPdf("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034")); -]]> - - - -This sample shows how to call GetAnalyzeResultPdfAsync and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - -Response response = await client.GetAnalyzeResultPdfAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> - - - -This sample shows how to call GetAnalyzeResultPdf and parse the result. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - -Response response = client.GetAnalyzeResultPdf("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> - - - -This sample shows how to call GetAnalyzeResultFigureAsync. -"); -AzureKeyCredential credential = new AzureKeyCredential(""); -DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - -Response response = await client.GetAnalyzeResultFigureAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0"); +await foreach (AnalyzeBatchOperationDetails item in client.GetAnalyzeBatchResultsAsync("prebuilt-invoice")) +{ +} ]]> - + -This sample shows how to call GetAnalyzeResultFigure. +This sample shows how to call GetAnalyzeBatchResults. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Response response = client.GetAnalyzeResultFigure("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0"); +foreach (AnalyzeBatchOperationDetails item in client.GetAnalyzeBatchResults("prebuilt-invoice")) +{ +} ]]> - + -This sample shows how to call GetAnalyzeResultFigureAsync and parse the result. +This sample shows how to call GetAnalyzeBatchResultsAsync and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Response response = await client.GetAnalyzeResultFigureAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +await foreach (BinaryData item in client.GetAnalyzeBatchResultsAsync("prebuilt-invoice", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +} ]]> - + -This sample shows how to call GetAnalyzeResultFigure and parse the result. +This sample shows how to call GetAnalyzeBatchResults and parse the result. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Response response = client.GetAnalyzeResultFigure("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +foreach (BinaryData item in client.GetAnalyzeBatchResults("prebuilt-invoice", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +} ]]> - + This sample shows how to call AnalyzeDocumentAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout"); +AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", analyzeRequest); AnalyzeResult responseData = operation.Value; ]]> This sample shows how to call AnalyzeDocumentAsync. @@ -118,11 +79,12 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "customModel"); +AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); +Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "customModel", analyzeRequest); AnalyzeResult responseData = operation.Value; ]]> - + This sample shows how to call AnalyzeDocument. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "prebuilt-layout"); +AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); +Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "prebuilt-layout", analyzeRequest); AnalyzeResult responseData = operation.Value; ]]> This sample shows how to call AnalyzeDocument. @@ -139,7 +102,8 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "customModel"); +AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); +Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "customModel", analyzeRequest); AnalyzeResult responseData = operation.Value; ]]> @@ -237,7 +201,7 @@ Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProp Console.WriteLine(result.GetProperty("pages")[0].GetProperty("spans")[0].GetProperty("length").ToString()); ]]> - + This sample shows how to call AnalyzeBatchDocumentsAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Operation operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "customModel"); +AnalyzeBatchDocumentsOptions analyzeBatchRequest = new AnalyzeBatchDocumentsOptions(new Uri("https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken")) +{ + ResultPrefix = "trainingDocsResult/", + OverwriteExisting = true, +}; +Operation operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "customModel", analyzeBatchRequest); AnalyzeBatchResult responseData = operation.Value; ]]> - + This sample shows how to call AnalyzeBatchDocuments. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -Operation operation = client.AnalyzeBatchDocuments(WaitUntil.Completed, "customModel"); +AnalyzeBatchDocumentsOptions analyzeBatchRequest = new AnalyzeBatchDocumentsOptions(new Uri("https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken")) +{ + ResultPrefix = "trainingDocsResult/", + OverwriteExisting = true, +}; +Operation operation = client.AnalyzeBatchDocuments(WaitUntil.Completed, "customModel", analyzeBatchRequest); AnalyzeBatchResult responseData = operation.Value; ]]> @@ -287,8 +261,6 @@ JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; Console.WriteLine(result.GetProperty("succeededCount").ToString()); Console.WriteLine(result.GetProperty("failedCount").ToString()); Console.WriteLine(result.GetProperty("skippedCount").ToString()); -Console.WriteLine(result.GetProperty("details")[0].GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("details")[0].GetProperty("sourceUrl").ToString()); ]]> @@ -317,11 +289,9 @@ JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; Console.WriteLine(result.GetProperty("succeededCount").ToString()); Console.WriteLine(result.GetProperty("failedCount").ToString()); Console.WriteLine(result.GetProperty("skippedCount").ToString()); -Console.WriteLine(result.GetProperty("details")[0].GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("details")[0].GetProperty("sourceUrl").ToString()); ]]> - + This sample shows how to call ClassifyDocumentAsync. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -ClassifyDocumentContent classifyRequest = new ClassifyDocumentContent +ClassifyDocumentOptions classifyRequest = new ClassifyDocumentOptions { - UrlSource = new Uri("http://host.com/doc.pdf"), + UriSource = new Uri("http://host.com/doc.pdf"), }; Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "classifierId", classifyRequest); AnalyzeResult responseData = operation.Value; ]]> - + This sample shows how to call ClassifyDocument. "); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); -ClassifyDocumentContent classifyRequest = new ClassifyDocumentContent +ClassifyDocumentOptions classifyRequest = new ClassifyDocumentOptions { - UrlSource = new Uri("http://host.com/doc.pdf"), + UriSource = new Uri("http://host.com/doc.pdf"), }; Operation operation = client.ClassifyDocument(WaitUntil.Completed, "classifierId", classifyRequest); AnalyzeResult responseData = operation.Value; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs index efaacd772279..4409687bec47 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentAnalysisFeature.cs @@ -27,7 +27,7 @@ public DocumentAnalysisFeature(string value) private const string BarcodesValue = "barcodes"; private const string FormulasValue = "formulas"; private const string KeyValuePairsValue = "keyValuePairs"; - private const string StyleFontValue = "styleFont"; + private const string FontStylingValue = "styleFont"; private const string QueryFieldsValue = "queryFields"; /// Perform OCR at a higher resolution to handle documents with fine print. @@ -41,7 +41,7 @@ public DocumentAnalysisFeature(string value) /// 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); + public static DocumentAnalysisFeature FontStyling { get; } = new DocumentAnalysisFeature(FontStylingValue); /// 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. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs index babb531d69b5..d5e49732c408 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBarcode.cs @@ -50,11 +50,10 @@ public partial class DocumentBarcode /// Barcode value. /// Location of the barcode in the reading order concatenated content. /// Confidence of correctly extracting the barcode. - /// or is null. + /// 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; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs index 09d316a503a9..f6f93ae750db 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentBuildMode.cs @@ -24,14 +24,11 @@ public DocumentBuildMode(string value) private const string TemplateValue = "template"; private const string NeuralValue = "neural"; - private const string GenerativeValue = "generative"; /// 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); - /// Enable documents of all types using generative AI techniques. - public static DocumentBuildMode Generative { get; } = new DocumentBuildMode(GenerativeValue); /// 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. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs index 710e2115c48f..af6fa2ff5994 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.Serialization.cs @@ -64,7 +64,7 @@ internal static DocumentClassifierBuildOperationDetails DeserializeDocumentClass } DocumentClassifierDetails result = default; string operationId = default; - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; int? percentCompleted = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; @@ -93,7 +93,7 @@ internal static DocumentClassifierBuildOperationDetails DeserializeDocumentClass } if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("percentCompleted"u8)) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs index b44a6b36a346..42b4f8bf6304 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierBuildOperationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Get Operation response object. - public partial class DocumentClassifierBuildOperationDetails : OperationDetails + public partial class DocumentClassifierBuildOperationDetails : DocumentIntelligenceOperationDetails { /// Initializes a new instance of . /// Operation ID. @@ -20,7 +20,7 @@ public partial class DocumentClassifierBuildOperationDetails : OperationDetails /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// or is null. - internal DocumentClassifierBuildOperationDetails(string operationId, OperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) + internal DocumentClassifierBuildOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) { Argument.AssertNotNull(operationId, nameof(operationId)); Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); @@ -41,7 +41,7 @@ internal DocumentClassifierBuildOperationDetails(string operationId, OperationSt /// Encountered error. /// Keeps track of any properties unknown to the library. /// Operation result upon success. - internal DocumentClassifierBuildOperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentClassifierDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) + internal DocumentClassifierBuildOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentClassifierDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) { Result = result; } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.Serialization.cs index 0ca1bdf9a393..1ed8871eedfe 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.Serialization.cs @@ -64,7 +64,7 @@ internal static DocumentClassifierCopyToOperationDetails DeserializeDocumentClas } DocumentClassifierDetails result = default; string operationId = default; - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; int? percentCompleted = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; @@ -93,7 +93,7 @@ internal static DocumentClassifierCopyToOperationDetails DeserializeDocumentClas } if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("percentCompleted"u8)) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.cs index 5c81b7789e0b..7880b71df2f2 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierCopyToOperationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Get Operation response object. - public partial class DocumentClassifierCopyToOperationDetails : OperationDetails + public partial class DocumentClassifierCopyToOperationDetails : DocumentIntelligenceOperationDetails { /// Initializes a new instance of . /// Operation ID. @@ -20,7 +20,7 @@ public partial class DocumentClassifierCopyToOperationDetails : OperationDetails /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// or is null. - internal DocumentClassifierCopyToOperationDetails(string operationId, OperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) + internal DocumentClassifierCopyToOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) { Argument.AssertNotNull(operationId, nameof(operationId)); Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); @@ -41,7 +41,7 @@ internal DocumentClassifierCopyToOperationDetails(string operationId, OperationS /// Encountered error. /// Keeps track of any properties unknown to the library. /// Operation result upon success. - internal DocumentClassifierCopyToOperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentClassifierDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) + internal DocumentClassifierCopyToOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentClassifierDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) { Result = result; } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs index 17e731b50bee..439ec49d5b70 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.Serialization.cs @@ -48,6 +48,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("expirationDateTime"u8); writer.WriteStringValue(ExpiresOn.Value, "O"); } + if (options.Format != "W" && Optional.IsDefined(ModifiedOn)) + { + writer.WritePropertyName("modifiedDateTime"u8); + writer.WriteStringValue(ModifiedOn.Value, "O"); + } writer.WritePropertyName("apiVersion"u8); writer.WriteStringValue(ApiVersion); if (Optional.IsDefined(BaseClassifierId)) @@ -57,7 +62,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("docTypes"u8); writer.WriteStartObject(); - foreach (var item in DocTypes) + foreach (var item in DocumentTypes) { writer.WritePropertyName(item.Key); writer.WriteObjectValue(item.Value, options); @@ -114,6 +119,7 @@ internal static DocumentClassifierDetails DeserializeDocumentClassifierDetails(J string description = default; DateTimeOffset createdDateTime = default; DateTimeOffset? expirationDateTime = default; + DateTimeOffset? modifiedDateTime = default; string apiVersion = default; string baseClassifierId = default; IReadOnlyDictionary docTypes = default; @@ -146,6 +152,15 @@ internal static DocumentClassifierDetails DeserializeDocumentClassifierDetails(J expirationDateTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("modifiedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } if (property.NameEquals("apiVersion"u8)) { apiVersion = property.Value.GetString(); @@ -191,6 +206,7 @@ internal static DocumentClassifierDetails DeserializeDocumentClassifierDetails(J description, createdDateTime, expirationDateTime, + modifiedDateTime, apiVersion, baseClassifierId, docTypes, diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs index cf565d4e029d..664cbd7b52d6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentClassifierDetails.cs @@ -49,18 +49,18 @@ public partial class 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 createdOn, string apiVersion, IReadOnlyDictionary docTypes) + /// List of document types to classify against. + /// , or is null. + internal DocumentClassifierDetails(string classifierId, DateTimeOffset createdOn, string apiVersion, IReadOnlyDictionary documentTypes) { Argument.AssertNotNull(classifierId, nameof(classifierId)); Argument.AssertNotNull(apiVersion, nameof(apiVersion)); - Argument.AssertNotNull(docTypes, nameof(docTypes)); + Argument.AssertNotNull(documentTypes, nameof(documentTypes)); ClassifierId = classifierId; CreatedOn = createdOn; ApiVersion = apiVersion; - DocTypes = docTypes; + DocumentTypes = documentTypes; Warnings = new ChangeTrackingList(); } @@ -69,20 +69,22 @@ internal DocumentClassifierDetails(string classifierId, DateTimeOffset createdOn /// Document classifier description. /// Date and time (UTC) when the document classifier was created. /// Date and time (UTC) when the document classifier will expire. + /// Date and time (UTC) when the document model was last modified. /// API version used to create this document classifier. /// Base classifierId on top of which the classifier was trained. - /// List of document types to classify against. + /// List of document types to classify against. /// List of warnings encountered while building the classifier. /// Keeps track of any properties unknown to the library. - internal DocumentClassifierDetails(string classifierId, string description, DateTimeOffset createdOn, DateTimeOffset? expiresOn, string apiVersion, string baseClassifierId, IReadOnlyDictionary docTypes, IReadOnlyList warnings, IDictionary serializedAdditionalRawData) + internal DocumentClassifierDetails(string classifierId, string description, DateTimeOffset createdOn, DateTimeOffset? expiresOn, DateTimeOffset? modifiedOn, string apiVersion, string baseClassifierId, IReadOnlyDictionary documentTypes, IReadOnlyList warnings, IDictionary serializedAdditionalRawData) { ClassifierId = classifierId; Description = description; CreatedOn = createdOn; ExpiresOn = expiresOn; + ModifiedOn = modifiedOn; ApiVersion = apiVersion; BaseClassifierId = baseClassifierId; - DocTypes = docTypes; + DocumentTypes = documentTypes; Warnings = warnings; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -100,12 +102,14 @@ internal DocumentClassifierDetails() public DateTimeOffset CreatedOn { get; } /// Date and time (UTC) when the document classifier will expire. public DateTimeOffset? ExpiresOn { get; } + /// Date and time (UTC) when the document model was last modified. + public DateTimeOffset? ModifiedOn { get; } /// API version used to create this document classifier. public string ApiVersion { get; } /// Base classifierId on top of which the classifier was trained. public string BaseClassifierId { get; } /// List of document types to classify against. - public IReadOnlyDictionary DocTypes { get; } + public IReadOnlyDictionary DocumentTypes { get; } /// List of warnings encountered while building the classifier. public IReadOnlyList Warnings { get; } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentFormat.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentContentFormat.cs similarity index 51% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentFormat.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentContentFormat.cs index 084e50cfb208..15ef6a16ff4a 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ContentFormat.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentContentFormat.cs @@ -11,13 +11,13 @@ namespace Azure.AI.DocumentIntelligence { /// Format of the content in analyzed result. - public readonly partial struct ContentFormat : IEquatable + public readonly partial struct DocumentContentFormat : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public ContentFormat(string value) + public DocumentContentFormat(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -26,24 +26,24 @@ public ContentFormat(string value) private const string MarkdownValue = "markdown"; /// Plain text representation of the document content without any formatting. - public static ContentFormat Text { get; } = new ContentFormat(TextValue); + public static DocumentContentFormat Text { get; } = new DocumentContentFormat(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 to a . - public static implicit operator ContentFormat(string value) => new ContentFormat(value); + public static DocumentContentFormat Markdown { get; } = new DocumentContentFormat(MarkdownValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentContentFormat left, DocumentContentFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentContentFormat left, DocumentContentFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DocumentContentFormat(string value) => new DocumentContentFormat(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ContentFormat other && Equals(other); + public override bool Equals(object obj) => obj is DocumentContentFormat other && Equals(other); /// - public bool Equals(ContentFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(DocumentContentFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs index 309945d71afe..05726c0858be 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type.ToString()); + writer.WriteStringValue(FieldType.ToString()); if (Optional.IsDefined(ValueString)) { writer.WritePropertyName("valueString"u8); @@ -61,10 +61,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("valueNumber"u8); writer.WriteNumberValue(ValueDouble.Value); } - if (Optional.IsDefined(ValueLong)) + if (Optional.IsDefined(ValueInt64)) { writer.WritePropertyName("valueInteger"u8); - writer.WriteNumberValue(ValueLong.Value); + writer.WriteNumberValue(ValueInt64.Value); } if (Optional.IsDefined(ValueSelectionMark)) { @@ -91,14 +91,14 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(ValueDictionary)) + if (Optional.IsCollectionDefined(ValueObject)) { writer.WritePropertyName("valueObject"u8); writer.WriteStartObject(); - foreach (var item in ValueDictionary) + foreach (var item in ValueObject) { writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value, options); + writer.WriteObjectValue(item.Value, options); } writer.WriteEndObject(); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs index 5117cd80a08c..2b7ea72e7881 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentField.cs @@ -46,30 +46,30 @@ public partial class DocumentField private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Data type of the field value. - internal DocumentField(DocumentFieldType type) + /// Data type of the field value. + internal DocumentField(DocumentFieldType fieldType) { - Type = type; + FieldType = fieldType; ValueList = new ChangeTrackingList(); - ValueDictionary = new ChangeTrackingDictionary(); + ValueObject = new ChangeTrackingDictionary(); ValueSelectionGroup = new ChangeTrackingList(); BoundingRegions = new ChangeTrackingList(); Spans = new ChangeTrackingList(); } /// Initializes a new instance of . - /// Data type of the field value. + /// 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. + /// 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. + /// Dictionary of named field values. /// Currency value. /// Address value. /// Boolean value. @@ -79,20 +79,20 @@ internal DocumentField(DocumentFieldType type) /// Location of the field in the reading order concatenated content. /// Confidence of correctly extracting the field. /// Keeps track of any properties unknown to the library. - internal DocumentField(DocumentFieldType type, string valueString, DateTimeOffset? valueDate, TimeSpan? valueTime, string valuePhoneNumber, double? valueDouble, long? valueLong, DocumentSelectionMarkState? valueSelectionMark, DocumentSignatureType? valueSignature, string valueCountryRegion, IReadOnlyList valueList, IReadOnlyDictionary valueDictionary, CurrencyValue valueCurrency, AddressValue valueAddress, bool? valueBoolean, IReadOnlyList valueSelectionGroup, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, float? confidence, IDictionary serializedAdditionalRawData) + internal DocumentField(DocumentFieldType fieldType, string valueString, DateTimeOffset? valueDate, TimeSpan? valueTime, string valuePhoneNumber, double? valueDouble, long? valueInt64, DocumentSelectionMarkState? valueSelectionMark, DocumentSignatureType? valueSignature, string valueCountryRegion, IReadOnlyList valueList, IReadOnlyDictionary valueObject, CurrencyValue valueCurrency, AddressValue valueAddress, bool? valueBoolean, IReadOnlyList valueSelectionGroup, string content, IReadOnlyList boundingRegions, IReadOnlyList spans, float? confidence, IDictionary serializedAdditionalRawData) { - Type = type; + FieldType = fieldType; ValueString = valueString; ValueDate = valueDate; ValueTime = valueTime; ValuePhoneNumber = valuePhoneNumber; ValueDouble = valueDouble; - ValueLong = valueLong; + ValueInt64 = valueInt64; ValueSelectionMark = valueSelectionMark; ValueSignature = valueSignature; ValueCountryRegion = valueCountryRegion; ValueList = valueList; - ValueDictionary = valueDictionary; + ValueObject = valueObject; ValueCurrency = valueCurrency; ValueAddress = valueAddress; ValueBoolean = valueBoolean; @@ -110,7 +110,7 @@ internal DocumentField() } /// Data type of the field value. - public DocumentFieldType Type { get; } + public DocumentFieldType FieldType { get; } /// String value. public string ValueString { get; } /// Date value in YYYY-MM-DD format (ISO 8601). @@ -122,7 +122,7 @@ internal DocumentField() /// Floating point value. public double? ValueDouble { get; } /// Integer value. - public long? ValueLong { get; } + public long? ValueInt64 { get; } /// Selection mark value. public DocumentSelectionMarkState? ValueSelectionMark { get; } /// Presence of signature. @@ -131,8 +131,6 @@ internal DocumentField() public string ValueCountryRegion { get; } /// Array of field values. public IReadOnlyList ValueList { get; } - /// Dictionary of named field values. - public IReadOnlyDictionary ValueDictionary { get; } /// Currency value. public CurrencyValue ValueCurrency { get; } /// Address value. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs index fc64e88f3fec..5f2abd55d38e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type.ToString()); + writer.WriteStringValue(FieldType.ToString()); if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs index c10356c01be7..7f65d3fb2f58 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldSchema.cs @@ -46,23 +46,23 @@ public partial class DocumentFieldSchema private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Semantic data type of the field value. - public DocumentFieldSchema(DocumentFieldType type) + /// Semantic data type of the field value. + public DocumentFieldSchema(DocumentFieldType fieldType) { - Type = type; + FieldType = fieldType; Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . - /// Semantic data type of the field value. + /// 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. /// Keeps track of any properties unknown to the library. - internal DocumentFieldSchema(DocumentFieldType type, string description, string example, DocumentFieldSchema items, IDictionary properties, IDictionary serializedAdditionalRawData) + internal DocumentFieldSchema(DocumentFieldType fieldType, string description, string example, DocumentFieldSchema items, IDictionary properties, IDictionary serializedAdditionalRawData) { - Type = type; + FieldType = fieldType; Description = description; Example = example; Items = items; @@ -76,7 +76,7 @@ internal DocumentFieldSchema() } /// Semantic data type of the field value. - public DocumentFieldType Type { get; set; } + public DocumentFieldType FieldType { get; set; } /// Field description. public string Description { get; set; } /// Example field content. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs index bfe9d9f1b701..340968d8aec2 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFieldType.cs @@ -27,7 +27,7 @@ public DocumentFieldType(string value) private const string TimeValue = "time"; private const string PhoneNumberValue = "phoneNumber"; private const string DoubleValue = "number"; - private const string LongValue = "integer"; + private const string Int64Value = "integer"; private const string SelectionMarkValue = "selectionMark"; private const string CountryRegionValue = "countryRegion"; private const string SignatureValue = "signature"; @@ -49,7 +49,7 @@ public DocumentFieldType(string value) /// Floating point number, normalized to double precision floating point. public static DocumentFieldType Double { get; } = new DocumentFieldType(DoubleValue); /// Integer number, normalized to 64-bit signed integer. - public static DocumentFieldType Long { get; } = new DocumentFieldType(LongValue); + public static DocumentFieldType Int64 { get; } = new DocumentFieldType(Int64Value); /// Is field selected?. public static DocumentFieldType SelectionMark { get; } = new DocumentFieldType(SelectionMarkValue); /// Country/region, normalized to ISO 3166-1 alpha-3 format (ex. USA). diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs index 77e826d96db6..79693ec1cd6b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentFormula.cs @@ -50,11 +50,10 @@ public partial class DocumentFormula /// LaTex expression describing the formula. /// Location of the formula in the reading order concatenated content. /// Confidence of correctly extracting the formula. - /// or is null. + /// 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; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceAdministrationClient.cs index 97775c3498dd..969d9d604c12 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceAdministrationClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceAdministrationClient.cs @@ -90,42 +90,6 @@ public DocumentIntelligenceAdministrationClient(Uri endpoint, TokenCredential cr _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(AuthorizeCopyContent authorizeCopyRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(authorizeCopyRequest, nameof(authorizeCopyRequest)); - - using RequestContent content = authorizeCopyRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - 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(AuthorizeCopyContent authorizeCopyRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(authorizeCopyRequest, nameof(authorizeCopyRequest)); - - using RequestContent content = authorizeCopyRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - 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. @@ -137,7 +101,7 @@ public virtual Response AuthorizeModelCopy(AuthorizeCopyConte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -177,7 +141,7 @@ public virtual async Task AuthorizeModelCopyAsync(RequestContent conte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -390,22 +354,22 @@ public virtual Response DeleteModel(string modelId, RequestContext context = nul /// Return information about the current resource. /// The cancellation token to use. - /// - public virtual async Task> GetResourceInfoAsync(CancellationToken cancellationToken = default) + /// + public virtual async Task> GetResourceDetailsAsync(CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetResourceInfoAsync(context).ConfigureAwait(false); - return Response.FromValue(ResourceDetails.FromResponse(response), response); + Response response = await GetResourceDetailsAsync(context).ConfigureAwait(false); + return Response.FromValue(DocumentIntelligenceResourceDetails.FromResponse(response), response); } /// Return information about the current resource. /// The cancellation token to use. - /// - public virtual Response GetResourceInfo(CancellationToken cancellationToken = default) + /// + public virtual Response GetResourceDetails(CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetResourceInfo(context); - return Response.FromValue(ResourceDetails.FromResponse(response), response); + Response response = GetResourceDetails(context); + return Response.FromValue(DocumentIntelligenceResourceDetails.FromResponse(response), response); } /// @@ -418,7 +382,7 @@ public virtual Response GetResourceInfo(CancellationToken cance /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -426,14 +390,14 @@ public virtual Response GetResourceInfo(CancellationToken cance /// 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) + /// + public virtual async Task GetResourceDetailsAsync(RequestContext context) { - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceAdministrationClient.GetResourceInfo"); + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceAdministrationClient.GetResourceDetails"); scope.Start(); try { - using HttpMessage message = CreateGetResourceInfoRequest(context); + using HttpMessage message = CreateGetResourceDetailsRequest(context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -453,7 +417,7 @@ public virtual async Task GetResourceInfoAsync(RequestContext context) /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -461,14 +425,14 @@ public virtual async Task GetResourceInfoAsync(RequestContext context) /// 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) + /// + public virtual Response GetResourceDetails(RequestContext context) { - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceAdministrationClient.GetResourceInfo"); + using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceAdministrationClient.GetResourceDetails"); scope.Start(); try { - using HttpMessage message = CreateGetResourceInfoRequest(context); + using HttpMessage message = CreateGetResourceDetailsRequest(context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -484,13 +448,13 @@ public virtual Response GetResourceInfo(RequestContext context) /// is null. /// is an empty string, and was expected to be non-empty. /// - public virtual async Task> GetOperationAsync(string operationId, CancellationToken cancellationToken = default) + public virtual async Task> GetOperationAsync(string operationId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = await GetOperationAsync(operationId, context).ConfigureAwait(false); - return Response.FromValue(OperationDetails.FromResponse(response), response); + return Response.FromValue(DocumentIntelligenceOperationDetails.FromResponse(response), response); } /// Gets operation info. @@ -499,13 +463,13 @@ public virtual async Task> GetOperationAsync(string o /// is null. /// is an empty string, and was expected to be non-empty. /// - public virtual Response GetOperation(string operationId, CancellationToken cancellationToken = default) + public virtual Response GetOperation(string operationId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = GetOperation(operationId, context); - return Response.FromValue(OperationDetails.FromResponse(response), response); + return Response.FromValue(DocumentIntelligenceOperationDetails.FromResponse(response), response); } /// @@ -588,42 +552,6 @@ public virtual Response GetOperation(string operationId, RequestContext context) } } - /// - /// Generates authorization to copy a document classifier to this location with - /// specified classifierId and optional description. - /// - /// Authorize copy request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual async Task> AuthorizeClassifierCopyAsync(AuthorizeClassifierCopyContent authorizeCopyRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(authorizeCopyRequest, nameof(authorizeCopyRequest)); - - using RequestContent content = authorizeCopyRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await AuthorizeClassifierCopyAsync(content, context).ConfigureAwait(false); - return Response.FromValue(ClassifierCopyAuthorization.FromResponse(response), response); - } - - /// - /// Generates authorization to copy a document classifier to this location with - /// specified classifierId and optional description. - /// - /// Authorize copy request parameters. - /// The cancellation token to use. - /// is null. - /// - public virtual Response AuthorizeClassifierCopy(AuthorizeClassifierCopyContent authorizeCopyRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(authorizeCopyRequest, nameof(authorizeCopyRequest)); - - using RequestContent content = authorizeCopyRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = AuthorizeClassifierCopy(content, context); - return Response.FromValue(ClassifierCopyAuthorization.FromResponse(response), response); - } - /// /// [Protocol Method] Generates authorization to copy a document classifier to this location with /// specified classifierId and optional description. @@ -635,7 +563,7 @@ public virtual Response AuthorizeClassifierCopy(Aut /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -675,7 +603,7 @@ public virtual async Task AuthorizeClassifierCopyAsync(RequestContent /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -963,23 +891,23 @@ public virtual Pageable GetModels(RequestContext context) /// Lists all operations. /// The cancellation token to use. /// - public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + 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, e => OperationDetails.DeserializeOperationDetails(e), ClientDiagnostics, _pipeline, "DocumentIntelligenceAdministrationClient.GetOperations", "value", "nextLink", context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DocumentIntelligenceOperationDetails.DeserializeDocumentIntelligenceOperationDetails(e), ClientDiagnostics, _pipeline, "DocumentIntelligenceAdministrationClient.GetOperations", "value", "nextLink", context); } /// Lists all operations. /// The cancellation token to use. /// - public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + 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, e => OperationDetails.DeserializeOperationDetails(e), ClientDiagnostics, _pipeline, "DocumentIntelligenceAdministrationClient.GetOperations", "value", "nextLink", context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DocumentIntelligenceOperationDetails.DeserializeDocumentIntelligenceOperationDetails(e), ClientDiagnostics, _pipeline, "DocumentIntelligenceAdministrationClient.GetOperations", "value", "nextLink", context); } /// @@ -1108,178 +1036,6 @@ public virtual Pageable GetClassifiers(RequestContext context) return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentIntelligenceAdministrationClient.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, BuildDocumentModelContent buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - using RequestContent content = buildRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await BuildDocumentModelAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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, BuildDocumentModelContent buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - using RequestContent content = buildRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = BuildDocumentModel(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.BuildDocumentModel"); - } - - /// 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, ComposeDocumentModelContent composeRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(composeRequest, nameof(composeRequest)); - - using RequestContent content = composeRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await ComposeModelAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelComposeOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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, ComposeDocumentModelContent composeRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(composeRequest, nameof(composeRequest)); - - using RequestContent content = composeRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = ComposeModel(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelComposeOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.ComposeModel"); - } - - /// 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)); - - using RequestContent content = copyToRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await CopyModelToAsync(waitUntil, modelId, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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)); - - using RequestContent content = copyToRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = CopyModelTo(waitUntil, modelId, content, context); - return ProtocolOperationHelpers.Convert(response, FetchDocumentModelDetailsFromDocumentModelCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.CopyModelTo"); - } - - /// 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, BuildDocumentClassifierContent buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - using RequestContent content = buildRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await BuildClassifierAsync(waitUntil, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.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, BuildDocumentClassifierContent buildRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(buildRequest, nameof(buildRequest)); - - using RequestContent content = buildRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = BuildClassifier(waitUntil, content, context); - return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierBuildOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.BuildClassifier"); - } - - /// Copies document classifier to the target resource, region, and classifierId. - /// 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. - /// 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> CopyClassifierToAsync(WaitUntil waitUntil, string classifierId, ClassifierCopyAuthorization copyToRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(copyToRequest, nameof(copyToRequest)); - - using RequestContent content = copyToRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await CopyClassifierToAsync(waitUntil, classifierId, content, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.CopyClassifierTo"); - } - - /// Copies document classifier to the target resource, region, and classifierId. - /// 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. - /// 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 CopyClassifierTo(WaitUntil waitUntil, string classifierId, ClassifierCopyAuthorization copyToRequest, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(copyToRequest, nameof(copyToRequest)); - - using RequestContent content = copyToRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = CopyClassifierTo(waitUntil, classifierId, content, context); - return ProtocolOperationHelpers.Convert(response, FetchDocumentClassifierDetailsFromDocumentClassifierCopyToOperationDetails, ClientDiagnostics, "DocumentIntelligenceAdministrationClient.CopyClassifierTo"); - } - internal HttpMessage CreateBuildDocumentModelRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); @@ -1397,7 +1153,7 @@ internal HttpMessage CreateDeleteModelRequest(string modelId, RequestContext con return message; } - internal HttpMessage CreateGetResourceInfoRequest(RequestContext context) + internal HttpMessage CreateGetResourceDetailsRequest(RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClient.cs index 0f561e75b9d5..77358f55661f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClient.cs @@ -10,6 +10,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; @@ -90,40 +91,40 @@ public DocumentIntelligenceClient(Uri endpoint, TokenCredential credential, Docu _apiVersion = options.Version; } - /// Gets the generated searchable PDF output from document analysis. + /// List batch document analysis results. /// Unique document model name. - /// Analyze operation result ID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetAnalyzeResultPdfAsync(string modelId, Guid resultId, CancellationToken cancellationToken = default) + /// + public virtual AsyncPageable GetAnalyzeBatchResultsAsync(string modelId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetAnalyzeResultPdfAsync(modelId, resultId, context).ConfigureAwait(false); - return Response.FromValue(response.Content, response); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAnalyzeBatchResultsRequest(modelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAnalyzeBatchResultsNextPageRequest(nextLink, modelId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AnalyzeBatchOperationDetails.DeserializeAnalyzeBatchOperationDetails(e), ClientDiagnostics, _pipeline, "DocumentIntelligenceClient.GetAnalyzeBatchResults", "value", "nextLink", context); } - /// Gets the generated searchable PDF output from document analysis. + /// List batch document analysis results. /// Unique document model name. - /// Analyze operation result ID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetAnalyzeResultPdf(string modelId, Guid resultId, CancellationToken cancellationToken = default) + /// + public virtual Pageable GetAnalyzeBatchResults(string modelId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetAnalyzeResultPdf(modelId, resultId, context); - return Response.FromValue(response.Content, response); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAnalyzeBatchResultsRequest(modelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAnalyzeBatchResultsNextPageRequest(nextLink, modelId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AnalyzeBatchOperationDetails.DeserializeAnalyzeBatchOperationDetails(e), ClientDiagnostics, _pipeline, "DocumentIntelligenceClient.GetAnalyzeBatchResults", "value", "nextLink", context); } /// - /// [Protocol Method] Gets the generated searchable PDF output from document analysis. + /// [Protocol Method] List batch document analysis results. /// /// /// @@ -132,366 +133,29 @@ public virtual Response GetAnalyzeResultPdf(string modelId, Guid res /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// /// Unique document model name. - /// Analyze operation result ID. /// 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 GetAnalyzeResultPdfAsync(string modelId, Guid resultId, RequestContext context) + /// 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 GetAnalyzeBatchResultsAsync(string modelId, RequestContext context) { Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultPdf"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAnalyzeResultPdfRequest(modelId, resultId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the generated searchable PDF output from document analysis. - /// - /// - /// - /// 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. - /// Analyze operation result ID. - /// 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 GetAnalyzeResultPdf(string modelId, Guid resultId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultPdf"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAnalyzeResultPdfRequest(modelId, resultId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Gets the generated cropped image of specified figure from document analysis. - /// Unique document model name. - /// Analyze operation result ID. - /// Figure ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetAnalyzeResultFigureAsync(string modelId, Guid resultId, string figureId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetAnalyzeResultFigureAsync(modelId, resultId, figureId, context).ConfigureAwait(false); - return Response.FromValue(response.Content, response); - } - - /// Gets the generated cropped image of specified figure from document analysis. - /// Unique document model name. - /// Analyze operation result ID. - /// Figure ID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - /// - public virtual Response GetAnalyzeResultFigure(string modelId, Guid resultId, string figureId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetAnalyzeResultFigure(modelId, resultId, figureId, context); - return Response.FromValue(response.Content, response); - } - - /// - /// [Protocol Method] Gets the generated cropped image of specified figure from document analysis. - /// - /// - /// - /// 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. - /// Analyze operation result ID. - /// Figure ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or 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 GetAnalyzeResultFigureAsync(string modelId, Guid resultId, string figureId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultFigure"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAnalyzeResultFigureRequest(modelId, resultId, figureId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// [Protocol Method] Gets the generated cropped image of specified figure from document analysis. - /// - /// - /// - /// 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. - /// Analyze operation result ID. - /// Figure ID. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// or 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 GetAnalyzeResultFigure(string modelId, Guid resultId, string figureId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - Argument.AssertNotNullOrEmpty(figureId, nameof(figureId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.GetAnalyzeResultFigure"); - scope.Start(); - try - { - using HttpMessage message = CreateGetAnalyzeResultFigureRequest(modelId, resultId, figureId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// 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. - /// Additional outputs to generate during analysis. - /// 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, AnalyzeDocumentContent analyzeRequest = null, string pages = null, string locale = null, StringIndexType? stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, ContentFormat? outputContentFormat = null, IEnumerable output = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using RequestContent content = analyzeRequest?.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await AnalyzeDocumentAsync(waitUntil, modelId, content, pages, locale, stringIndexType?.ToString(), features, queryFields, outputContentFormat?.ToString(), output, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeResultOperation, ClientDiagnostics, "DocumentIntelligenceClient.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. - /// Additional outputs to generate during analysis. - /// 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, AnalyzeDocumentContent analyzeRequest = null, string pages = null, string locale = null, StringIndexType? stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, ContentFormat? outputContentFormat = null, IEnumerable output = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using RequestContent content = analyzeRequest?.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = AnalyzeDocument(waitUntil, modelId, content, pages, locale, stringIndexType?.ToString(), features, queryFields, outputContentFormat?.ToString(), output, context); - return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeResultOperation, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeDocument"); - } - - /// Analyzes batch documents 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 batch 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. - /// Additional outputs to generate during analysis. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> AnalyzeBatchDocumentsAsync(WaitUntil waitUntil, string modelId, AnalyzeBatchDocumentsContent analyzeBatchRequest = null, string pages = null, string locale = null, StringIndexType? stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, ContentFormat? outputContentFormat = null, IEnumerable output = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using RequestContent content = analyzeBatchRequest?.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await AnalyzeBatchDocumentsAsync(waitUntil, modelId, content, pages, locale, stringIndexType?.ToString(), features, queryFields, outputContentFormat?.ToString(), output, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchAnalyzeBatchResultFromAnalyzeBatchResultOperation, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments"); - } - - /// Analyzes batch documents 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 batch 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. - /// Additional outputs to generate during analysis. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Operation AnalyzeBatchDocuments(WaitUntil waitUntil, string modelId, AnalyzeBatchDocumentsContent analyzeBatchRequest = null, string pages = null, string locale = null, StringIndexType? stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, ContentFormat? outputContentFormat = null, IEnumerable output = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using RequestContent content = analyzeBatchRequest?.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = AnalyzeBatchDocuments(waitUntil, modelId, content, pages, locale, stringIndexType?.ToString(), features, queryFields, outputContentFormat?.ToString(), output, context); - return ProtocolOperationHelpers.Convert(response, FetchAnalyzeBatchResultFromAnalyzeBatchResultOperation, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments"); - } - - /// - /// [Protocol Method] Analyzes batch documents 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". - /// Additional outputs to generate during analysis. - /// 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> AnalyzeBatchDocumentsAsync(WaitUntil waitUntil, string modelId, RequestContent content, string pages = null, string locale = null, string stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, string outputContentFormat = null, IEnumerable output = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.AnalyzeBatchDocuments"); - scope.Start(); - try - { - using HttpMessage message = CreateAnalyzeBatchDocumentsRequest(modelId, content, pages, locale, stringIndexType, features, queryFields, outputContentFormat, output, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAnalyzeBatchResultsRequest(modelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAnalyzeBatchResultsNextPageRequest(nextLink, modelId, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentIntelligenceClient.GetAnalyzeBatchResults", "value", "nextLink", context); } /// - /// [Protocol Method] Analyzes batch documents with document model. + /// [Protocol Method] List batch document analysis results. /// /// /// @@ -500,182 +164,25 @@ public virtual async Task> AnalyzeBatchDocumentsAsync(Wait /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// 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". - /// Additional outputs to generate during analysis. /// 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 AnalyzeBatchDocuments(WaitUntil waitUntil, string modelId, RequestContent content, string pages = null, string locale = null, string stringIndexType = null, IEnumerable features = null, IEnumerable queryFields = null, string outputContentFormat = null, IEnumerable output = null, RequestContext context = null) + /// 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 GetAnalyzeBatchResults(string modelId, RequestContext context) { Argument.AssertNotNullOrEmpty(modelId, nameof(modelId)); - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.AnalyzeBatchDocuments"); - scope.Start(); - try - { - using HttpMessage message = CreateAnalyzeBatchDocumentsRequest(modelId, content, pages, locale, stringIndexType, features, queryFields, outputContentFormat, output, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.AnalyzeBatchDocuments", 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. - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// 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, ClassifyDocumentContent classifyRequest, StringIndexType? stringIndexType = null, SplitMode? split = null, string pages = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(classifyRequest, nameof(classifyRequest)); - - using RequestContent content = classifyRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await ClassifyDocumentAsync(waitUntil, classifierId, content, stringIndexType?.ToString(), split?.ToString(), pages, context).ConfigureAwait(false); - return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeResultOperation, ClientDiagnostics, "DocumentIntelligenceClient.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. - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// 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, ClassifyDocumentContent classifyRequest, StringIndexType? stringIndexType = null, SplitMode? split = null, string pages = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(classifyRequest, nameof(classifyRequest)); - - using RequestContent content = classifyRequest.ToRequestContent(); - RequestContext context = FromCancellationToken(cancellationToken); - Operation response = ClassifyDocument(waitUntil, classifierId, content, stringIndexType?.ToString(), split?.ToString(), pages, context); - return ProtocolOperationHelpers.Convert(response, FetchAnalyzeResultFromAnalyzeResultOperation, ClientDiagnostics, "DocumentIntelligenceClient.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". - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// 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, string pages = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.ClassifyDocument"); - scope.Start(); - try - { - using HttpMessage message = CreateClassifyDocumentRequest(classifierId, content, stringIndexType, split, pages, context); - return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.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". - /// List of 1-based page numbers to analyze. Ex. "1-3,5,7-9". - /// 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, string pages = null, RequestContext context = null) - { - Argument.AssertNotNullOrEmpty(classifierId, nameof(classifierId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = ClientDiagnostics.CreateScope("DocumentIntelligenceClient.ClassifyDocument"); - scope.Start(); - try - { - using HttpMessage message = CreateClassifyDocumentRequest(classifierId, content, stringIndexType, split, pages, context); - return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "DocumentIntelligenceClient.ClassifyDocument", OperationFinalStateVia.OperationLocation, context, waitUntil); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAnalyzeBatchResultsRequest(modelId, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAnalyzeBatchResultsNextPageRequest(nextLink, modelId, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "DocumentIntelligenceClient.GetAnalyzeBatchResults", "value", "nextLink", context); } internal HttpMessage CreateAnalyzeDocumentRequest(string modelId, RequestContent content, string pages, string locale, string stringIndexType, IEnumerable features, IEnumerable queryFields, string outputContentFormat, IEnumerable output, RequestContext context) @@ -725,6 +232,63 @@ internal HttpMessage CreateAnalyzeDocumentRequest(string modelId, RequestContent return message; } + internal HttpMessage CreateGetAnalyzeResultPdfRequest(string modelId, Guid resultId, 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.AppendPath("/analyzeResults/", false); + uri.AppendPath(resultId, true); + uri.AppendPath("/pdf", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/pdf"); + return message; + } + + internal HttpMessage CreateGetAnalyzeResultFigureRequest(string modelId, Guid resultId, string figureId, 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.AppendPath("/analyzeResults/", false); + uri.AppendPath(resultId, true); + uri.AppendPath("/figures/", false); + uri.AppendPath(figureId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "image/png"); + return message; + } + + internal HttpMessage CreateDeleteAnalyzeResultRequest(string modelId, Guid resultId, 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.AppendPath("/analyzeResults/", false); + uri.AppendPath(resultId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + internal HttpMessage CreateAnalyzeBatchDocumentsRequest(string modelId, RequestContent content, string pages, string locale, string stringIndexType, IEnumerable features, IEnumerable queryFields, string outputContentFormat, IEnumerable output, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier202); @@ -772,7 +336,7 @@ internal HttpMessage CreateAnalyzeBatchDocumentsRequest(string modelId, RequestC return message; } - internal HttpMessage CreateGetAnalyzeResultPdfRequest(string modelId, Guid resultId, RequestContext context) + internal HttpMessage CreateGetAnalyzeBatchResultsRequest(string modelId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -782,16 +346,32 @@ internal HttpMessage CreateGetAnalyzeResultPdfRequest(string modelId, Guid resul uri.AppendRaw("/documentintelligence", false); uri.AppendPath("/documentModels/", false); uri.AppendPath(modelId, true); - uri.AppendPath("/analyzeResults/", false); + uri.AppendPath("/analyzeBatchResults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteAnalyzeBatchResultRequest(string modelId, Guid resultId, 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.AppendPath("/analyzeBatchResults/", false); uri.AppendPath(resultId, true); - uri.AppendPath("/pdf", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/pdf"); + request.Headers.Add("Accept", "application/json"); return message; } - internal HttpMessage CreateGetAnalyzeResultFigureRequest(string modelId, Guid resultId, string figureId, RequestContext context) + internal HttpMessage CreateGetAnalyzeBatchResultRequest(string modelId, Guid resultId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -801,13 +381,11 @@ internal HttpMessage CreateGetAnalyzeResultFigureRequest(string modelId, Guid re uri.AppendRaw("/documentintelligence", false); uri.AppendPath("/documentModels/", false); uri.AppendPath(modelId, true); - uri.AppendPath("/analyzeResults/", false); + uri.AppendPath("/analyzeBatchResults/", false); uri.AppendPath(resultId, true); - uri.AppendPath("/figures/", false); - uri.AppendPath(figureId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "image/png"); + request.Headers.Add("Accept", "application/json"); return message; } @@ -842,6 +420,20 @@ internal HttpMessage CreateClassifyDocumentRequest(string classifierId, RequestC return message; } + internal HttpMessage CreateGetAnalyzeBatchResultsNextPageRequest(string nextLink, 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.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) { @@ -857,8 +449,10 @@ internal static RequestContext FromCancellationToken(CancellationToken cancellat 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 }); - private AnalyzeBatchResult FetchAnalyzeBatchResultFromAnalyzeBatchResultOperation(Response response) + private AnalyzeBatchResult FetchAnalyzeBatchResultFromAnalyzeBatchOperationDetails(Response response) { var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); return AnalyzeBatchResult.DeserializeAnalyzeBatchResult(resultJsonElement); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClientOptions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClientOptions.cs index 064e79db6c62..98d466ccc87c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClientOptions.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceClientOptions.cs @@ -13,25 +13,15 @@ namespace Azure.AI.DocumentIntelligence /// Client options for Azure.AI.DocumentIntelligence library clients. public partial class DocumentIntelligenceClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_31_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_30; /// The version of the service to use. public enum ServiceVersion { - /// Service version "2024-07-31-preview". - V2024_07_31_Preview = 1, + /// Service version "2024-11-30". + V2024_11_30 = 1, } internal string Version { get; } - - /// Initializes new instance of DocumentIntelligenceClientOptions. - public DocumentIntelligenceClientOptions(ServiceVersion version = LatestVersion) - { - Version = version switch - { - ServiceVersion.V2024_07_31_Preview => "2024-07-31-preview", - _ => throw new NotSupportedException() - }; - } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs index e5b66cc4ff10..a663ab7ff8c4 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.Serialization.cs @@ -53,10 +53,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (Optional.IsDefined(Innererror)) + if (Optional.IsDefined(InnerError)) { writer.WritePropertyName("innererror"u8); - writer.WriteObjectValue(Innererror, options); + writer.WriteObjectValue(InnerError, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -99,7 +99,7 @@ internal static DocumentIntelligenceError DeserializeDocumentIntelligenceError(J string message = default; string target = default; IReadOnlyList details = default; - InnerError innererror = default; + DocumentIntelligenceInnerError innererror = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -139,7 +139,7 @@ internal static DocumentIntelligenceError DeserializeDocumentIntelligenceError(J { continue; } - innererror = InnerError.DeserializeInnerError(property.Value, options); + innererror = DocumentIntelligenceInnerError.DeserializeDocumentIntelligenceInnerError(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs index dba56c36c8fc..e75bddb17272 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceError.cs @@ -64,15 +64,15 @@ internal DocumentIntelligenceError(string code, string message) /// 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. + /// An object containing more specific information than the current object about the error. /// Keeps track of any properties unknown to the library. - internal DocumentIntelligenceError(string code, string message, string target, IReadOnlyList details, InnerError innererror, IDictionary serializedAdditionalRawData) + internal DocumentIntelligenceError(string code, string message, string target, IReadOnlyList details, DocumentIntelligenceInnerError innerError, IDictionary serializedAdditionalRawData) { Code = code; Message = message; Target = target; Details = details; - Innererror = innererror; + InnerError = innerError; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,6 +90,6 @@ internal DocumentIntelligenceError() /// 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; } + public DocumentIntelligenceInnerError InnerError { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceInnerError.Serialization.cs similarity index 64% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceInnerError.Serialization.cs index d3c7eb224c8e..e9a83fc74be6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceInnerError.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class InnerError : IUtf8JsonSerializable, IJsonModel + public partial class DocumentIntelligenceInnerError : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InnerError)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceInnerError)} does not support writing '{format}' format."); } if (Optional.IsDefined(Code)) @@ -44,10 +44,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (Optional.IsDefined(InnerErrorObject)) + if (Optional.IsDefined(InnerError)) { writer.WritePropertyName("innererror"u8); - writer.WriteObjectValue(InnerErrorObject, options); + writer.WriteObjectValue(InnerError, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DocumentIntelligenceInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(InnerError)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceInnerError)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeInnerError(document.RootElement, options); + return DeserializeDocumentIntelligenceInnerError(document.RootElement, options); } - internal static InnerError DeserializeInnerError(JsonElement element, ModelReaderWriterOptions options = null) + internal static DocumentIntelligenceInnerError DeserializeDocumentIntelligenceInnerError(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +88,7 @@ internal static InnerError DeserializeInnerError(JsonElement element, ModelReade } string code = default; string message = default; - InnerError innererror = default; + DocumentIntelligenceInnerError innererror = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -109,7 +109,7 @@ internal static InnerError DeserializeInnerError(JsonElement element, ModelReade { continue; } - innererror = DeserializeInnerError(property.Value, options); + innererror = DeserializeDocumentIntelligenceInnerError(property.Value, options); continue; } if (options.Format != "W") @@ -118,46 +118,46 @@ internal static InnerError DeserializeInnerError(JsonElement element, ModelReade } } serializedAdditionalRawData = rawDataDictionary; - return new InnerError(code, message, innererror, serializedAdditionalRawData); + return new DocumentIntelligenceInnerError(code, message, innererror, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(InnerError)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceInnerError)} does not support writing '{options.Format}' format."); } } - InnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DocumentIntelligenceInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeInnerError(document.RootElement, options); + return DeserializeDocumentIntelligenceInnerError(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(InnerError)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceInnerError)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static InnerError FromResponse(Response response) + internal static DocumentIntelligenceInnerError FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeInnerError(document.RootElement); + return DeserializeDocumentIntelligenceInnerError(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceInnerError.cs similarity index 78% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceInnerError.cs index 7039008e4803..6e3dfb5f9feb 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/InnerError.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceInnerError.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// An object containing more specific information about the error. - public partial class InnerError + public partial class DocumentIntelligenceInnerError { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ public partial class InnerError /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal InnerError() + /// Initializes a new instance of . + internal DocumentIntelligenceInnerError() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// One of a server-defined set of error codes. /// A human-readable representation of the error. - /// Inner error. + /// Inner error. /// Keeps track of any properties unknown to the library. - internal InnerError(string code, string message, InnerError innerErrorObject, IDictionary serializedAdditionalRawData) + internal DocumentIntelligenceInnerError(string code, string message, DocumentIntelligenceInnerError innerError, IDictionary serializedAdditionalRawData) { Code = code; Message = message; - InnerErrorObject = innerErrorObject; + InnerError = innerError; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -68,6 +68,6 @@ internal InnerError(string code, string message, InnerError innerErrorObject, ID /// A human-readable representation of the error. public string Message { get; } /// Inner error. - public InnerError InnerErrorObject { get; } + public DocumentIntelligenceInnerError InnerError { get; } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceModelFactory.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceModelFactory.cs index 65feb08f0058..8eef041066d2 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceModelFactory.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceModelFactory.cs @@ -19,9 +19,9 @@ public static partial class DocumentIntelligenceModelFactory /// 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. + /// 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) + public static DocumentIntelligenceError DocumentIntelligenceError(string code = null, string message = null, string target = null, IEnumerable details = null, DocumentIntelligenceInnerError innerError = null) { details ??= new List(); @@ -30,70 +30,18 @@ public static DocumentIntelligenceError DocumentIntelligenceError(string code = message, target, details?.ToList(), - innererror, + innerError, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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) + /// Inner error. + /// A new instance for mocking. + public static DocumentIntelligenceInnerError DocumentIntelligenceInnerError(string code = null, string message = null, DocumentIntelligenceInnerError innerError = null) { - return new InnerError(code, message, innerErrorObject, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// 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 sections. - /// Extracted key-value pairs. - /// Extracted font styles. - /// Detected languages. - /// Extracted documents. - /// List of warnings encountered. - /// 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 sections = null, IEnumerable keyValuePairs = null, IEnumerable styles = null, IEnumerable languages = null, IEnumerable documents = null, IEnumerable warnings = null) - { - pages ??= new List(); - paragraphs ??= new List(); - tables ??= new List(); - figures ??= new List(); - sections ??= new List(); - keyValuePairs ??= new List(); - styles ??= new List(); - languages ??= new List(); - documents ??= new List(); - warnings ??= new List(); - - return new AnalyzeResult( - apiVersion, - modelId, - stringIndexType, - contentFormat, - content, - pages?.ToList(), - paragraphs?.ToList(), - tables?.ToList(), - figures?.ToList(), - sections?.ToList(), - keyValuePairs?.ToList(), - styles?.ToList(), - languages?.ToList(), - documents?.ToList(), - warnings?.ToList(), - serializedAdditionalRawData: null); + return new DocumentIntelligenceInnerError(code, message, innerError, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -162,7 +110,7 @@ public static DocumentSpan DocumentSpan(int offset = default, int length = defau /// 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) + public static DocumentWord DocumentWord(string content = null, IEnumerable polygon = null, DocumentSpan span = default, float confidence = default) { polygon ??= new List(); @@ -180,7 +128,7 @@ public static DocumentWord DocumentWord(string content = null, IEnumerable 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) + public static DocumentSelectionMark DocumentSelectionMark(DocumentSelectionMarkState state = default, IEnumerable polygon = null, DocumentSpan span = default, float confidence = default) { polygon ??= new List(); @@ -217,7 +165,7 @@ public static DocumentLine DocumentLine(string content = null, IEnumerable 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) + public static DocumentBarcode DocumentBarcode(DocumentBarcodeKind kind = default, string value = null, IEnumerable polygon = null, DocumentSpan span = default, float confidence = default) { polygon ??= new List(); @@ -242,7 +190,7 @@ public static DocumentBarcode DocumentBarcode(DocumentBarcodeKind kind = default /// 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) + public static DocumentFormula DocumentFormula(DocumentFormulaKind kind = default, string value = null, IEnumerable polygon = null, DocumentSpan span = default, float confidence = default) { polygon ??= new List(); @@ -479,82 +427,6 @@ public static DocumentLanguage DocumentLanguage(string locale = null, IEnumerabl return new DocumentLanguage(locale, spans?.ToList(), confidence, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// 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, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// 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. - /// Selection group 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? valueDouble = null, long? valueLong = null, DocumentSelectionMarkState? valueSelectionMark = null, DocumentSignatureType? valueSignature = null, string valueCountryRegion = null, IEnumerable valueList = null, IReadOnlyDictionary valueDictionary = null, CurrencyValue valueCurrency = null, AddressValue valueAddress = null, bool? valueBoolean = null, IEnumerable valueSelectionGroup = null, string content = null, IEnumerable boundingRegions = null, IEnumerable spans = null, float? confidence = null) - { - valueList ??= new List(); - valueDictionary ??= new Dictionary(); - valueSelectionGroup ??= new List(); - boundingRegions ??= new List(); - spans ??= new List(); - - return new DocumentField( - type, - valueString, - valueDate, - valueTime, - valuePhoneNumber, - valueDouble, - valueLong, - valueSelectionMark, - valueSignature, - valueCountryRegion, - valueList?.ToList(), - valueDictionary, - valueCurrency, - valueAddress, - valueBoolean, - valueSelectionGroup?.ToList(), - content, - boundingRegions?.ToList(), - spans?.ToList(), - confidence, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Currency amount. /// Currency symbol label, if any. @@ -614,25 +486,25 @@ public static DocumentIntelligenceWarning DocumentIntelligenceWarning(string cod return new DocumentIntelligenceWarning(code, message, target, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// + /// Initializes a new instance of . + /// /// Azure Blob Storage location containing the batch documents. Either /// azureBlobSource or azureBlobFileListSource must be specified. /// - /// + /// /// Azure Blob Storage file list specifying the batch documents. Either /// azureBlobSource or azureBlobFileListSource must be specified. /// - /// Azure Blob Storage container URL where analyze result files will be stored. + /// Azure Blob Storage container URL where analyze result files will be stored. /// Blob name prefix of result files. /// Overwrite existing analyze result files?. - /// A new instance for mocking. - public static AnalyzeBatchDocumentsContent AnalyzeBatchDocumentsContent(AzureBlobContentSource azureBlobSource = null, AzureBlobFileListContentSource azureBlobFileListSource = null, Uri resultContainerUrl = null, string resultPrefix = null, bool? overwriteExisting = null) + /// A new instance for mocking. + public static AnalyzeBatchDocumentsOptions AnalyzeBatchDocumentsOptions(BlobContentSource blobSource = null, BlobFileListContentSource blobFileListSource = null, Uri resultContainerUri = null, string resultPrefix = null, bool? overwriteExisting = null) { - return new AnalyzeBatchDocumentsContent( - azureBlobSource, - azureBlobFileListSource, - resultContainerUrl, + return new AnalyzeBatchDocumentsOptions( + blobSource, + blobFileListSource, + resultContainerUri, resultPrefix, overwriteExisting, serializedAdditionalRawData: null); @@ -644,50 +516,72 @@ public static AnalyzeBatchDocumentsContent AnalyzeBatchDocumentsContent(AzureBlo /// Number of documents that completed with status skipped. /// Operation detail for each document in the batch. /// A new instance for mocking. - public static AnalyzeBatchResult AnalyzeBatchResult(int succeededCount = default, int failedCount = default, int skippedCount = default, IEnumerable details = null) + public static AnalyzeBatchResult AnalyzeBatchResult(int succeededCount = default, int failedCount = default, int skippedCount = default, IEnumerable details = null) { - details ??= new List(); + details ??= new List(); return new AnalyzeBatchResult(succeededCount, failedCount, skippedCount, details?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Analyze status. succeeded, failed, or skipped. - /// URL of the source document. - /// URL of the analyze result JSON. + /// URL of the source document. + /// URL of the analyze result JSON. /// Encountered error. - /// A new instance for mocking. - public static AnalyzeBatchOperationDetail AnalyzeBatchOperationDetail(OperationStatus status = default, Uri sourceUrl = null, Uri resultUrl = null, DocumentIntelligenceError error = null) + /// A new instance for mocking. + public static AnalyzeBatchResultDetails AnalyzeBatchResultDetails(DocumentIntelligenceOperationStatus status = default, Uri sourceUri = null, Uri resultUri = null, DocumentIntelligenceError error = null) { - return new AnalyzeBatchOperationDetail(status, sourceUrl, resultUrl, error, serializedAdditionalRawData: null); + return new AnalyzeBatchResultDetails(status, sourceUri, resultUri, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Analyze batch operation result ID. + /// Operation status. notStarted, running, succeeded, or failed. + /// Date and time (UTC) when the operation was submitted. + /// Date and time (UTC) when the status was last updated. + /// Operation progress (0-100). + /// Encountered error during batch document analysis. + /// Batch document analysis result. + /// A new instance for mocking. + public static AnalyzeBatchOperationDetails AnalyzeBatchOperationDetails(string resultId = null, DocumentIntelligenceOperationStatus status = default, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, int? percentCompleted = null, DocumentIntelligenceError error = null, AnalyzeBatchResult result = null) + { + return new AnalyzeBatchOperationDetails( + resultId, + status, + createdOn, + lastUpdatedOn, + percentCompleted, + error, + result, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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. /// Max number of V100-equivalent GPU hours to use for model training. Default=0.5. /// Allow overwriting an existing model with the same name. - /// A new instance for mocking. - public static BuildDocumentModelContent BuildDocumentModelContent(string modelId = null, string description = null, DocumentBuildMode buildMode = default, AzureBlobContentSource azureBlobSource = null, AzureBlobFileListContentSource azureBlobFileListSource = null, IDictionary tags = null, float? maxTrainingHours = null, bool? allowOverwrite = null) + /// A new instance for mocking. + public static BuildDocumentModelOptions BuildDocumentModelOptions(string modelId = null, string description = null, DocumentBuildMode buildMode = default, BlobContentSource blobSource = null, BlobFileListContentSource blobFileListSource = null, IDictionary tags = null, float? maxTrainingHours = null, bool? allowOverwrite = null) { tags ??= new Dictionary(); - return new BuildDocumentModelContent( + return new BuildDocumentModelOptions( modelId, description, buildMode, - azureBlobSource, - azureBlobFileListSource, + blobSource, + blobFileListSource, tags, maxTrainingHours, allowOverwrite, @@ -699,27 +593,28 @@ public static BuildDocumentModelContent BuildDocumentModelContent(string modelId /// Document model description. /// Date and time (UTC) when the document model was created. /// Date and time (UTC) when the document model will expire. + /// Date and time (UTC) when the document model was last modified. /// 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. /// /// For composed models, the custom classifier to split and classify the input file. /// For composed models, the file splitting behavior. - /// Supported document types. + /// Supported document types. /// List of warnings encountered while building the model. /// Number of V100-equivalent GPU hours consumed for model training. /// A new instance for mocking. - public static DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, DateTimeOffset createdOn = default, DateTimeOffset? expiresOn = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentBuildMode? buildMode = null, AzureBlobContentSource azureBlobSource = null, AzureBlobFileListContentSource azureBlobFileListSource = null, string classifierId = null, SplitMode? split = null, IReadOnlyDictionary docTypes = null, IEnumerable warnings = null, float? trainingHours = null) + public static DocumentModelDetails DocumentModelDetails(string modelId = null, string description = null, DateTimeOffset createdOn = default, DateTimeOffset? expiresOn = null, DateTimeOffset? modifiedOn = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentBuildMode? buildMode = null, BlobContentSource blobSource = null, BlobFileListContentSource blobFileListSource = null, string classifierId = null, SplitMode? split = null, IReadOnlyDictionary documentTypes = null, IEnumerable warnings = null, float? trainingHours = null) { tags ??= new Dictionary(); - docTypes ??= new Dictionary(); + documentTypes ??= new Dictionary(); warnings ??= new List(); return new DocumentModelDetails( @@ -727,14 +622,15 @@ public static DocumentModelDetails DocumentModelDetails(string modelId = null, s description, createdOn, expiresOn, + modifiedOn, apiVersion, tags, buildMode, - azureBlobSource, - azureBlobFileListSource, + blobSource, + blobFileListSource, classifierId, split, - docTypes, + documentTypes, warnings?.ToList(), trainingHours, serializedAdditionalRawData: null); @@ -752,7 +648,7 @@ public static DocumentModelDetails DocumentModelDetails(string modelId = null, s /// Encountered error. /// Operation result upon success. /// A new instance for mocking. - public static DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(string operationId = null, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) + public static DocumentModelBuildOperationDetails DocumentModelBuildOperationDetails(string operationId = null, DocumentIntelligenceOperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) { tags ??= new Dictionary(); @@ -771,7 +667,7 @@ public static DocumentModelBuildOperationDetails DocumentModelBuildOperationDeta result); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Operation ID. /// Operation status. notStarted, running, completed, or failed. /// Operation progress (0-100). @@ -782,12 +678,12 @@ public static DocumentModelBuildOperationDetails DocumentModelBuildOperationDeta /// 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(string operationId = null, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, string kind = null, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null) + /// A new instance for mocking. + public static DocumentIntelligenceOperationDetails DocumentIntelligenceOperationDetails(string operationId = null, DocumentIntelligenceOperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, string kind = null, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null) { tags ??= new Dictionary(); - return new UnknownOperationDetails( + return new UnknownDocumentIntelligenceOperationDetails( operationId, status, percentCompleted, @@ -813,7 +709,7 @@ public static OperationDetails OperationDetails(string operationId = null, Opera /// Encountered error. /// Operation result upon success. /// A new instance for mocking. - public static DocumentModelComposeOperationDetails DocumentModelComposeOperationDetails(string operationId = null, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) + public static DocumentModelComposeOperationDetails DocumentModelComposeOperationDetails(string operationId = null, DocumentIntelligenceOperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) { tags ??= new Dictionary(); @@ -844,7 +740,7 @@ public static DocumentModelComposeOperationDetails DocumentModelComposeOperation /// Encountered error. /// Operation result upon success. /// A new instance for mocking. - public static DocumentModelCopyToOperationDetails DocumentModelCopyToOperationDetails(string operationId = null, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) + public static DocumentModelCopyToOperationDetails DocumentModelCopyToOperationDetails(string operationId = null, DocumentIntelligenceOperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentModelDetails result = null) { tags ??= new Dictionary(); @@ -875,7 +771,7 @@ public static DocumentModelCopyToOperationDetails DocumentModelCopyToOperationDe /// Encountered error. /// Operation result upon success. /// A new instance for mocking. - public static DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToOperationDetails(string operationId = null, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentClassifierDetails result = null) + public static DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToOperationDetails(string operationId = null, DocumentIntelligenceOperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentClassifierDetails result = null) { tags ??= new Dictionary(); @@ -899,14 +795,15 @@ public static DocumentClassifierCopyToOperationDetails DocumentClassifierCopyToO /// Document classifier description. /// Date and time (UTC) when the document classifier was created. /// Date and time (UTC) when the document classifier will expire. + /// Date and time (UTC) when the document model was last modified. /// API version used to create this document classifier. /// Base classifierId on top of which the classifier was trained. - /// List of document types to classify against. + /// List of document types to classify against. /// List of warnings encountered while building the classifier. /// A new instance for mocking. - public static DocumentClassifierDetails DocumentClassifierDetails(string classifierId = null, string description = null, DateTimeOffset createdOn = default, DateTimeOffset? expiresOn = null, string apiVersion = null, string baseClassifierId = null, IReadOnlyDictionary docTypes = null, IEnumerable warnings = null) + public static DocumentClassifierDetails DocumentClassifierDetails(string classifierId = null, string description = null, DateTimeOffset createdOn = default, DateTimeOffset? expiresOn = null, DateTimeOffset? modifiedOn = null, string apiVersion = null, string baseClassifierId = null, IReadOnlyDictionary documentTypes = null, IEnumerable warnings = null) { - docTypes ??= new Dictionary(); + documentTypes ??= new Dictionary(); warnings ??= new List(); return new DocumentClassifierDetails( @@ -914,9 +811,10 @@ public static DocumentClassifierDetails DocumentClassifierDetails(string classif description, createdOn, expiresOn, + modifiedOn, apiVersion, baseClassifierId, - docTypes, + documentTypes, warnings?.ToList(), serializedAdditionalRawData: null); } @@ -933,7 +831,7 @@ public static DocumentClassifierDetails DocumentClassifierDetails(string classif /// Encountered error. /// Operation result upon success. /// A new instance for mocking. - public static DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(string operationId = null, OperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentClassifierDetails result = null) + public static DocumentClassifierBuildOperationDetails DocumentClassifierBuildOperationDetails(string operationId = null, DocumentIntelligenceOperationStatus status = default, int? percentCompleted = null, DateTimeOffset createdOn = default, DateTimeOffset lastUpdatedOn = default, Uri resourceLocation = null, string apiVersion = null, IReadOnlyDictionary tags = null, DocumentIntelligenceError error = null, DocumentClassifierDetails result = null) { tags ??= new Dictionary(); @@ -952,47 +850,47 @@ public static DocumentClassifierBuildOperationDetails DocumentClassifierBuildOpe result); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document model name. /// Document model description. /// Custom classifier to split and classify the input file. /// File splitting behavior. - /// Dictionary mapping supported docTypes to the corresponding document models. + /// Dictionary mapping supported docTypes to the corresponding document models. /// List of key-value tag attributes associated with the document model. - /// A new instance for mocking. - public static ComposeDocumentModelContent ComposeDocumentModelContent(string modelId = null, string description = null, string classifierId = null, SplitMode? split = null, IDictionary docTypes = null, IDictionary tags = null) + /// A new instance for mocking. + public static ComposeModelOptions ComposeModelOptions(string modelId = null, string description = null, string classifierId = null, SplitMode? split = null, IDictionary documentTypes = null, IDictionary tags = null) { - docTypes ??= new Dictionary(); + documentTypes ??= new Dictionary(); tags ??= new Dictionary(); - return new ComposeDocumentModelContent( + return new ComposeModelOptions( modelId, description, classifierId, split, - docTypes, + documentTypes, tags, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document model name. /// Document model description. /// List of key-value tag attributes associated with the document model. - /// A new instance for mocking. - public static AuthorizeCopyContent AuthorizeCopyContent(string modelId = null, string description = null, IDictionary tags = null) + /// A new instance for mocking. + public static AuthorizeModelCopyOptions AuthorizeModelCopyOptions(string modelId = null, string description = null, IDictionary tags = null) { tags ??= new Dictionary(); - return new AuthorizeCopyContent(modelId, description, tags, serializedAdditionalRawData: null); + return new AuthorizeModelCopyOptions(modelId, description, tags, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Details regarding custom document models. - /// A new instance for mocking. - public static ResourceDetails ResourceDetails(CustomDocumentModelsDetails customDocumentModels = null) + /// A new instance for mocking. + public static DocumentIntelligenceResourceDetails DocumentIntelligenceResourceDetails(CustomDocumentModelsDetails customDocumentModels = null) { - return new ResourceDetails(customDocumentModels, serializedAdditionalRawData: null); + return new DocumentIntelligenceResourceDetails(customDocumentModels, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -1004,36 +902,36 @@ public static CustomDocumentModelsDetails CustomDocumentModelsDetails(int count return new CustomDocumentModelsDetails(count, limit, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document classifier name. /// Document classifier description. /// Base classifierId on top of which to train the classifier. - /// List of document types to classify against. + /// List of document types to classify against. /// Allow overwriting an existing classifier with the same name. - /// A new instance for mocking. - public static BuildDocumentClassifierContent BuildDocumentClassifierContent(string classifierId = null, string description = null, string baseClassifierId = null, IDictionary docTypes = null, bool? allowOverwrite = null) + /// A new instance for mocking. + public static BuildClassifierOptions BuildClassifierOptions(string classifierId = null, string description = null, string baseClassifierId = null, IDictionary documentTypes = null, bool? allowOverwrite = null) { - docTypes ??= new Dictionary(); + documentTypes ??= new Dictionary(); - return new BuildDocumentClassifierContent( + return new BuildClassifierOptions( classifierId, description, baseClassifierId, - docTypes, + documentTypes, allowOverwrite, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Unique document classifier name. /// Document classifier description. /// List of key-value tag attributes associated with the document classifier. - /// A new instance for mocking. - public static AuthorizeClassifierCopyContent AuthorizeClassifierCopyContent(string classifierId = null, string description = null, IDictionary tags = null) + /// A new instance for mocking. + public static AuthorizeClassifierCopyOptions AuthorizeClassifierCopyOptions(string classifierId = null, string description = null, IDictionary tags = null) { tags ??= new Dictionary(); - return new AuthorizeClassifierCopyContent(classifierId, description, tags, serializedAdditionalRawData: null); + return new AuthorizeClassifierCopyOptions(classifierId, description, tags, serializedAdditionalRawData: null); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationDetails.Serialization.cs similarity index 69% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationDetails.Serialization.cs index 8ff2fc51806d..fa3a838ab304 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationDetails.Serialization.cs @@ -12,12 +12,12 @@ namespace Azure.AI.DocumentIntelligence { - [PersistableModelProxy(typeof(UnknownOperationDetails))] - public partial class OperationDetails : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownDocumentIntelligenceOperationDetails))] + public partial class DocumentIntelligenceOperationDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OperationDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("operationId"u8); @@ -89,19 +89,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - OperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DocumentIntelligenceOperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OperationDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOperationDetails(document.RootElement, options); + return DeserializeDocumentIntelligenceOperationDetails(document.RootElement, options); } - internal static OperationDetails DeserializeOperationDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static DocumentIntelligenceOperationDetails DeserializeDocumentIntelligenceOperationDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -120,46 +120,46 @@ internal static OperationDetails DeserializeOperationDetails(JsonElement element case "documentModelCopyTo": return DocumentModelCopyToOperationDetails.DeserializeDocumentModelCopyToOperationDetails(element, options); } } - return UnknownOperationDetails.DeserializeUnknownOperationDetails(element, options); + return UnknownDocumentIntelligenceOperationDetails.DeserializeUnknownDocumentIntelligenceOperationDetails(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(OperationDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support writing '{options.Format}' format."); } } - OperationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DocumentIntelligenceOperationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOperationDetails(document.RootElement, options); + return DeserializeDocumentIntelligenceOperationDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OperationDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static OperationDetails FromResponse(Response response) + internal static DocumentIntelligenceOperationDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeOperationDetails(document.RootElement); + return DeserializeDocumentIntelligenceOperationDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationDetails.cs similarity index 80% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationDetails.cs index 1382686781dc..ccd311b09ea8 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationDetails.cs @@ -12,10 +12,10 @@ 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. + /// 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 + public abstract partial class DocumentIntelligenceOperationDetails { /// /// Keeps track of any properties unknown to the library. @@ -49,14 +49,14 @@ public abstract partial class OperationDetails /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Operation ID. /// Operation status. notStarted, running, completed, or failed. /// 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. /// or is null. - protected OperationDetails(string operationId, OperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) + protected DocumentIntelligenceOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) { Argument.AssertNotNull(operationId, nameof(operationId)); Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); @@ -69,7 +69,7 @@ protected OperationDetails(string operationId, OperationStatus status, DateTimeO Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Operation ID. /// Operation status. notStarted, running, completed, or failed. /// Operation progress (0-100). @@ -81,7 +81,7 @@ protected OperationDetails(string operationId, OperationStatus status, DateTimeO /// List of key-value tag attributes associated with the document model. /// Encountered error. /// Keeps track of any properties unknown to the library. - internal OperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData) + internal DocumentIntelligenceOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData) { OperationId = operationId; Status = status; @@ -96,15 +96,15 @@ internal OperationDetails(string operationId, OperationStatus status, int? perce _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal OperationDetails() + /// Initializes a new instance of for deserialization. + internal DocumentIntelligenceOperationDetails() { } /// Operation ID. public string OperationId { get; } /// Operation status. notStarted, running, completed, or failed. - public OperationStatus Status { get; } + public DocumentIntelligenceOperationStatus Status { get; } /// Operation progress (0-100). public int? PercentCompleted { get; } /// Date and time (UTC) when the operation was created. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationStatus.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationStatus.cs new file mode 100644 index 000000000000..a592b5e67f7f --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceOperationStatus.cs @@ -0,0 +1,63 @@ +// 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 DocumentIntelligenceOperationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentIntelligenceOperationStatus(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"; + private const string SkippedValue = "skipped"; + + /// The operation has not started yet. + public static DocumentIntelligenceOperationStatus NotStarted { get; } = new DocumentIntelligenceOperationStatus(NotStartedValue); + /// The operation is in progress. + public static DocumentIntelligenceOperationStatus Running { get; } = new DocumentIntelligenceOperationStatus(RunningValue); + /// The operation has failed. + public static DocumentIntelligenceOperationStatus Failed { get; } = new DocumentIntelligenceOperationStatus(FailedValue); + /// The operation has succeeded. + public static DocumentIntelligenceOperationStatus Succeeded { get; } = new DocumentIntelligenceOperationStatus(SucceededValue); + /// The operation has been canceled. + public static DocumentIntelligenceOperationStatus Canceled { get; } = new DocumentIntelligenceOperationStatus(CanceledValue); + /// The operation has been skipped. + public static DocumentIntelligenceOperationStatus Skipped { get; } = new DocumentIntelligenceOperationStatus(SkippedValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentIntelligenceOperationStatus left, DocumentIntelligenceOperationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentIntelligenceOperationStatus left, DocumentIntelligenceOperationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DocumentIntelligenceOperationStatus(string value) => new DocumentIntelligenceOperationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentIntelligenceOperationStatus other && Equals(other); + /// + public bool Equals(DocumentIntelligenceOperationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceResourceDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceResourceDetails.Serialization.cs new file mode 100644 index 000000000000..a419a440cae3 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceResourceDetails.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.DocumentIntelligence +{ + public partial class DocumentIntelligenceResourceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentIntelligenceResourceDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("customDocumentModels"u8); + writer.WriteObjectValue(CustomDocumentModels, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentIntelligenceResourceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentIntelligenceResourceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentIntelligenceResourceDetails(document.RootElement, options); + } + + internal static DocumentIntelligenceResourceDetails DeserializeDocumentIntelligenceResourceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomDocumentModelsDetails customDocumentModels = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customDocumentModels"u8)) + { + customDocumentModels = CustomDocumentModelsDetails.DeserializeCustomDocumentModelsDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentIntelligenceResourceDetails(customDocumentModels, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentIntelligenceResourceDetails)} does not support writing '{options.Format}' format."); + } + } + + DocumentIntelligenceResourceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentIntelligenceResourceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentIntelligenceResourceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentIntelligenceResourceDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentIntelligenceResourceDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceResourceDetails.cs similarity index 77% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceResourceDetails.cs index 404f00186491..652132eae0d7 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ResourceDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentIntelligenceResourceDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// General information regarding the current resource. - public partial class ResourceDetails + public partial class DocumentIntelligenceResourceDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class ResourceDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Details regarding custom document models. /// is null. - internal ResourceDetails(CustomDocumentModelsDetails customDocumentModels) + internal DocumentIntelligenceResourceDetails(CustomDocumentModelsDetails customDocumentModels) { Argument.AssertNotNull(customDocumentModels, nameof(customDocumentModels)); CustomDocumentModels = customDocumentModels; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Details regarding custom document models. /// Keeps track of any properties unknown to the library. - internal ResourceDetails(CustomDocumentModelsDetails customDocumentModels, IDictionary serializedAdditionalRawData) + internal DocumentIntelligenceResourceDetails(CustomDocumentModelsDetails customDocumentModels, IDictionary serializedAdditionalRawData) { CustomDocumentModels = customDocumentModels; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ResourceDetails() + /// Initializes a new instance of for deserialization. + internal DocumentIntelligenceResourceDetails() { } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs index 03262c588282..535386ec2eb0 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.Serialization.cs @@ -64,7 +64,7 @@ internal static DocumentModelBuildOperationDetails DeserializeDocumentModelBuild } DocumentModelDetails result = default; string operationId = default; - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; int? percentCompleted = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; @@ -93,7 +93,7 @@ internal static DocumentModelBuildOperationDetails DeserializeDocumentModelBuild } if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("percentCompleted"u8)) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs index c2065bdbaf73..d5c3aafdb2e6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelBuildOperationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Get Operation response object. - public partial class DocumentModelBuildOperationDetails : OperationDetails + public partial class DocumentModelBuildOperationDetails : DocumentIntelligenceOperationDetails { /// Initializes a new instance of . /// Operation ID. @@ -20,7 +20,7 @@ public partial class DocumentModelBuildOperationDetails : OperationDetails /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// or is null. - internal DocumentModelBuildOperationDetails(string operationId, OperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) + internal DocumentModelBuildOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) { Argument.AssertNotNull(operationId, nameof(operationId)); Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); @@ -41,7 +41,7 @@ internal DocumentModelBuildOperationDetails(string operationId, OperationStatus /// Encountered error. /// Keeps track of any properties unknown to the library. /// Operation result upon success. - internal DocumentModelBuildOperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) + internal DocumentModelBuildOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) { Result = result; } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs index 4a573b78e3ac..cac5e34251bf 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.Serialization.cs @@ -64,7 +64,7 @@ internal static DocumentModelComposeOperationDetails DeserializeDocumentModelCom } DocumentModelDetails result = default; string operationId = default; - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; int? percentCompleted = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; @@ -93,7 +93,7 @@ internal static DocumentModelComposeOperationDetails DeserializeDocumentModelCom } if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("percentCompleted"u8)) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs index c6b9ff6298ef..6a6fd2ab0798 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelComposeOperationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Get Operation response object. - public partial class DocumentModelComposeOperationDetails : OperationDetails + public partial class DocumentModelComposeOperationDetails : DocumentIntelligenceOperationDetails { /// Initializes a new instance of . /// Operation ID. @@ -20,7 +20,7 @@ public partial class DocumentModelComposeOperationDetails : OperationDetails /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// or is null. - internal DocumentModelComposeOperationDetails(string operationId, OperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) + internal DocumentModelComposeOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) { Argument.AssertNotNull(operationId, nameof(operationId)); Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); @@ -41,7 +41,7 @@ internal DocumentModelComposeOperationDetails(string operationId, OperationStatu /// Encountered error. /// Keeps track of any properties unknown to the library. /// Operation result upon success. - internal DocumentModelComposeOperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) + internal DocumentModelComposeOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) { Result = result; } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs index 9f181c5e0ddb..00213a30fbc8 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.Serialization.cs @@ -64,7 +64,7 @@ internal static DocumentModelCopyToOperationDetails DeserializeDocumentModelCopy } DocumentModelDetails result = default; string operationId = default; - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; int? percentCompleted = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; @@ -93,7 +93,7 @@ internal static DocumentModelCopyToOperationDetails DeserializeDocumentModelCopy } if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("percentCompleted"u8)) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs index d3228c80e7a3..cd11a6025916 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelCopyToOperationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Get Operation response object. - public partial class DocumentModelCopyToOperationDetails : OperationDetails + public partial class DocumentModelCopyToOperationDetails : DocumentIntelligenceOperationDetails { /// Initializes a new instance of . /// Operation ID. @@ -20,7 +20,7 @@ public partial class DocumentModelCopyToOperationDetails : OperationDetails /// Date and time (UTC) when the status was last updated. /// URL of the resource targeted by this operation. /// or is null. - internal DocumentModelCopyToOperationDetails(string operationId, OperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) + internal DocumentModelCopyToOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, Uri resourceLocation) : base(operationId, status, createdOn, lastUpdatedOn, resourceLocation) { Argument.AssertNotNull(operationId, nameof(operationId)); Argument.AssertNotNull(resourceLocation, nameof(resourceLocation)); @@ -41,7 +41,7 @@ internal DocumentModelCopyToOperationDetails(string operationId, OperationStatus /// Encountered error. /// Keeps track of any properties unknown to the library. /// Operation result upon success. - internal DocumentModelCopyToOperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) + internal DocumentModelCopyToOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData, DocumentModelDetails result) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) { Result = result; } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs index dcb9c815d0d8..786f4f54da72 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.Serialization.cs @@ -51,6 +51,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("expirationDateTime"u8); writer.WriteStringValue(ExpiresOn.Value, "O"); } + if (options.Format != "W" && Optional.IsDefined(ModifiedOn)) + { + writer.WritePropertyName("modifiedDateTime"u8); + writer.WriteStringValue(ModifiedOn.Value, "O"); + } if (options.Format != "W" && Optional.IsDefined(ApiVersion)) { writer.WritePropertyName("apiVersion"u8); @@ -72,15 +77,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("buildMode"u8); writer.WriteStringValue(BuildMode.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(AzureBlobSource)) + if (options.Format != "W" && Optional.IsDefined(BlobSource)) { writer.WritePropertyName("azureBlobSource"u8); - writer.WriteObjectValue(AzureBlobSource, options); + writer.WriteObjectValue(BlobSource, options); } - if (options.Format != "W" && Optional.IsDefined(AzureBlobFileListSource)) + if (options.Format != "W" && Optional.IsDefined(BlobFileListSource)) { writer.WritePropertyName("azureBlobFileListSource"u8); - writer.WriteObjectValue(AzureBlobFileListSource, options); + writer.WriteObjectValue(BlobFileListSource, options); } if (Optional.IsDefined(ClassifierId)) { @@ -92,11 +97,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("split"u8); writer.WriteStringValue(Split.Value.ToString()); } - if (options.Format != "W" && Optional.IsCollectionDefined(DocTypes)) + if (options.Format != "W" && Optional.IsCollectionDefined(DocumentTypes)) { writer.WritePropertyName("docTypes"u8); writer.WriteStartObject(); - foreach (var item in DocTypes) + foreach (var item in DocumentTypes) { writer.WritePropertyName(item.Key); writer.WriteObjectValue(item.Value, options); @@ -159,11 +164,12 @@ internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement string description = default; DateTimeOffset createdDateTime = default; DateTimeOffset? expirationDateTime = default; + DateTimeOffset? modifiedDateTime = default; string apiVersion = default; IReadOnlyDictionary tags = default; DocumentBuildMode? buildMode = default; - AzureBlobContentSource azureBlobSource = default; - AzureBlobFileListContentSource azureBlobFileListSource = default; + BlobContentSource azureBlobSource = default; + BlobFileListContentSource azureBlobFileListSource = default; string classifierId = default; SplitMode? split = default; IReadOnlyDictionary docTypes = default; @@ -197,6 +203,15 @@ internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement expirationDateTime = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("modifiedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } if (property.NameEquals("apiVersion"u8)) { apiVersion = property.Value.GetString(); @@ -231,7 +246,7 @@ internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement { continue; } - azureBlobSource = AzureBlobContentSource.DeserializeAzureBlobContentSource(property.Value, options); + azureBlobSource = BlobContentSource.DeserializeBlobContentSource(property.Value, options); continue; } if (property.NameEquals("azureBlobFileListSource"u8)) @@ -240,7 +255,7 @@ internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement { continue; } - azureBlobFileListSource = AzureBlobFileListContentSource.DeserializeAzureBlobFileListContentSource(property.Value, options); + azureBlobFileListSource = BlobFileListContentSource.DeserializeBlobFileListContentSource(property.Value, options); continue; } if (property.NameEquals("classifierId"u8)) @@ -305,6 +320,7 @@ internal static DocumentModelDetails DeserializeDocumentModelDetails(JsonElement description, createdDateTime, expirationDateTime, + modifiedDateTime, apiVersion, tags ?? new ChangeTrackingDictionary(), buildMode, diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs index 11b7e4419a2b..626c6702e630 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentModelDetails.cs @@ -54,7 +54,7 @@ internal DocumentModelDetails(string modelId) ModelId = modelId; Tags = new ChangeTrackingDictionary(); - DocTypes = new ChangeTrackingDictionary(); + DocumentTypes = new ChangeTrackingDictionary(); Warnings = new ChangeTrackingList(); } @@ -63,37 +63,39 @@ internal DocumentModelDetails(string modelId) /// Document model description. /// Date and time (UTC) when the document model was created. /// Date and time (UTC) when the document model will expire. + /// Date and time (UTC) when the document model was last modified. /// 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. /// /// For composed models, the custom classifier to split and classify the input file. /// For composed models, the file splitting behavior. - /// Supported document types. + /// Supported document types. /// List of warnings encountered while building the model. /// Number of V100-equivalent GPU hours consumed for model training. /// Keeps track of any properties unknown to the library. - internal DocumentModelDetails(string modelId, string description, DateTimeOffset createdOn, DateTimeOffset? expiresOn, string apiVersion, IReadOnlyDictionary tags, DocumentBuildMode? buildMode, AzureBlobContentSource azureBlobSource, AzureBlobFileListContentSource azureBlobFileListSource, string classifierId, SplitMode? split, IReadOnlyDictionary docTypes, IReadOnlyList warnings, float? trainingHours, IDictionary serializedAdditionalRawData) + internal DocumentModelDetails(string modelId, string description, DateTimeOffset createdOn, DateTimeOffset? expiresOn, DateTimeOffset? modifiedOn, string apiVersion, IReadOnlyDictionary tags, DocumentBuildMode? buildMode, BlobContentSource blobSource, BlobFileListContentSource blobFileListSource, string classifierId, SplitMode? split, IReadOnlyDictionary documentTypes, IReadOnlyList warnings, float? trainingHours, IDictionary serializedAdditionalRawData) { ModelId = modelId; Description = description; CreatedOn = createdOn; ExpiresOn = expiresOn; + ModifiedOn = modifiedOn; ApiVersion = apiVersion; Tags = tags; BuildMode = buildMode; - AzureBlobSource = azureBlobSource; - AzureBlobFileListSource = azureBlobFileListSource; + BlobSource = blobSource; + BlobFileListSource = blobFileListSource; ClassifierId = classifierId; Split = split; - DocTypes = docTypes; + DocumentTypes = documentTypes; Warnings = warnings; TrainingHours = trainingHours; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -112,6 +114,8 @@ internal DocumentModelDetails() public DateTimeOffset CreatedOn { get; } /// Date and time (UTC) when the document model will expire. public DateTimeOffset? ExpiresOn { get; } + /// Date and time (UTC) when the document model was last modified. + public DateTimeOffset? ModifiedOn { get; } /// API version used to create this document model. public string ApiVersion { get; } /// List of key-value tag attributes associated with the document model. @@ -122,18 +126,18 @@ internal DocumentModelDetails() /// Azure Blob Storage location containing the training data. Either /// azureBlobSource or azureBlobFileListSource must be specified. /// - public AzureBlobContentSource AzureBlobSource { get; } + public BlobContentSource BlobSource { get; } /// /// Azure Blob Storage file list specifying the training data. Either /// azureBlobSource or azureBlobFileListSource must be specified. /// - public AzureBlobFileListContentSource AzureBlobFileListSource { get; } + public BlobFileListContentSource BlobFileListSource { get; } /// For composed models, the custom classifier to split and classify the input file. public string ClassifierId { get; } /// For composed models, the file splitting behavior. public SplitMode? Split { get; } /// Supported document types. - public IReadOnlyDictionary DocTypes { get; } + public IReadOnlyDictionary DocumentTypes { get; } /// List of warnings encountered while building the model. public IReadOnlyList Warnings { get; } /// Number of V100-equivalent GPU hours consumed for model training. diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs index 93f090b9dd72..a7de198a02ba 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSelectionMark.cs @@ -52,11 +52,8 @@ public partial class 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; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs index 548724f26c5d..a3b58f5a8036 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.AI.DocumentIntelligence { - public partial class DocumentSpan : IUtf8JsonSerializable, IJsonModel + public partial struct DocumentSpan : IUtf8JsonSerializable, IJsonModel, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -26,7 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti /// The JSON writer. /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + private void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -67,14 +67,14 @@ DocumentSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelRea return DeserializeDocumentSpan(document.RootElement, options); } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)this).Write(writer, options); + + object IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)this).Create(ref reader, options); + internal static DocumentSpan DeserializeDocumentSpan(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } int offset = default; int length = default; IDictionary serializedAdditionalRawData = default; @@ -131,6 +131,12 @@ DocumentSpan IPersistableModel.Create(BinaryData data, ModelReader string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ((IPersistableModel)this).Write(options); + + object IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ((IPersistableModel)this).Create(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)this).GetFormatFromOptions(options); + /// Deserializes the model from a raw response. /// The response to deserialize the model from. internal static DocumentSpan FromResponse(Response response) @@ -140,7 +146,7 @@ internal static DocumentSpan FromResponse(Response response) } /// Convert into a . - internal virtual RequestContent ToRequestContent() + internal RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs index 87548084575f..972b3a380295 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentSpan.cs @@ -14,7 +14,7 @@ namespace Azure.AI.DocumentIntelligence /// Contiguous region of the concatenated content property, specified as an offset /// and length. /// - public partial class DocumentSpan + public readonly partial struct DocumentSpan { /// /// Keeps track of any properties unknown to the library. @@ -46,7 +46,7 @@ public partial class DocumentSpan /// /// /// - private IDictionary _serializedAdditionalRawData; + private readonly IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . /// Zero-based index of the content represented by the span. @@ -69,7 +69,7 @@ internal DocumentSpan(int offset, int length, IDictionary se } /// Initializes a new instance of for deserialization. - internal DocumentSpan() + public DocumentSpan() { } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs index 318354a3dfe2..ca7148843095 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/DocumentWord.cs @@ -53,11 +53,10 @@ public partial class 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. + /// 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(); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ModelCopyAuthorization.Serialization.cs similarity index 74% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ModelCopyAuthorization.Serialization.cs index 3d8db89aafa4..b4c0575bf17f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ModelCopyAuthorization.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - public partial class CopyAuthorization : IUtf8JsonSerializable, IJsonModel + public partial class ModelCopyAuthorization : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyAuthorization)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ModelCopyAuthorization)} does not support writing '{format}' format."); } writer.WritePropertyName("targetResourceId"u8); @@ -45,7 +45,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("accessToken"u8); writer.WriteStringValue(AccessToken); writer.WritePropertyName("expirationDateTime"u8); - writer.WriteStringValue(ExpirationDateTime, "O"); + writer.WriteStringValue(ExpiresOn, "O"); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -63,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CopyAuthorization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ModelCopyAuthorization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(CopyAuthorization)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ModelCopyAuthorization)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCopyAuthorization(document.RootElement, options); + return DeserializeModelCopyAuthorization(document.RootElement, options); } - internal static CopyAuthorization DeserializeCopyAuthorization(JsonElement element, ModelReaderWriterOptions options = null) + internal static ModelCopyAuthorization DeserializeModelCopyAuthorization(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -129,7 +129,7 @@ internal static CopyAuthorization DeserializeCopyAuthorization(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new CopyAuthorization( + return new ModelCopyAuthorization( targetResourceId, targetResourceRegion, targetModelId, @@ -139,43 +139,43 @@ internal static CopyAuthorization DeserializeCopyAuthorization(JsonElement eleme serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(CopyAuthorization)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ModelCopyAuthorization)} does not support writing '{options.Format}' format."); } } - CopyAuthorization IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ModelCopyAuthorization IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCopyAuthorization(document.RootElement, options); + return DeserializeModelCopyAuthorization(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(CopyAuthorization)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ModelCopyAuthorization)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static CopyAuthorization FromResponse(Response response) + internal static ModelCopyAuthorization FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeCopyAuthorization(document.RootElement); + return DeserializeModelCopyAuthorization(document.RootElement); } /// Convert into a . diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ModelCopyAuthorization.cs similarity index 81% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ModelCopyAuthorization.cs index c7b5f9134412..ea2c37eca2f6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/CopyAuthorization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/ModelCopyAuthorization.cs @@ -14,7 +14,7 @@ namespace Azure.AI.DocumentIntelligence /// Authorization to copy a document model to the specified target resource and /// modelId. /// - public partial class CopyAuthorization + public partial class ModelCopyAuthorization { /// /// Keeps track of any properties unknown to the library. @@ -48,7 +48,7 @@ public partial class CopyAuthorization /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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 @@ -57,9 +57,9 @@ public partial class CopyAuthorization /// 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. + /// Date/time when the access token expires. /// , , , or is null. - public CopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, Uri targetModelLocation, string accessToken, DateTimeOffset expirationDateTime) + public ModelCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, Uri targetModelLocation, string accessToken, DateTimeOffset expiresOn) { Argument.AssertNotNull(targetResourceId, nameof(targetResourceId)); Argument.AssertNotNull(targetResourceRegion, nameof(targetResourceRegion)); @@ -72,10 +72,10 @@ public CopyAuthorization(string targetResourceId, string targetResourceRegion, s TargetModelId = targetModelId; TargetModelLocation = targetModelLocation; AccessToken = accessToken; - ExpirationDateTime = expirationDateTime; + ExpiresOn = expiresOn; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// 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 @@ -84,21 +84,21 @@ public CopyAuthorization(string targetResourceId, string targetResourceRegion, s /// 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. + /// Date/time when the access token expires. /// Keeps track of any properties unknown to the library. - internal CopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, Uri targetModelLocation, string accessToken, DateTimeOffset expirationDateTime, IDictionary serializedAdditionalRawData) + internal ModelCopyAuthorization(string targetResourceId, string targetResourceRegion, string targetModelId, Uri targetModelLocation, string accessToken, DateTimeOffset expiresOn, IDictionary serializedAdditionalRawData) { TargetResourceId = targetResourceId; TargetResourceRegion = targetResourceRegion; TargetModelId = targetModelId; TargetModelLocation = targetModelLocation; AccessToken = accessToken; - ExpirationDateTime = expirationDateTime; + ExpiresOn = expiresOn; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal CopyAuthorization() + /// Initializes a new instance of for deserialization. + internal ModelCopyAuthorization() { } @@ -116,6 +116,6 @@ internal CopyAuthorization() /// Token used to authorize the request. public string AccessToken { get; set; } /// Date/time when the access token expires. - public DateTimeOffset ExpirationDateTime { get; set; } + public DateTimeOffset ExpiresOn { get; set; } } } 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 a2ca0287b6df..000000000000 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/OperationStatus.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.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 CompletedValue = "completed"; - 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 completed. - public static OperationStatus Completed { get; } = new OperationStatus(CompletedValue); - /// 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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 index 58d2d107b5fb..e045b39023fb 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/StringIndexType.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/StringIndexType.cs @@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence { /// Method used to compute string offset and length. - public readonly partial struct StringIndexType : IEquatable + internal readonly partial struct StringIndexType : IEquatable { private readonly string _value; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.Serialization.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownDocumentIntelligenceOperationDetails.Serialization.cs similarity index 70% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.Serialization.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownDocumentIntelligenceOperationDetails.Serialization.cs index da3c043170c0..e101f995d6b0 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.Serialization.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownDocumentIntelligenceOperationDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.DocumentIntelligence { - internal partial class UnknownOperationDetails : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownDocumentIntelligenceOperationDetails : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OperationDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - OperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DocumentIntelligenceOperationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(OperationDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOperationDetails(document.RootElement, options); + return DeserializeDocumentIntelligenceOperationDetails(document.RootElement, options); } - internal static UnknownOperationDetails DeserializeUnknownOperationDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownDocumentIntelligenceOperationDetails DeserializeUnknownDocumentIntelligenceOperationDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -58,7 +58,7 @@ internal static UnknownOperationDetails DeserializeUnknownOperationDetails(JsonE return null; } string operationId = default; - OperationStatus status = default; + DocumentIntelligenceOperationStatus status = default; int? percentCompleted = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; @@ -78,7 +78,7 @@ internal static UnknownOperationDetails DeserializeUnknownOperationDetails(JsonE } if (property.NameEquals("status"u8)) { - status = new OperationStatus(property.Value.GetString()); + status = new DocumentIntelligenceOperationStatus(property.Value.GetString()); continue; } if (property.NameEquals("percentCompleted"u8)) @@ -144,7 +144,7 @@ internal static UnknownOperationDetails DeserializeUnknownOperationDetails(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownOperationDetails( + return new UnknownDocumentIntelligenceOperationDetails( operationId, status, percentCompleted, @@ -158,50 +158,50 @@ internal static UnknownOperationDetails DeserializeUnknownOperationDetails(JsonE serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(OperationDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support writing '{options.Format}' format."); } } - OperationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DocumentIntelligenceOperationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeOperationDetails(document.RootElement, options); + return DeserializeDocumentIntelligenceOperationDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(OperationDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DocumentIntelligenceOperationDetails)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new UnknownOperationDetails FromResponse(Response response) + internal static new UnknownDocumentIntelligenceOperationDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownOperationDetails(document.RootElement); + return DeserializeUnknownDocumentIntelligenceOperationDetails(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownDocumentIntelligenceOperationDetails.cs similarity index 59% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownDocumentIntelligenceOperationDetails.cs index c97ca3544a51..281ed03f5b8e 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownOperationDetails.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/UnknownDocumentIntelligenceOperationDetails.cs @@ -10,10 +10,10 @@ namespace Azure.AI.DocumentIntelligence { - /// Unknown version of OperationDetails. - internal partial class UnknownOperationDetails : OperationDetails + /// Unknown version of DocumentIntelligenceOperationDetails. + internal partial class UnknownDocumentIntelligenceOperationDetails : DocumentIntelligenceOperationDetails { - /// Initializes a new instance of . + /// Initializes a new instance of . /// Operation ID. /// Operation status. notStarted, running, completed, or failed. /// Operation progress (0-100). @@ -25,12 +25,12 @@ internal partial class UnknownOperationDetails : OperationDetails /// List of key-value tag attributes associated with the document model. /// Encountered error. /// Keeps track of any properties unknown to the library. - internal UnknownOperationDetails(string operationId, OperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) + internal UnknownDocumentIntelligenceOperationDetails(string operationId, DocumentIntelligenceOperationStatus status, int? percentCompleted, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, OperationKind kind, Uri resourceLocation, string apiVersion, IReadOnlyDictionary tags, DocumentIntelligenceError error, IDictionary serializedAdditionalRawData) : base(operationId, status, percentCompleted, createdOn, lastUpdatedOn, kind, resourceLocation, apiVersion, tags, error, serializedAdditionalRawData) { } - /// Initializes a new instance of for deserialization. - internal UnknownOperationDetails() + /// Initializes a new instance of for deserialization. + internal UnknownDocumentIntelligenceOperationDetails() { } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/InternalTypes.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/InternalTypes.cs new file mode 100644 index 000000000000..02fcb3d0a9ba --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/InternalTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma warning disable SA1402 // File may only contain a single type + +namespace Azure.AI.DocumentIntelligence +{ + internal readonly partial struct StringIndexType { } +} + +#pragma warning restore SA1402 // File may only contain a single type diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/PublicTypes.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/PublicTypes.cs index 9ad0a5cca34b..80cb6a8933ba 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/PublicTypes.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GeneratorStubs/PublicTypes.cs @@ -7,11 +7,20 @@ namespace Azure.AI.DocumentIntelligence { - [CodeGenModel("AzureAIDocumentIntelligenceClientOptions")] - public partial class DocumentIntelligenceClientOptions { } + public partial class AnalyzeBatchOperationDetails + { + /// Analyze batch operation result ID. + public string ResultId { get; } + } - [CodeGenModel("AIDocumentIntelligenceModelFactory")] - public partial class DocumentIntelligenceModelFactory { } + public partial class AnalyzeResult + { + internal StringIndexType StringIndexType { get; } + } + + public readonly partial struct BoundingRegion { } + + public readonly partial struct DocumentSpan { } } namespace Microsoft.Extensions.Azure diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GlobalSuppressions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..73225a600140 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/GlobalSuppressions.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.AnalyzeBatchDocumentsOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.AnalyzeDocumentOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.AuthorizeClassifierCopyOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.AuthorizeModelCopyOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.BuildClassifierOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.BuildDocumentModelOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.ClassifyDocumentOptions")] +[assembly: SuppressMessage("Naming", "AZC0030:Improper model name suffix", Justification = "Name approved by .NET architects.", Scope = "type", Target = "~T:Azure.AI.DocumentIntelligence.ComposeModelOptions")] diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/ClientExtensions.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/ClientExtensions.cs new file mode 100644 index 000000000000..acbc93319cce --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/ClientExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; + +namespace Azure.AI.DocumentIntelligence.Samples +{ + // CUSTOM CODE NOTE: after we made the 'options' property bag required in some client methods, + // some of the autogenerated samples started presenting build errors since they're generated + // based on the original method signatures. These client extensions were added for the sole + // purpose of silencing these errors. + + internal static class ClientExtensions + { + public static Task> AnalyzeDocumentAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeDocumentOptions options) + { + return null; + } + + public static Operation AnalyzeDocument(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeDocumentOptions options) + { + return null; + } + + public static Task> AnalyzeBatchDocumentsAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeBatchDocumentsOptions options) + { + return null; + } + + public static Operation AnalyzeBatchDocuments(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeBatchDocumentsOptions options) + { + return null; + } + + public static Task> ClassifyDocumentAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string classifierId, ClassifyDocumentOptions options) + { + return null; + } + + public static Operation ClassifyDocument(this DocumentIntelligenceClient client, WaitUntil waitUntil, string classifierId, ClassifyDocumentOptions options) + { + return null; + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs index 4ae2f043e320..f32c493d87f7 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentAssert.cs @@ -9,7 +9,33 @@ namespace Azure.AI.DocumentIntelligence.Tests { internal static class DocumentAssert { - public static void AreEqual(AzureBlobContentSource expected, AzureBlobContentSource actual) + public static void AreEqual(AnalyzeBatchResult expected, AnalyzeBatchResult actual) + { + if (expected == null) + { + Assert.That(actual, Is.Null); + return; + } + + Assert.That(actual, Is.Not.Null); + + Assert.That(actual.SucceededCount, Is.EqualTo(expected.SucceededCount)); + Assert.That(actual.FailedCount, Is.EqualTo(expected.FailedCount)); + Assert.That(actual.SkippedCount, Is.EqualTo(expected.SkippedCount)); + + AreEquivalent(expected.Details, actual.Details); + } + + public static void AreEqual(AnalyzeBatchResultDetails expected, AnalyzeBatchResultDetails actual) + { + Assert.That(actual.SourceUri.AbsoluteUri, Is.EqualTo(expected.SourceUri.AbsoluteUri)); + Assert.That(actual.ResultUri.AbsoluteUri, Is.EqualTo(expected.ResultUri.AbsoluteUri)); + Assert.That(actual.Status, Is.EqualTo(expected.Status)); + + AreEqual(expected.Error, actual.Error); + } + + public static void AreEqual(BlobContentSource expected, BlobContentSource actual) { if (expected == null) { @@ -21,14 +47,14 @@ public static void AreEqual(AzureBlobContentSource expected, AzureBlobContentSou // 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); + string expectedContainerUrl = expected.ContainerUri.GetLeftPart(UriPartial.Path); + string containerUrl = actual.ContainerUri.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) + public static void AreEqual(BlobFileListContentSource expected, BlobFileListContentSource actual) { if (expected == null) { @@ -40,8 +66,8 @@ public static void AreEqual(AzureBlobFileListContentSource expected, AzureBlobFi // 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); + string expectedContainerUrl = expected.ContainerUri.GetLeftPart(UriPartial.Path); + string containerUrl = actual.ContainerUri.GetLeftPart(UriPartial.Path); Assert.That(containerUrl, Is.EqualTo(expectedContainerUrl)); Assert.That(actual.FileList, Is.EqualTo(expected.FileList)); @@ -56,7 +82,7 @@ public static void AreEqual(DocumentClassifierDetails expected, DocumentClassifi Assert.AreEqual(expected.CreatedOn, actual.CreatedOn); Assert.AreEqual(expected.ExpiresOn, actual.ExpiresOn); - AreEquivalent(expected.DocTypes, actual.DocTypes); + AreEquivalent(expected.DocumentTypes, actual.DocumentTypes); } public static void AreEqual(DocumentFieldSchema expected, DocumentFieldSchema actual) @@ -69,7 +95,7 @@ public static void AreEqual(DocumentFieldSchema expected, DocumentFieldSchema ac Assert.That(actual, Is.Not.Null); - Assert.That(actual.Type, Is.EqualTo(expected.Type)); + Assert.That(actual.FieldType, Is.EqualTo(expected.FieldType)); Assert.That(actual.Description, Is.EqualTo(expected.Description)); Assert.That(actual.Example, Is.EqualTo(expected.Example)); @@ -77,6 +103,40 @@ public static void AreEqual(DocumentFieldSchema expected, DocumentFieldSchema ac AreEquivalent(expected.Properties, actual.Properties); } + public static void AreEqual(DocumentIntelligenceError expected, DocumentIntelligenceError actual) + { + if (expected == null) + { + Assert.That(actual, Is.Null); + return; + } + + Assert.That(actual, Is.Not.Null); + + Assert.That(actual.Code, Is.EqualTo(expected.Code)); + Assert.That(actual.Message, Is.EqualTo(expected.Message)); + Assert.That(actual.Target, Is.EqualTo(expected.Target)); + + AreEquivalent(expected.Details, actual.Details); + AreEqual(expected.InnerError, actual.InnerError); + } + + public static void AreEqual(DocumentIntelligenceInnerError expected, DocumentIntelligenceInnerError actual) + { + if (expected == null) + { + Assert.That(actual, Is.Null); + return; + } + + Assert.That(actual, Is.Not.Null); + + Assert.That(actual.Code, Is.EqualTo(expected.Code)); + Assert.That(actual.Message, Is.EqualTo(expected.Message)); + + AreEqual(expected.InnerError, actual.InnerError); + } + public static void AreEqual(DocumentModelDetails expected, DocumentModelDetails actual) { Assert.That(actual.ModelId, Is.EqualTo(expected.ModelId)); @@ -86,10 +146,10 @@ public static void AreEqual(DocumentModelDetails expected, DocumentModelDetails Assert.That(actual.ExpiresOn, Is.EqualTo(expected.ExpiresOn)); Assert.That(actual.Tags, Is.EquivalentTo(expected.Tags)); - AreEqual(expected.AzureBlobSource, actual.AzureBlobSource); - AreEqual(expected.AzureBlobFileListSource, actual.AzureBlobFileListSource); + AreEqual(expected.BlobSource, actual.BlobSource); + AreEqual(expected.BlobFileListSource, actual.BlobFileListSource); - AreEquivalent(expected.DocTypes, actual.DocTypes); + AreEquivalent(expected.DocumentTypes, actual.DocumentTypes); } public static void AreEqual(DocumentTypeDetails expected, DocumentTypeDetails actual) @@ -101,6 +161,26 @@ public static void AreEqual(DocumentTypeDetails expected, DocumentTypeDetails ac AreEquivalent(expected.FieldSchema, actual.FieldSchema); } + public static void AreEquivalent(IReadOnlyList expected, IReadOnlyList actual) + { + Assert.That(actual.Count, Is.EqualTo(expected.Count)); + + for (int i = 0; i < actual.Count; i++) + { + AreEqual(expected[i], actual[i]); + } + } + + public static void AreEquivalent(IReadOnlyList expected, IReadOnlyList actual) + { + Assert.That(actual.Count, Is.EqualTo(expected.Count)); + + for (int i = 0; i < actual.Count; i++) + { + AreEqual(expected[i], actual[i]); + } + } + public static void AreEquivalent(IReadOnlyDictionary expected, IReadOnlyDictionary actual) { Assert.That(actual.Count, Is.EqualTo(expected.Count)); @@ -115,8 +195,8 @@ public static void AreEquivalent(IReadOnlyDictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; - var content = new BuildDocumentClassifierContent(classifierId, docTypes) + var options = new BuildClassifierOptions(classifierId, docTypes) { Description = description }; @@ -47,7 +47,7 @@ public async Task BuildClassifierWithAzureBlobContentSource() try { - operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); + operation = await client.BuildClassifierAsync(WaitUntil.Completed, options); } finally { @@ -69,16 +69,16 @@ public async Task BuildClassifierWithAzureBlobContentSource() Assert.That(classifier.CreatedOn, Is.GreaterThan(startTime)); Assert.That(classifier.ExpiresOn, Is.GreaterThan(classifier.CreatedOn)); - DocumentAssert.AreEquivalent(docTypes, classifier.DocTypes); + DocumentAssert.AreEquivalent(docTypes, classifier.DocumentTypes); - foreach (var docType in classifier.DocTypes.Values) + foreach (var docType in classifier.DocumentTypes.Values) { Assert.That(docType.SourceKind, Is.Null); } } [RecordedTest] - public async Task BuildClassifierWithAzureBlobFileListContentSource() + public async Task BuildClassifierWithBlobFileListContentSource() { var client = CreateDocumentIntelligenceAdministrationClient(); var classifierId = Recording.GenerateId(); @@ -86,17 +86,17 @@ public async Task BuildClassifierWithAzureBlobFileListContentSource() 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 sourceA = new BlobFileListContentSource(containerUrl, "IRS-1040-A.jsonl"); + var sourceB = new BlobFileListContentSource(containerUrl, "IRS-1040-B.jsonl"); + var docTypeA = new ClassifierDocumentTypeDetails(sourceA); + var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; - var content = new BuildDocumentClassifierContent(classifierId, docTypes) + var options = new BuildClassifierOptions(classifierId, docTypes) { Description = description }; @@ -105,7 +105,7 @@ public async Task BuildClassifierWithAzureBlobFileListContentSource() try { - operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); + operation = await client.BuildClassifierAsync(WaitUntil.Completed, options); } finally { @@ -127,9 +127,9 @@ public async Task BuildClassifierWithAzureBlobFileListContentSource() Assert.That(classifier.CreatedOn, Is.GreaterThan(startTime)); Assert.That(classifier.ExpiresOn, Is.GreaterThan(classifier.CreatedOn)); - DocumentAssert.AreEquivalent(docTypes, classifier.DocTypes); + DocumentAssert.AreEquivalent(docTypes, classifier.DocumentTypes); - foreach (var docType in classifier.DocTypes.Values) + foreach (var docType in classifier.DocumentTypes.Values) { Assert.That(docType.SourceKind, Is.Null); } @@ -150,17 +150,17 @@ public async Task CopyClassifierTo() await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(description); - var authorizeCopyContent = new AuthorizeClassifierCopyContent(classifierId) + var authorizeCopyOptions = new AuthorizeClassifierCopyOptions(classifierId) { Description = description }; foreach (var tag in tags) { - authorizeCopyContent.Tags.Add(tag); + authorizeCopyOptions.Tags.Add(tag); } - ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(authorizeCopyContent); + ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(authorizeCopyOptions); Operation operation = null; @@ -191,9 +191,9 @@ public async Task CopyClassifierTo() Assert.That(classifier.CreatedOn, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); Assert.That(classifier.ExpiresOn, Is.GreaterThan(classifier.CreatedOn)); - DocumentAssert.AreEquivalent(sourceClassifier.DocTypes, classifier.DocTypes); + DocumentAssert.AreEquivalent(sourceClassifier.DocumentTypes, classifier.DocumentTypes); - foreach (var docType in classifier.DocTypes.Values) + foreach (var docType in classifier.DocumentTypes.Values) { Assert.That(docType.SourceKind, Is.Null); } @@ -307,9 +307,9 @@ public async Task AuthorizeClassifierCopy() { var client = CreateDocumentIntelligenceAdministrationClient(); var classifierId = Recording.GenerateId(); - var content = new AuthorizeClassifierCopyContent(classifierId); + var options = new AuthorizeClassifierCopyOptions(classifierId); - ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(content); + ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(options); Assert.That(copyAuthorization.TargetClassifierId, Is.EqualTo(classifierId)); Assert.That(copyAuthorization.TargetClassifierLocation.AbsoluteUri, Does.StartWith(TestEnvironment.Endpoint)); @@ -317,7 +317,7 @@ public async Task AuthorizeClassifierCopy() 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)); + Assert.That(copyAuthorization.ExpiresOn, Is.GreaterThan(Recording.UtcNow)); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationMockTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationMockTests.cs index 218c11127d3b..7e10ff872cb8 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationMockTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentClassifierAdministrationMockTests.cs @@ -69,7 +69,7 @@ public async Task CopyClassifierTo(bool isAsync) TargetResourceId = "resource_id", TargetResourceRegion = "resource_region", AccessToken = "token", - ExpirationDateTime = new DateTimeOffset(2024, 9, 24, 0, 0, 0, TimeSpan.Zero) + ExpiresOn = new DateTimeOffset(2024, 9, 24, 0, 0, 0, TimeSpan.Zero) }; var operation = isAsync @@ -132,14 +132,14 @@ public async Task AuthorizeClassifierCopy(bool isAsync) mockResponse.ContentStream = mockResponseBody; var mockTransport = new InterceptorMockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateNonInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateNonInstrumentedClient(clientOptions); - var content = new AuthorizeClassifierCopyContent("classifier_id"); + var options = new AuthorizeClassifierCopyOptions("classifier_id"); ClassifierCopyAuthorization copyAuthorization = isAsync - ? await client.AuthorizeClassifierCopyAsync(content) - : client.AuthorizeClassifierCopy(content); + ? await client.AuthorizeClassifierCopyAsync(options) + : client.AuthorizeClassifierCopy(options); // Validate the request. @@ -159,7 +159,7 @@ public async Task AuthorizeClassifierCopy(bool isAsync) Assert.That(copyAuthorization.TargetResourceId, Is.EqualTo("resource_id")); Assert.That(copyAuthorization.TargetResourceRegion, Is.EqualTo("resource_region")); Assert.That(copyAuthorization.AccessToken, Is.EqualTo("token")); - Assert.That(copyAuthorization.ExpirationDateTime, Is.EqualTo(expectedTime)); + Assert.That(copyAuthorization.ExpiresOn, Is.EqualTo(expectedTime)); } private DocumentIntelligenceAdministrationClient CreateNonInstrumentedClient(DocumentIntelligenceClientOptions options) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentIntelligenceAdministrationClientLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentIntelligenceAdministrationClientLiveTests.cs index 0960675610c0..288b25105f81 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentIntelligenceAdministrationClientLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentIntelligenceAdministrationClientLiveTests.cs @@ -19,7 +19,7 @@ public async Task DocumentIntelligenceAdministrationClientCanAuthenticateWithApi { var client = CreateDocumentIntelligenceAdministrationClient(useApiKey: true); - Response response = await client.GetResourceInfoAsync(); + Response response = await client.GetResourceDetailsAsync(); Response rawResponse = response.GetRawResponse(); Assert.That(rawResponse.Status, Is.EqualTo(200)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs index 893a1d907762..7ec6f4d8a105 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/DocumentModelAdministrationLiveTests.cs @@ -28,7 +28,7 @@ public DocumentModelAdministrationLiveTests(bool isAsync) [RecordedTest] [TestCaseSource(nameof(s_buildDocumentModelTestCases))] - public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode buildMode) + public async Task BuildDocumentModelWithBlobContentSource(DocumentBuildMode buildMode) { if (buildMode == DocumentBuildMode.Neural && Recording.Mode == RecordedTestMode.Live) { @@ -44,11 +44,10 @@ public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode var containerUrl = new Uri(TestEnvironment.BlobContainerSasUrl); var prefix = "subfolder"; - var source = new AzureBlobContentSource(containerUrl) { Prefix = prefix }; + var source = new BlobContentSource(containerUrl) { Prefix = prefix }; - var content = new BuildDocumentModelContent(modelId, buildMode) + var options = new BuildDocumentModelOptions(modelId, buildMode, source) { - AzureBlobSource = source, Description = description, Tags = { { "tag1", "value1" }, { "tag2", "value2" } } }; @@ -57,7 +56,7 @@ public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode try { - operation = await client.BuildDocumentModelAsync(WaitUntil.Started, content); + operation = await client.BuildDocumentModelAsync(WaitUntil.Started, options); await (buildMode == DocumentBuildMode.Neural ? operation.WaitForCompletionAsync(TimeSpan.FromMinutes(1), CancellationToken.None) @@ -83,15 +82,15 @@ public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode // Add a 4-hour tolerance because the model could have been cached before this test. Assert.That(model.CreatedOn, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); Assert.That(model.ExpiresOn, Is.GreaterThan(model.CreatedOn)); - Assert.That(model.Tags, Is.EquivalentTo(content.Tags)); + Assert.That(model.Tags, Is.EquivalentTo(options.Tags)); - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); + Assert.That(model.BlobSource, Is.Null); + Assert.That(model.BlobFileListSource, Is.Null); - Assert.That(model.DocTypes.Count, Is.EqualTo(1)); - Assert.That(model.DocTypes.ContainsKey(modelId)); + Assert.That(model.DocumentTypes.Count, Is.EqualTo(1)); + Assert.That(model.DocumentTypes.ContainsKey(modelId)); - DocumentTypeDetails docType = model.DocTypes[modelId]; + DocumentTypeDetails docType = model.DocumentTypes[modelId]; Assert.That(docType.Description, Is.Null); Assert.That(docType.BuildMode, Is.EqualTo(buildMode)); @@ -122,8 +121,8 @@ public async Task BuildDocumentModelWithAzureBlobContentSource(DocumentBuildMode 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.Double)); + Assert.That(merchantSchema.FieldType, Is.EqualTo(DocumentFieldType.String)); + Assert.That(quantitySchema.FieldType, Is.EqualTo(DocumentFieldType.Double)); } [RecordedTest] @@ -134,14 +133,10 @@ public void BuildDocumentModelCanParseError() 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 source = new BlobContentSource(containerUrl) { Prefix = prefix }; + var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, source); - var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) - { - AzureBlobSource = source - }; - - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.BuildDocumentModelAsync(WaitUntil.Started, content)); + RequestFailedException ex = Assert.ThrowsAsync(async () => await client.BuildDocumentModelAsync(WaitUntil.Started, options)); Assert.That(ex.ErrorCode, Is.EqualTo("InvalidRequest")); } @@ -161,17 +156,17 @@ public async Task CopyModelTo() await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - var authorizeCopyContent = new AuthorizeCopyContent(modelId) + var authorizeCopyOptions = new AuthorizeModelCopyOptions(modelId) { Description = description }; foreach (var tag in tags) { - authorizeCopyContent.Tags.Add(tag); + authorizeCopyOptions.Tags.Add(tag); } - CopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(authorizeCopyContent); + ModelCopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(authorizeCopyOptions); Operation operation = null; @@ -202,8 +197,8 @@ public async Task CopyModelTo() Assert.That(model.ExpiresOn, Is.GreaterThan(model.CreatedOn)); Assert.That(model.Tags, Is.EquivalentTo(tags)); - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); + Assert.That(model.BlobSource, Is.Null); + Assert.That(model.BlobFileListSource, 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); @@ -232,7 +227,7 @@ public async Task ComposeModel() { "model1", new DocumentTypeDetails() { ModelId = disposableModel1.ModelId } } }; - var content = new ComposeDocumentModelContent(modelId, disposableClassifier.ClassifierId, docTypes) + var options = new ComposeModelOptions(modelId, disposableClassifier.ClassifierId, docTypes) { Description = description, Tags = { { "tag1", "value1" }, { "tag2", "value2" } } @@ -242,7 +237,7 @@ public async Task ComposeModel() try { - operation = await client.ComposeModelAsync(WaitUntil.Completed, content); + operation = await client.ComposeModelAsync(WaitUntil.Completed, options); } finally { @@ -266,17 +261,17 @@ public async Task ComposeModel() // Add a 4-hour tolerance because the model could have been cached before this test. Assert.That(model.CreatedOn, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); Assert.That(model.ExpiresOn, Is.GreaterThan(model.CreatedOn)); - Assert.That(model.Tags, Is.EquivalentTo(content.Tags)); + Assert.That(model.Tags, Is.EquivalentTo(options.Tags)); - Assert.That(model.AzureBlobSource, Is.Null); - Assert.That(model.AzureBlobFileListSource, Is.Null); + Assert.That(model.BlobSource, Is.Null); + Assert.That(model.BlobFileListSource, Is.Null); - Assert.That(model.DocTypes.Count, Is.EqualTo(2)); + Assert.That(model.DocumentTypes.Count, Is.EqualTo(2)); - DocumentTypeDetails expectedDocType0 = componentModel0.DocTypes[componentModel0.ModelId]; - DocumentTypeDetails expectedDocType1 = componentModel1.DocTypes[componentModel1.ModelId]; - DocumentTypeDetails docType0 = model.DocTypes["model0"]; - DocumentTypeDetails docType1 = model.DocTypes["model1"]; + DocumentTypeDetails expectedDocType0 = componentModel0.DocumentTypes[componentModel0.ModelId]; + DocumentTypeDetails expectedDocType1 = componentModel1.DocumentTypes[componentModel1.ModelId]; + DocumentTypeDetails docType0 = model.DocumentTypes["model0"]; + DocumentTypeDetails docType1 = model.DocumentTypes["model1"]; DocumentAssert.AreEqual(expectedDocType0, docType0); DocumentAssert.AreEqual(expectedDocType1, docType1); @@ -294,9 +289,9 @@ public void ComposeModelCanParseError() { "model1", new DocumentTypeDetails() { ModelId = "00000000-0000-0000-0000-000000000001" } } }; - var content = new ComposeDocumentModelContent(modelId, classifierId: "00000000-0000-0000-0000-000000000002", docTypes); + var options = new ComposeModelOptions(modelId, classifierId: "00000000-0000-0000-0000-000000000002", docTypes); - RequestFailedException ex = Assert.ThrowsAsync(async () => await client.ComposeModelAsync(WaitUntil.Started, content)); + RequestFailedException ex = Assert.ThrowsAsync(async () => await client.ComposeModelAsync(WaitUntil.Started, options)); Assert.That(ex.ErrorCode, Is.EqualTo("InvalidRequest")); } @@ -382,9 +377,9 @@ public async Task GetModels() Assert.That(model.ExpiresOn, Is.EqualTo(expected.ExpiresOn)); 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); + Assert.That(model.BlobSource, Is.Null); + Assert.That(model.BlobFileListSource, Is.Null); + Assert.That(model.DocumentTypes, Is.Empty); } } @@ -422,9 +417,9 @@ public async Task AuthorizeModelCopy() { var client = CreateDocumentIntelligenceAdministrationClient(); var modelId = Recording.GenerateId(); - var content = new AuthorizeCopyContent(modelId); + var options = new AuthorizeModelCopyOptions(modelId); - CopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(content); + ModelCopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(options); Assert.That(copyAuthorization.TargetModelId, Is.EqualTo(modelId)); Assert.That(copyAuthorization.TargetModelLocation.AbsoluteUri, Does.StartWith(TestEnvironment.Endpoint)); @@ -432,7 +427,7 @@ public async Task AuthorizeModelCopy() 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)); + Assert.That(copyAuthorization.ExpiresOn, Is.GreaterThan(Recording.UtcNow)); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/MiscellaneousOperationsLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/MiscellaneousOperationsLiveTests.cs index 1d09b37da872..1b8040920f35 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/MiscellaneousOperationsLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/MiscellaneousOperationsLiveTests.cs @@ -16,10 +16,10 @@ public MiscellaneousOperationsLiveTests(bool isAsync) { } - #region Resource Info + #region Resource Details [RecordedTest] - public async Task GetResourceInfo() + public async Task GetResourceDetails() { var client = CreateDocumentIntelligenceAdministrationClient(); var startTime = Recording.UtcNow; @@ -27,7 +27,7 @@ public async Task GetResourceInfo() // 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(); + DocumentIntelligenceResourceDetails resourceDetails = await client.GetResourceDetailsAsync(); Assert.That(resourceDetails.CustomDocumentModels, Is.Not.Null); Assert.That(resourceDetails.CustomDocumentModels.Count, Is.GreaterThan(0)); @@ -48,7 +48,7 @@ public async Task GetOperationWithDocumentModelBuild() await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - OperationDetails operationDetails = await client.GetOperationAsync(disposableModel.Operation.Id); + DocumentIntelligenceOperationDetails operationDetails = await client.GetOperationAsync(disposableModel.Operation.Id); // The endpoint environment variable may or may not contain a trailing '/' character. Trim the string // to ensure the behavior is consistent. @@ -75,7 +75,7 @@ public async Task GetOperationWithDocumentClassifierBuild() await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(description); - OperationDetails operationDetails = await client.GetOperationAsync(disposableClassifier.Operation.Id); + DocumentIntelligenceOperationDetails operationDetails = await client.GetOperationAsync(disposableClassifier.Operation.Id); // The endpoint environment variable may or may not contain a trailing '/' character. Trim the string // to ensure the behavior is consistent. @@ -118,17 +118,17 @@ public async Task GetOperations() await using var disposableModel0 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); await using var disposableModel1 = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl, description, tags); - OperationDetails expectedOperation0 = await client.GetOperationAsync(disposableModel0.Operation.Id); - OperationDetails expectedOperation1 = await client.GetOperationAsync(disposableModel1.Operation.Id); + DocumentIntelligenceOperationDetails expectedOperation0 = await client.GetOperationAsync(disposableModel0.Operation.Id); + DocumentIntelligenceOperationDetails expectedOperation1 = await client.GetOperationAsync(disposableModel1.Operation.Id); - var expectedIdMapping = new Dictionary() + var expectedIdMapping = new Dictionary() { { disposableModel0.Operation.Id, expectedOperation0 }, { disposableModel1.Operation.Id, expectedOperation1 } }; - var idMapping = new Dictionary(); + var idMapping = new Dictionary(); - await foreach (OperationDetails operation in client.GetOperationsAsync()) + await foreach (DocumentIntelligenceOperationDetails operation in client.GetOperationsAsync()) { if (expectedIdMapping.ContainsKey(operation.OperationId)) { @@ -147,8 +147,8 @@ public async Task GetOperations() { Assert.That(idMapping, Contains.Key(id)); - OperationDetails expected = expectedIdMapping[id]; - OperationDetails operation = idMapping[id]; + DocumentIntelligenceOperationDetails expected = expectedIdMapping[id]; + DocumentIntelligenceOperationDetails operation = idMapping[id]; Assert.That(operation.OperationId, Is.EqualTo(expected.OperationId)); Assert.That(operation.ApiVersion, Is.EqualTo(expected.ApiVersion)); @@ -165,11 +165,11 @@ public async Task GetOperations() #endregion List Operations - private void ValidateOperationDetails(OperationDetails operationDetails, string operationId, string resourceLocation, DateTimeOffset startTime, IDictionary tags) + private void ValidateOperationDetails(DocumentIntelligenceOperationDetails operationDetails, string operationId, string resourceLocation, DateTimeOffset startTime, IDictionary tags) { Assert.That(operationDetails.OperationId, Is.EqualTo(operationId)); Assert.That(operationDetails.ApiVersion, Is.EqualTo(ServiceVersionString)); - Assert.That(operationDetails.Status, Is.EqualTo(OperationStatus.Succeeded)); + Assert.That(operationDetails.Status, Is.EqualTo(DocumentIntelligenceOperationStatus.Succeeded)); Assert.That(operationDetails.PercentCompleted, Is.EqualTo(100)); Assert.That(operationDetails.ResourceLocation.AbsoluteUri, Is.EqualTo(resourceLocation)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentBatchLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentBatchLiveTests.cs new file mode 100644 index 000000000000..d15181cc2087 --- /dev/null +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentBatchLiveTests.cs @@ -0,0 +1,177 @@ +// 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 +{ + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/47557")] + public class DocumentBatchLiveTests : DocumentIntelligenceLiveTestBase + { + public DocumentBatchLiveTests(bool isAsync) + : base(isAsync) + { + } + + [RecordedTest] + public async Task AnalyzeBatchDocuments() + { + var client = CreateDocumentIntelligenceClient(); + var sourceContainerUri = new Uri(TestEnvironment.BatchSourceBlobSasUrl); + var resultContainerUri = new Uri(TestEnvironment.BatchResultBlobSasUrl); + var blobSource = new BlobContentSource(sourceContainerUri); + var options = new AnalyzeBatchDocumentsOptions("prebuilt-read", blobSource, resultContainerUri) + { + OverwriteExisting = true + }; + + var operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, options); + + Assert.That(operation.HasCompleted); + Assert.That(operation.HasValue); + + ValidateAcordAnalyzeBatchResult(operation.Value); + } + + [RecordedTest] + public async Task GetAnalyzeBatchResult() + { + var client = CreateDocumentIntelligenceClient(); + var sourceContainerUri = new Uri(TestEnvironment.BatchSourceBlobSasUrl); + var resultContainerUri = new Uri(TestEnvironment.BatchResultBlobSasUrl); + var blobSource = new BlobContentSource(sourceContainerUri); + var options = new AnalyzeBatchDocumentsOptions("prebuilt-read", blobSource, resultContainerUri) + { + OverwriteExisting = true + }; + var startTime = Recording.UtcNow; + + var operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, options); + var getResponse = await client.GetAnalyzeBatchResultAsync("prebuilt-read", operation.Id); + var operationDetails = getResponse.Value; + + Assert.That(operationDetails.ResultId, Is.EqualTo(operation.Id)); + Assert.That(operationDetails.Status, Is.EqualTo(DocumentIntelligenceOperationStatus.Succeeded)); + Assert.That(operationDetails.CreatedOn, Is.GreaterThan(startTime - TimeSpan.FromHours(4))); + Assert.That(operationDetails.LastUpdatedOn, Is.GreaterThanOrEqualTo(operationDetails.CreatedOn)); + Assert.That(operationDetails.PercentCompleted, Is.EqualTo(100)); + Assert.That(operationDetails.Error, Is.Null); + + DocumentAssert.AreEqual(operation.Value, operationDetails.Result); + } + + [RecordedTest] + public async Task GetAnalyzeBatchResults() + { + var client = CreateDocumentIntelligenceClient(); + var sourceContainerUri = new Uri(TestEnvironment.BatchSourceBlobSasUrl); + var resultContainerUri = new Uri(TestEnvironment.BatchResultBlobSasUrl); + var blobSource = new BlobContentSource(sourceContainerUri); + var options = new AnalyzeBatchDocumentsOptions("prebuilt-read", blobSource, resultContainerUri) + { + OverwriteExisting = true + }; + + var operation0 = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, options); + var operation1 = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, options); + var getResponse0 = await client.GetAnalyzeBatchResultAsync("prebuilt-read", operation0.Id); + var getResponse1 = await client.GetAnalyzeBatchResultAsync("prebuilt-read", operation1.Id); + + var expectedIdMapping = new Dictionary() + { + { operation0.Id, getResponse0.Value }, + { operation1.Id, getResponse1.Value } + }; + var idMapping = new Dictionary(); + + await foreach (AnalyzeBatchOperationDetails operation in client.GetAnalyzeBatchResultsAsync("prebuilt-read")) + { + if (expectedIdMapping.ContainsKey(operation.ResultId)) + { + idMapping.Add(operation.ResultId, operation); + } + + 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)); + + AnalyzeBatchOperationDetails expected = expectedIdMapping[id]; + AnalyzeBatchOperationDetails actual = idMapping[id]; + + Assert.That(actual.ResultId, Is.EqualTo(expected.ResultId)); + Assert.That(actual.Status, Is.EqualTo(expected.Status)); + Assert.That(actual.CreatedOn, Is.EqualTo(expected.CreatedOn)); + Assert.That(actual.LastUpdatedOn, Is.EqualTo(expected.LastUpdatedOn)); + Assert.That(actual.PercentCompleted, Is.Null); + + DocumentAssert.AreEqual(actual.Error, expected.Error); + } + } + + [RecordedTest] + public async Task DeleteAnalyzeBatchResult() + { + var client = CreateDocumentIntelligenceClient(); + var sourceContainerUri = new Uri(TestEnvironment.BatchSourceBlobSasUrl); + var resultContainerUri = new Uri(TestEnvironment.BatchResultBlobSasUrl); + var blobSource = new BlobContentSource(sourceContainerUri); + var options = new AnalyzeBatchDocumentsOptions("prebuilt-read", blobSource, resultContainerUri) + { + OverwriteExisting = true + }; + + var operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, options); + var response = await client.DeleteAnalyzeBatchResultAsync("prebuilt-read", operation.Id); + + Assert.That(response.Status, Is.EqualTo((int)HttpStatusCode.NoContent)); + } + + private void ValidateAcordAnalyzeBatchResult(AnalyzeBatchResult result) + { + Assert.That(result.SucceededCount, Is.EqualTo(6)); + Assert.That(result.FailedCount, Is.EqualTo(0)); + Assert.That(result.SkippedCount, Is.EqualTo(0)); + + string expectedSourcePrefix = string.Empty; + string expectedResultPrefix = string.Empty; + + // We can't validate this in Playback mode since these environment variables + // are not stored when recording. + + if (Mode == RecordedTestMode.Live) + { + int sourceQueryStart = TestEnvironment.BatchSourceBlobSasUrl.IndexOf('?'); + int resultQueryStart = TestEnvironment.BatchResultBlobSasUrl.IndexOf('?'); + + expectedSourcePrefix = (sourceQueryStart == -1) + ? TestEnvironment.BatchSourceBlobSasUrl + : TestEnvironment.BatchSourceBlobSasUrl.Substring(0, sourceQueryStart); + + expectedResultPrefix = (resultQueryStart == -1) + ? TestEnvironment.BatchResultBlobSasUrl + : TestEnvironment.BatchResultBlobSasUrl.Substring(0, resultQueryStart); + } + + foreach (var details in result.Details) + { + Assert.That(details.SourceUri.AbsoluteUri, Does.StartWith(expectedSourcePrefix)); + Assert.That(details.ResultUri.AbsoluteUri, Does.StartWith(expectedResultPrefix)); + Assert.That(details.Status, Is.EqualTo(DocumentIntelligenceOperationStatus.Succeeded)); + Assert.That(details.Error, Is.Null); + } + } + } +} diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierLiveTests.cs index 0aec82972a5b..2420550e75d0 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierLiveTests.cs @@ -1,7 +1,6 @@ // 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; @@ -17,18 +16,15 @@ public DocumentClassifierLiveTests(bool isAsync) } [RecordedTest] - public async Task ClassifyDocumentWithUrlSource() + public async Task ClassifyDocumentWithUriSource() { var client = CreateDocumentIntelligenceClient(); await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - var content = new ClassifyDocumentContent() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Irs1040) - }; - - var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, disposableClassifier.ClassifierId, content); + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Irs1040); + var options = new ClassifyDocumentOptions(disposableClassifier.ClassifierId, uriSource); + var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); Assert.That(operation.HasCompleted); Assert.That(operation.HasValue); @@ -37,18 +33,15 @@ public async Task ClassifyDocumentWithUrlSource() } [RecordedTest] - public async Task ClassifyDocumentWithBase64Source() + public async Task ClassifyDocumentWithBytesSource() { var client = CreateDocumentIntelligenceClient(); await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - var content = new ClassifyDocumentContent() - { - Base64Source = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.Irs1040) - }; - - var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, disposableClassifier.ClassifierId, content); + var bytesSource = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.Irs1040); + var options = new ClassifyDocumentOptions(disposableClassifier.ClassifierId, bytesSource); + var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); Assert.That(operation.HasCompleted); Assert.That(operation.HasValue); @@ -64,12 +57,9 @@ public async Task ClassifyDocumentCanParseBlankPage() await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - var content = new ClassifyDocumentContent() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank) - }; - - var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, disposableClassifier.ClassifierId, content); + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank); + var options = new ClassifyDocumentOptions(disposableClassifier.ClassifierId, uriSource); + var operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); Assert.That(operation.HasCompleted); Assert.That(operation.HasValue); @@ -81,10 +71,10 @@ private void ValidateGenericClassifierResult(AnalyzeResult analyzeResult, string { 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.ContentFormat, Is.Not.EqualTo(default(DocumentContentFormat))); - Assert.That(analyzeResult.Content, Is.Empty); + // TODO: https://github.com/Azure/azure-sdk-for-net/issues/47482 + //Assert.That(analyzeResult.Content, Is.Empty); Assert.That(analyzeResult.Paragraphs, Is.Empty); Assert.That(analyzeResult.Tables, Is.Empty); Assert.That(analyzeResult.Figures, Is.Empty); @@ -114,8 +104,8 @@ private void ValidateGenericClassifierResult(AnalyzeResult analyzeResult, string foreach (var document in analyzeResult.Documents) { - Assert.That(document.DocType, Is.Not.Null); - Assert.That(document.DocType, Is.Not.Empty); + Assert.That(document.DocumentType, Is.Not.Null); + Assert.That(document.DocumentType, Is.Not.Empty); Assert.That(document.Fields, Is.Empty); Assert.That(document.Spans, Is.Empty); @@ -134,7 +124,7 @@ private void ValidateIrs1040ClassifierResult(AnalyzeResult analyzeResult, string { ValidateGenericClassifierResult(analyzeResult, classifierId); - Assert.That(analyzeResult.ContentFormat, Is.EqualTo(ContentFormat.Text)); + Assert.That(analyzeResult.ContentFormat, Is.EqualTo(DocumentContentFormat.Text)); Assert.That(analyzeResult.Pages.Count, Is.EqualTo(4)); @@ -148,7 +138,7 @@ private void ValidateIrs1040ClassifierResult(AnalyzeResult analyzeResult, string var document = analyzeResult.Documents.Single(); - Assert.That(document.DocType, Is.EqualTo("IRS-1040-C")); + Assert.That(document.DocumentType, Is.EqualTo("IRS-1040-C")); Assert.That(document.BoundingRegions.Count, Is.EqualTo(4)); } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierMockTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierMockTests.cs index 17b7260c7d08..1f58eb924da1 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierMockTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentClassifierMockTests.cs @@ -28,15 +28,16 @@ public async Task ClassifyDocumentSendsSplit(string expectedQuerySubstring, Spli { var mockResponse = new MockResponse(202); var mockTransport = new MockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateInstrumentedClient(clientOptions); - var content = new ClassifyDocumentContent() + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new ClassifyDocumentOptions("classifierId", uriSource) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) + Split = split }; - await client.ClassifyDocumentAsync(WaitUntil.Started, "classifierId", content, split: split); + await client.ClassifyDocumentAsync(WaitUntil.Started, options); var requestUriQuery = mockTransport.Requests.Single().Uri.Query; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentIntelligenceClientLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentIntelligenceClientLiveTests.cs index 06e2824b41f3..839c7198e1c4 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentIntelligenceClientLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentIntelligenceClientLiveTests.cs @@ -19,12 +19,10 @@ public async Task DocumentIntelligenceClientCanAuthenticateWithApiKey() { var client = CreateDocumentIntelligenceClient(useApiKey: true); - var content = new AnalyzeDocumentContent() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank) - }; + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank); + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource); - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); Response rawResponse = operation.GetRawResponse(); Assert.That(rawResponse.Status, Is.EqualTo(200)); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelLiveTests.cs index 6c704043d1da..904166ef0f68 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelLiveTests.cs @@ -18,16 +18,14 @@ public DocumentModelLiveTests(bool isAsync) } [RecordedTest] - public async Task AnalyzeDocumentWithUrlSource() + public async Task AnalyzeDocumentWithUriSource() { var client = CreateDocumentIntelligenceClient(); - var content = new AnalyzeDocumentContent() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) - }; + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("prebuilt-receipt", uriSource); - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-receipt", content); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); Assert.That(operation.HasCompleted); Assert.That(operation.HasValue); @@ -36,16 +34,14 @@ public async Task AnalyzeDocumentWithUrlSource() } [RecordedTest] - public async Task AnalyzeDocumentWithBase64Source() + public async Task AnalyzeDocumentWithBytesSource() { var client = CreateDocumentIntelligenceClient(); - var content = new AnalyzeDocumentContent() - { - Base64Source = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.ContosoReceipt) - }; + var bytesSource = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("prebuilt-receipt", bytesSource); - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-receipt", content); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); Assert.That(operation.HasCompleted); Assert.That(operation.HasValue); @@ -58,12 +54,10 @@ public async Task AnalyzeDocumentCanParseBlankPage() { var client = CreateDocumentIntelligenceClient(); - var content = new AnalyzeDocumentContent() - { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank) - }; + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Blank); + var options = new AnalyzeDocumentOptions("prebuilt-receipt", uriSource); - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-receipt", content); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); Assert.That(operation.HasCompleted); Assert.That(operation.HasValue); @@ -99,14 +93,14 @@ public async Task GetAnalyzeResultPdf() var client = CreateDocumentIntelligenceClient(); const string ModelId = "prebuilt-read"; - var content = new AnalyzeDocumentContent() + var bytesSource = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.LayoutSample); + var options = new AnalyzeDocumentOptions(ModelId, bytesSource) { - Base64Source = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.LayoutSample) + Output = { AnalyzeOutputOption.Pdf } }; - var output = new[] { AnalyzeOutputOption.Pdf }; - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, ModelId, content, output: output); - var response = await client.GetAnalyzeResultPdfAsync(ModelId, Guid.Parse(operation.Id)); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); + var response = await client.GetAnalyzeResultPdfAsync(ModelId, operation.Id); BinaryData pdf = response.Value; byte[] pdfBytes = pdf.ToArray(); @@ -122,19 +116,19 @@ public async Task GetAnalyzeResultFigures() var client = CreateDocumentIntelligenceClient(); const string ModelId = "prebuilt-layout"; - var content = new AnalyzeDocumentContent() + var bytesSource = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.LayoutSample); + var options = new AnalyzeDocumentOptions(ModelId, bytesSource) { - Base64Source = DocumentIntelligenceTestEnvironment.CreateBinaryData(TestFile.LayoutSample) + Output = { AnalyzeOutputOption.Figures } }; - var output = new[] { AnalyzeOutputOption.Figures }; - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, ModelId, content, output: output); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); var result = operation.Value; Assert.That(result.Figures, Is.Not.Empty); var figure = result.Figures[0]; - var response = await client.GetAnalyzeResultFigureAsync(ModelId, Guid.Parse(operation.Id), figure.Id); + var response = await client.GetAnalyzeResultFigureAsync(ModelId, operation.Id, figure.Id); BinaryData image = response.Value; byte[] imageBytes = image.ToArray(); @@ -148,8 +142,7 @@ private void ValidateGenericAnalyzeResult(AnalyzeResult analyzeResult, string mo { Assert.That(analyzeResult.ModelId, Is.EqualTo(modelId)); 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.ContentFormat, Is.Not.EqualTo(default(DocumentContentFormat))); for (int pageNumber = 1; pageNumber <= analyzeResult.Pages.Count; pageNumber++) { @@ -165,8 +158,8 @@ private void ValidateGenericAnalyzeResult(AnalyzeResult analyzeResult, string mo foreach (var document in analyzeResult.Documents) { - Assert.That(document.DocType, Is.Not.Null); - Assert.That(document.DocType, Is.Not.Empty); + Assert.That(document.DocumentType, Is.Not.Null); + Assert.That(document.DocumentType, Is.Not.Empty); foreach (var region in document.BoundingRegions) { @@ -183,11 +176,11 @@ private void ValidateContosoReceiptAnalyzeResult(AnalyzeResult analyzeResult) { ValidateGenericAnalyzeResult(analyzeResult, "prebuilt-receipt"); - Assert.That(analyzeResult.ContentFormat, Is.EqualTo(ContentFormat.Text)); + Assert.That(analyzeResult.ContentFormat, Is.EqualTo(DocumentContentFormat.Text)); var document = analyzeResult.Documents.Single(); - Assert.That(document.DocType, Is.EqualTo("receipt.retailMeal")); + Assert.That(document.DocumentType, Is.EqualTo("receipt.retailMeal")); var documentSpan = document.Spans.Single(); @@ -201,12 +194,12 @@ private void ValidateContosoReceiptAnalyzeResult(AnalyzeResult analyzeResult) var transactionTimeField = document.Fields["TransactionTime"]; var totalField = document.Fields["Total"]; - Assert.That(merchantAddressField.Type, Is.EqualTo(DocumentFieldType.Address)); - Assert.That(merchantNameField.Type, Is.EqualTo(DocumentFieldType.String)); - Assert.That(merchantPhoneNumberField.Type, Is.EqualTo(DocumentFieldType.PhoneNumber)); - Assert.That(transactionDateField.Type, Is.EqualTo(DocumentFieldType.Date)); - Assert.That(transactionTimeField.Type, Is.EqualTo(DocumentFieldType.Time)); - Assert.That(totalField.Type, Is.EqualTo(DocumentFieldType.Currency)); + Assert.That(merchantAddressField.FieldType, Is.EqualTo(DocumentFieldType.Address)); + Assert.That(merchantNameField.FieldType, Is.EqualTo(DocumentFieldType.String)); + Assert.That(merchantPhoneNumberField.FieldType, Is.EqualTo(DocumentFieldType.PhoneNumber)); + Assert.That(transactionDateField.FieldType, Is.EqualTo(DocumentFieldType.Date)); + Assert.That(transactionTimeField.FieldType, Is.EqualTo(DocumentFieldType.Time)); + Assert.That(totalField.FieldType, Is.EqualTo(DocumentFieldType.Currency)); var merchantAddress = merchantAddressField.ValueAddress; var merchantName = merchantNameField.ValueString; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelMockTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelMockTests.cs index 54b912c7cb44..5a742e2937b1 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelMockTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceClient/DocumentModelMockTests.cs @@ -2,12 +2,11 @@ // Licensed under the MIT License. using System; -using System.IO; using System.Linq; -using System.Text; -using System.Text.Json; +using System.Threading; using System.Threading.Tasks; using Azure.Core.TestFramework; +using Moq; using NUnit.Framework; namespace Azure.AI.DocumentIntelligence.Tests @@ -19,6 +18,122 @@ public DocumentModelMockTests(bool isAsync) { } + [Test] + [AsyncOnly] + public async Task AnalyzeDocumentAsyncFromUriSourceInvokesMainMethod() + { + var mockClient = new Mock() { CallBase = true }; + var uriSource = new Uri("https://fakeuri.com/"); + using var tokenSource = new CancellationTokenSource(); + var expectedResult = Mock.Of>(); + + mockClient.Setup(c => c.AnalyzeDocumentAsync( + WaitUntil.Started, + It.Is(options => + options.ModelId == "" + && options.UriSource == uriSource + && options.BytesSource == null + && options.Pages == null + && options.Locale == null + && !options.Features.Any() + && !options.QueryFields.Any() + && options.OutputContentFormat == null + && !options.Output.Any()), + tokenSource.Token + )).Returns(Task.FromResult(expectedResult)); + + var result = await mockClient.Object.AnalyzeDocumentAsync(WaitUntil.Started, "", uriSource, tokenSource.Token); + + Assert.That(result, Is.EqualTo(expectedResult)); + } + + [Test] + [SyncOnly] + public void AnalyzeDocumentFromUriSourceInvokesMainMethod() + { + var mockClient = new Mock() { CallBase = true }; + var uriSource = new Uri("https://fakeuri.com/"); + using var tokenSource = new CancellationTokenSource(); + var expectedResult = Mock.Of>(); + + mockClient.Setup(c => c.AnalyzeDocument( + WaitUntil.Started, + It.Is(options => + options.ModelId == "" + && options.UriSource == uriSource + && options.BytesSource == null + && options.Pages == null + && options.Locale == null + && !options.Features.Any() + && !options.QueryFields.Any() + && options.OutputContentFormat == null + && !options.Output.Any()), + tokenSource.Token + )).Returns(expectedResult); + + var result = mockClient.Object.AnalyzeDocument(WaitUntil.Started, "", uriSource, tokenSource.Token); + + Assert.That(result, Is.EqualTo(expectedResult)); + } + + [Test] + [AsyncOnly] + public async Task AnalyzeDocumentAsyncFromBytesSourceInvokesMainMethod() + { + var mockClient = new Mock() { CallBase = true }; + var bytesSource = BinaryData.FromBytes(new byte[] { 0x48, 0x65, 0x6C, 0x6C, 0x6F }); + using var tokenSource = new CancellationTokenSource(); + var expectedResult = Mock.Of>(); + + mockClient.Setup(c => c.AnalyzeDocumentAsync( + WaitUntil.Started, + It.Is(options => + options.ModelId == "" + && options.UriSource == null + && options.BytesSource == bytesSource + && options.Pages == null + && options.Locale == null + && !options.Features.Any() + && !options.QueryFields.Any() + && options.OutputContentFormat == null + && !options.Output.Any()), + tokenSource.Token + )).Returns(Task.FromResult(expectedResult)); + + var result = await mockClient.Object.AnalyzeDocumentAsync(WaitUntil.Started, "", bytesSource, tokenSource.Token); + + Assert.That(result, Is.EqualTo(expectedResult)); + } + + [Test] + [SyncOnly] + public void AnalyzeDocumentFromBytesSourceInvokesMainMethod() + { + var mockClient = new Mock() { CallBase = true }; + var bytesSource = BinaryData.FromBytes(new byte[] { 0x48, 0x65, 0x6C, 0x6C, 0x6F }); + using var tokenSource = new CancellationTokenSource(); + var expectedResult = Mock.Of>(); + + mockClient.Setup(c => c.AnalyzeDocument( + WaitUntil.Started, + It.Is(options => + options.ModelId == "" + && options.UriSource == null + && options.BytesSource == bytesSource + && options.Pages == null + && options.Locale == null + && !options.Features.Any() + && !options.QueryFields.Any() + && options.OutputContentFormat == null + && !options.Output.Any()), + tokenSource.Token + )).Returns(expectedResult); + + var result = mockClient.Object.AnalyzeDocument(WaitUntil.Started, "", bytesSource, tokenSource.Token); + + Assert.That(result, Is.EqualTo(expectedResult)); + } + [Test] [TestCase("")] [TestCase("1")] @@ -28,15 +143,16 @@ public async Task AnalyzeDocumentSendsPages(string pages) { var mockResponse = new MockResponse(202); var mockTransport = new MockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateInstrumentedClient(clientOptions); - var content = new AnalyzeDocumentContent() + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("modelId", uriSource) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) + Pages = pages }; - await client.AnalyzeDocumentAsync(WaitUntil.Started, "modelId", content, pages: pages); + await client.AnalyzeDocumentAsync(WaitUntil.Started, options); var requestUriQuery = mockTransport.Requests.Single().Uri.Query; var expectedQuerySubstring = $"pages={pages}"; @@ -52,15 +168,16 @@ public async Task AnalyzeDocumentSendsLocale(string locale) { var mockResponse = new MockResponse(202); var mockTransport = new MockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateInstrumentedClient(clientOptions); - var content = new AnalyzeDocumentContent() + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("modelId", uriSource) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) + Locale = locale }; - await client.AnalyzeDocumentAsync(WaitUntil.Started, "modelId", content, locale: locale); + await client.AnalyzeDocumentAsync(WaitUntil.Started, options); var requestUriQuery = mockTransport.Requests.Single().Uri.Query; var expectedQuerySubstring = $"locale={locale}"; @@ -70,11 +187,11 @@ public async Task AnalyzeDocumentSendsLocale(string locale) private static object[] s_AnalyzeDocumentSendsFeaturesTestCases = { - new object[] { "features=", Array.Empty() }, + new object[] { null, Array.Empty() }, new object[] { "features=formulas", new[] { DocumentAnalysisFeature.Formulas } }, new object[] { "features=formulas%2CstyleFont", - new[] { DocumentAnalysisFeature.Formulas, DocumentAnalysisFeature.StyleFont } } + new[] { DocumentAnalysisFeature.Formulas, DocumentAnalysisFeature.FontStyling } } }; [Test] @@ -83,19 +200,29 @@ public async Task AnalyzeDocumentSendsFeatures(string expectedQuerySubstring, Do { var mockResponse = new MockResponse(202); var mockTransport = new MockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateInstrumentedClient(clientOptions); + + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("modelId", uriSource); - var content = new AnalyzeDocumentContent() + foreach (var feature in features) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) - }; + options.Features.Add(feature); + } - await client.AnalyzeDocumentAsync(WaitUntil.Started, "modelId", content, features: features); + await client.AnalyzeDocumentAsync(WaitUntil.Started, options); var requestUriQuery = mockTransport.Requests.Single().Uri.Query; - Assert.That(requestUriQuery.Contains(expectedQuerySubstring)); + if (features.Length > 0) + { + Assert.That(requestUriQuery.Contains(expectedQuerySubstring)); + } + else + { + Assert.That(requestUriQuery.Contains("features"), Is.False); + } } [Test] @@ -106,148 +233,61 @@ public async Task AnalyzeDocumentSendsQueryFields(params string[] queryFields) { var mockResponse = new MockResponse(202); var mockTransport = new MockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateInstrumentedClient(clientOptions); - var content = new AnalyzeDocumentContent() + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("modelId", uriSource); + + foreach (var queryField in queryFields) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) - }; + options.QueryFields.Add(queryField); + } - await client.AnalyzeDocumentAsync(WaitUntil.Started, "modelId", content, queryFields: queryFields); + await client.AnalyzeDocumentAsync(WaitUntil.Started, options); var requestUriQuery = mockTransport.Requests.Single().Uri.Query; - var expectedQuerySubstring = "queryFields=" + string.Join("%2C", queryFields); - Assert.That(requestUriQuery.Contains(expectedQuerySubstring)); + if (queryFields.Length > 0) + { + var expectedQuerySubstring = "queryFields=" + string.Join("%2C", queryFields); + + Assert.That(requestUriQuery.Contains(expectedQuerySubstring)); + } + else + { + Assert.That(requestUriQuery.Contains("queryFields"), Is.False); + } } private static object[] s_AnalyzeDocumentSendsOutputContentFormatTestCases = { - new object[] { "outputContentFormat=text", ContentFormat.Text }, - new object[] { "outputContentFormat=markdown", ContentFormat.Markdown } + new object[] { "outputContentFormat=text", DocumentContentFormat.Text }, + new object[] { "outputContentFormat=markdown", DocumentContentFormat.Markdown } }; [Test] [TestCaseSource(nameof(s_AnalyzeDocumentSendsOutputContentFormatTestCases))] - public async Task AnalyzeDocumentSendsOutputContentFormat(string expectedQuerySubstring, ContentFormat format) + public async Task AnalyzeDocumentSendsOutputContentFormat(string expectedQuerySubstring, DocumentContentFormat format) { var mockResponse = new MockResponse(202); var mockTransport = new MockTransport(new[] { mockResponse }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateInstrumentedClient(options); + var clientOptions = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; + var client = CreateInstrumentedClient(clientOptions); - var content = new AnalyzeDocumentContent() + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("modelId", uriSource) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) + OutputContentFormat = format }; - await client.AnalyzeDocumentAsync(WaitUntil.Started, "modelId", content, outputContentFormat: format); + await client.AnalyzeDocumentAsync(WaitUntil.Started, options); var requestUriQuery = mockTransport.Requests.Single().Uri.Query; Assert.That(requestUriQuery.Contains(expectedQuerySubstring)); } - [Test] - [TestCase(true)] - [TestCase(false)] - public async Task AnalyzeBatchDocuments(bool isAsync) - { - using var postResponse = new MockResponse(202); - - postResponse.AddHeader("Operation-Location", "https://fakeResource.azure.com/documentIntelligence/documentModels/prebuilt-read/analyzeBatchResults/0123456789ABCDEF?api-version=2024-07-31-preview"); - - using var getResponseRunning = new MockResponse(200); - using var getResponseRunningBody = new MemoryStream(Encoding.UTF8.GetBytes(""" - { - "status": "running", - "percentCompleted": 67, - "createdDateTime": "2021-09-24T13:00:46Z", - "lastUpdatedDateTime": "2021-09-24T13:00:49Z" - } - """)); - - getResponseRunning.ContentStream = getResponseRunningBody; - - using var getResponseCompleted = new MockResponse(200); - using var getResponseCompletedBody = new MemoryStream(Encoding.UTF8.GetBytes(""" - { - "status": "succeeded", - "percentCompleted": 100, - "createdDateTime": "2021-09-24T13:00:46Z", - "lastUpdatedDateTime": "2021-09-24T13:00:55Z", - "result": { - "succeededCount": 2, - "failedCount": 0, - "skippedCount": 0, - "details": [ - { - "sourceUrl": "https://fake_source_url_0.com/", - "resultUrl": "https://fake_result_url_0.com/", - "status": "succeeded" - }, - { - "sourceUrl": "https://fake_source_url_1.com/", - "resultUrl": "https://fake_result_url_1.com/", - "status": "succeeded" - } - ] - } - } - """)); - - getResponseCompleted.ContentStream = getResponseCompletedBody; - - var mockTransport = new InterceptorMockTransport(new[] { postResponse, getResponseRunning, getResponseCompleted }); - var options = new DocumentIntelligenceClientOptions() { Transport = mockTransport }; - var client = CreateNonInstrumentedClient(options); - - var content = new AnalyzeBatchDocumentsContent(new Uri("https://fake_result_container_url.com")) - { - AzureBlobSource = new AzureBlobContentSource(new Uri("https://fake_source_container_url.com")) - }; - - var operation = isAsync - ? await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "prebuilt-read", content) - : client.AnalyzeBatchDocuments(WaitUntil.Completed, "prebuilt-read", content); - - // Validate the request. - - var postRequestBody = mockTransport.FirstRequestBody; - var postRequestJson = JsonDocument.Parse(postRequestBody); - - var resultContainerUrlElement = postRequestJson.RootElement.GetProperty("resultContainerUrl"); - var azureBlobSourceElement = postRequestJson.RootElement.GetProperty("azureBlobSource"); - var containerUrlElement = azureBlobSourceElement.GetProperty("containerUrl"); - - Assert.That(resultContainerUrlElement.ToString(), Is.EqualTo("https://fake_result_container_url.com/")); - Assert.That(containerUrlElement.ToString(), Is.EqualTo("https://fake_source_container_url.com/")); - - // Validate the response. - - Assert.That(operation.HasValue); - Assert.That(operation.HasCompleted); - - var result = operation.Value; - - Assert.That(result.SucceededCount, Is.EqualTo(2)); - Assert.That(result.FailedCount, Is.EqualTo(0)); - Assert.That(result.SkippedCount, Is.EqualTo(0)); - Assert.That(result.Details.Count, Is.EqualTo(2)); - - var operationDetail0 = result.Details[0]; - var operationDetail1 = result.Details[1]; - - Assert.That(operationDetail0.Status, Is.EqualTo(OperationStatus.Succeeded)); - Assert.That(operationDetail0.SourceUrl.AbsoluteUri, Is.EqualTo("https://fake_source_url_0.com/")); - Assert.That(operationDetail0.ResultUrl.AbsoluteUri, Is.EqualTo("https://fake_result_url_0.com/")); - - Assert.That(operationDetail1.Status, Is.EqualTo(OperationStatus.Succeeded)); - Assert.That(operationDetail1.SourceUrl.AbsoluteUri, Is.EqualTo("https://fake_source_url_1.com/")); - Assert.That(operationDetail1.ResultUrl.AbsoluteUri, Is.EqualTo("https://fake_result_url_1.com/")); - } - private DocumentIntelligenceClient CreateNonInstrumentedClient(DocumentIntelligenceClientOptions options) { var fakeEndpoint = new Uri("http://localhost"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceAdministrationClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceAdministrationClient.cs index 47ae1347e5bd..5f30a36da9ae 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceAdministrationClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceAdministrationClient.cs @@ -73,11 +73,11 @@ public void Example_DocumentIntelligenceAdministrationClient_AuthorizeModelCopy_ AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - AuthorizeCopyContent authorizeCopyRequest = new AuthorizeCopyContent("targetModel") + AuthorizeModelCopyOptions authorizeCopyRequest = new AuthorizeModelCopyOptions("targetModel") { Description = "Target model description", }; - Response response = client.AuthorizeModelCopy(authorizeCopyRequest); + Response response = client.AuthorizeModelCopy(authorizeCopyRequest); } [Test] @@ -88,11 +88,11 @@ public async Task Example_DocumentIntelligenceAdministrationClient_AuthorizeMode AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - AuthorizeCopyContent authorizeCopyRequest = new AuthorizeCopyContent("targetModel") + AuthorizeModelCopyOptions authorizeCopyRequest = new AuthorizeModelCopyOptions("targetModel") { Description = "Target model description", }; - Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); + Response response = await client.AuthorizeModelCopyAsync(authorizeCopyRequest); } [Test] @@ -227,13 +227,13 @@ public async Task Example_DocumentModelDetails_DeleteModel_DeleteDocumentModel_A [Test] [Ignore("Only validating compilation of examples")] - public void Example_DocumentIntelligenceAdministrationClient_GetResourceInfo_GetResourceDetails() + public void Example_DocumentIntelligenceAdministrationClient_GetResourceDetails_GetResourceDetails() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - Response response = client.GetResourceInfo(null); + Response response = client.GetResourceDetails(null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); @@ -242,13 +242,13 @@ public void Example_DocumentIntelligenceAdministrationClient_GetResourceInfo_Get [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentIntelligenceAdministrationClient_GetResourceInfo_GetResourceDetails_Async() + public async Task Example_DocumentIntelligenceAdministrationClient_GetResourceDetails_GetResourceDetails_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - Response response = await client.GetResourceInfoAsync(null); + Response response = await client.GetResourceDetailsAsync(null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("customDocumentModels").GetProperty("count").ToString()); @@ -257,29 +257,29 @@ public async Task Example_DocumentIntelligenceAdministrationClient_GetResourceIn [Test] [Ignore("Only validating compilation of examples")] - public void Example_DocumentIntelligenceAdministrationClient_GetResourceInfo_GetResourceDetails_Convenience() + public void Example_DocumentIntelligenceAdministrationClient_GetResourceDetails_GetResourceDetails_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - Response response = client.GetResourceInfo(); + Response response = client.GetResourceDetails(); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentIntelligenceAdministrationClient_GetResourceInfo_GetResourceDetails_Convenience_Async() + public async Task Example_DocumentIntelligenceAdministrationClient_GetResourceDetails_GetResourceDetails_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - Response response = await client.GetResourceInfoAsync(); + Response response = await client.GetResourceDetailsAsync(); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_OperationDetails_GetOperation_GetOperation() + public void Example_DocumentIntelligenceOperationDetails_GetOperation_GetOperation() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -298,7 +298,7 @@ public void Example_OperationDetails_GetOperation_GetOperation() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_OperationDetails_GetOperation_GetOperation_Async() + public async Task Example_DocumentIntelligenceOperationDetails_GetOperation_GetOperation_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -317,24 +317,24 @@ public async Task Example_OperationDetails_GetOperation_GetOperation_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_OperationDetails_GetOperation_GetOperation_Convenience() + public void Example_DocumentIntelligenceOperationDetails_GetOperation_GetOperation_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - Response response = client.GetOperation("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); + Response response = client.GetOperation("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_OperationDetails_GetOperation_GetOperation_Convenience_Async() + public async Task Example_DocumentIntelligenceOperationDetails_GetOperation_GetOperation_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - Response response = await client.GetOperationAsync("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); + Response response = await client.GetOperationAsync("b704bb00-d130-4f3f-a1d8-ca96de3eabb4"); } [Test] @@ -393,7 +393,7 @@ public void Example_DocumentIntelligenceAdministrationClient_AuthorizeClassifier AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - AuthorizeClassifierCopyContent authorizeCopyRequest = new AuthorizeClassifierCopyContent("targetClassifier") + AuthorizeClassifierCopyOptions authorizeCopyRequest = new AuthorizeClassifierCopyOptions("targetClassifier") { Description = "Target classifier description", }; @@ -408,7 +408,7 @@ public async Task Example_DocumentIntelligenceAdministrationClient_AuthorizeClas AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - AuthorizeClassifierCopyContent authorizeCopyRequest = new AuthorizeClassifierCopyContent("targetClassifier") + AuthorizeClassifierCopyOptions authorizeCopyRequest = new AuthorizeClassifierCopyOptions("targetClassifier") { Description = "Target classifier description", }; @@ -557,7 +557,7 @@ public async Task Example_DocumentModelDetails_GetModels_GetDocumentModels_Conve [Test] [Ignore("Only validating compilation of examples")] - public void Example_OperationDetails_GetOperations_GetOperations() + public void Example_DocumentIntelligenceOperationDetails_GetOperations_GetOperations() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -577,7 +577,7 @@ public void Example_OperationDetails_GetOperations_GetOperations() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_OperationDetails_GetOperations_GetOperations_Async() + public async Task Example_DocumentIntelligenceOperationDetails_GetOperations_GetOperations_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); @@ -597,26 +597,26 @@ public async Task Example_OperationDetails_GetOperations_GetOperations_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_OperationDetails_GetOperations_GetOperations_Convenience() + public void Example_DocumentIntelligenceOperationDetails_GetOperations_GetOperations_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - foreach (OperationDetails item in client.GetOperations()) + foreach (DocumentIntelligenceOperationDetails item in client.GetOperations()) { } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_OperationDetails_GetOperations_GetOperations_Convenience_Async() + public async Task Example_DocumentIntelligenceOperationDetails_GetOperations_GetOperations_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - await foreach (OperationDetails item in client.GetOperationsAsync()) + await foreach (DocumentIntelligenceOperationDetails item in client.GetOperationsAsync()) { } } @@ -753,13 +753,9 @@ public void Example_DocumentIntelligenceAdministrationClient_BuildDocumentModel_ AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - BuildDocumentModelContent buildRequest = new BuildDocumentModelContent("myCustomModel", DocumentBuildMode.Template) + BuildDocumentModelOptions buildRequest = new BuildDocumentModelOptions("myCustomModel", DocumentBuildMode.Template) { Description = "Custom model description", - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "trainingDocs/", - }, Tags = { ["createdBy"] = "myUserId" @@ -777,13 +773,9 @@ public async Task Example_DocumentIntelligenceAdministrationClient_BuildDocument AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - BuildDocumentModelContent buildRequest = new BuildDocumentModelContent("myCustomModel", DocumentBuildMode.Template) + BuildDocumentModelOptions buildRequest = new BuildDocumentModelOptions("myCustomModel", DocumentBuildMode.Template) { Description = "Custom model description", - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "trainingDocs/", - }, Tags = { ["createdBy"] = "myUserId" @@ -867,7 +859,7 @@ public void Example_DocumentIntelligenceAdministrationClient_ComposeModel_Compos AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - ComposeDocumentModelContent composeRequest = new ComposeDocumentModelContent("composedModel", "customClassifier", new Dictionary + ComposeModelOptions composeRequest = new ComposeModelOptions("composedModel", "customClassifier", new Dictionary { ["formA"] = new DocumentTypeDetails { @@ -893,7 +885,7 @@ public async Task Example_DocumentIntelligenceAdministrationClient_ComposeModel_ AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - ComposeDocumentModelContent composeRequest = new ComposeDocumentModelContent("composedModel", "customClassifier", new Dictionary + ComposeModelOptions composeRequest = new ComposeModelOptions("composedModel", "customClassifier", new Dictionary { ["formA"] = new DocumentTypeDetails { @@ -969,7 +961,7 @@ public void Example_DocumentIntelligenceAdministrationClient_CopyModelTo_CopyDoc AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - CopyAuthorization copyToRequest = new CopyAuthorization( + ModelCopyAuthorization copyToRequest = new ModelCopyAuthorization( "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService", "targetResourceRegion", "targetModel", @@ -988,7 +980,7 @@ public async Task Example_DocumentIntelligenceAdministrationClient_CopyModelTo_C AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - CopyAuthorization copyToRequest = new CopyAuthorization( + ModelCopyAuthorization copyToRequest = new ModelCopyAuthorization( "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService", "targetResourceRegion", "targetModel", @@ -1091,19 +1083,10 @@ public void Example_DocumentIntelligenceAdministrationClient_BuildClassifier_Bui AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - BuildDocumentClassifierContent buildRequest = new BuildDocumentClassifierContent("myClassifier", new Dictionary + BuildClassifierOptions buildRequest = new BuildClassifierOptions("myClassifier", new Dictionary { - ["formA"] = new ClassifierDocumentTypeDetails - { - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "formADocs/", - }, - }, - ["formB"] = new ClassifierDocumentTypeDetails - { - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken"), "formB.jsonl"), - } + ["formA"] = new ClassifierDocumentTypeDetails(), + ["formB"] = new ClassifierDocumentTypeDetails() }) { Description = "Classifier description", @@ -1120,19 +1103,10 @@ public async Task Example_DocumentIntelligenceAdministrationClient_BuildClassifi AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceAdministrationClient client = new DocumentIntelligenceAdministrationClient(endpoint, credential); - BuildDocumentClassifierContent buildRequest = new BuildDocumentClassifierContent("myClassifier", new Dictionary + BuildClassifierOptions buildRequest = new BuildClassifierOptions("myClassifier", new Dictionary { - ["formA"] = new ClassifierDocumentTypeDetails - { - AzureBlobSource = new AzureBlobContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken")) - { - Prefix = "formADocs/", - }, - }, - ["formB"] = new ClassifierDocumentTypeDetails - { - AzureBlobFileListSource = new AzureBlobFileListContentSource(new Uri("https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken"), "formB.jsonl"), - } + ["formA"] = new ClassifierDocumentTypeDetails(), + ["formB"] = new ClassifierDocumentTypeDetails() }) { Description = "Classifier description", diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceClient.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceClient.cs index bc3756b82309..e29cdfefe64f 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceClient.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceClient.cs @@ -18,102 +18,62 @@ public partial class Samples_DocumentIntelligenceClient { [Test] [Ignore("Only validating compilation of examples")] - public void Example_DocumentIntelligenceClient_GetAnalyzeResultPdf_GetAnalyzeDocumentResultPDF() + public void Example_DocumentIntelligenceClient_GetAnalyzeBatchResults_ListAnalyzeBatchDocumentsResults() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Response response = client.GetAnalyzeResultPdf("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentIntelligenceClient_GetAnalyzeResultPdf_GetAnalyzeDocumentResultPDF_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - - Response response = await client.GetAnalyzeResultPdfAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DocumentIntelligenceClient_GetAnalyzeResultPdf_GetAnalyzeDocumentResultPDF_Convenience() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - - Response response = client.GetAnalyzeResultPdf("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentIntelligenceClient_GetAnalyzeResultPdf_GetAnalyzeDocumentResultPDF_Convenience_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - - Response response = await client.GetAnalyzeResultPdfAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DocumentIntelligenceClient_GetAnalyzeResultFigure_GetAnalyzeDocumentResultFigure() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - - Response response = client.GetAnalyzeResultFigure("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + foreach (BinaryData item in client.GetAnalyzeBatchResults("prebuilt-invoice", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentIntelligenceClient_GetAnalyzeResultFigure_GetAnalyzeDocumentResultFigure_Async() + public async Task Example_DocumentIntelligenceClient_GetAnalyzeBatchResults_ListAnalyzeBatchDocumentsResults_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Response response = await client.GetAnalyzeResultFigureAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + await foreach (BinaryData item in client.GetAnalyzeBatchResultsAsync("prebuilt-invoice", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DocumentIntelligenceClient_GetAnalyzeResultFigure_GetAnalyzeDocumentResultFigure_Convenience() + public void Example_DocumentIntelligenceClient_GetAnalyzeBatchResults_ListAnalyzeBatchDocumentsResults_Convenience() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Response response = client.GetAnalyzeResultFigure("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0"); + foreach (AnalyzeBatchOperationDetails item in client.GetAnalyzeBatchResults("prebuilt-invoice")) + { + } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DocumentIntelligenceClient_GetAnalyzeResultFigure_GetAnalyzeDocumentResultFigure_Convenience_Async() + public async Task Example_DocumentIntelligenceClient_GetAnalyzeBatchResults_ListAnalyzeBatchDocumentsResults_Convenience_Async() { Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Response response = await client.GetAnalyzeResultFigureAsync("prebuilt-invoice", Guid.Parse("3b31320d-8bab-4f88-b19c-2322a7f11034"), "1.0"); + await foreach (AnalyzeBatchOperationDetails item in client.GetAnalyzeBatchResultsAsync("prebuilt-invoice")) + { + } } [Test] @@ -174,7 +134,8 @@ public void Example_DocumentIntelligenceClient_AnalyzeDocument_AnalyzeDocumentFr AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "prebuilt-layout"); + AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); + Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "prebuilt-layout", analyzeRequest); AnalyzeResult responseData = operation.Value; } @@ -186,7 +147,8 @@ public async Task Example_DocumentIntelligenceClient_AnalyzeDocument_AnalyzeDocu AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout"); + AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", analyzeRequest); AnalyzeResult responseData = operation.Value; } @@ -248,7 +210,8 @@ public void Example_DocumentIntelligenceClient_AnalyzeDocument_AnalyzeDocumentFr AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "customModel"); + AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); + Operation operation = client.AnalyzeDocument(WaitUntil.Completed, "customModel", analyzeRequest); AnalyzeResult responseData = operation.Value; } @@ -260,7 +223,8 @@ public async Task Example_DocumentIntelligenceClient_AnalyzeDocument_AnalyzeDocu AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "customModel"); + AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions(); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "customModel", analyzeRequest); AnalyzeResult responseData = operation.Value; } @@ -290,8 +254,6 @@ public void Example_DocumentIntelligenceClient_AnalyzeBatchDocuments_AnalyzeBatc Console.WriteLine(result.GetProperty("succeededCount").ToString()); Console.WriteLine(result.GetProperty("failedCount").ToString()); Console.WriteLine(result.GetProperty("skippedCount").ToString()); - Console.WriteLine(result.GetProperty("details")[0].GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("details")[0].GetProperty("sourceUrl").ToString()); } [Test] @@ -320,8 +282,6 @@ public async Task Example_DocumentIntelligenceClient_AnalyzeBatchDocuments_Analy Console.WriteLine(result.GetProperty("succeededCount").ToString()); Console.WriteLine(result.GetProperty("failedCount").ToString()); Console.WriteLine(result.GetProperty("skippedCount").ToString()); - Console.WriteLine(result.GetProperty("details")[0].GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("details")[0].GetProperty("sourceUrl").ToString()); } [Test] @@ -332,7 +292,12 @@ public void Example_DocumentIntelligenceClient_AnalyzeBatchDocuments_AnalyzeBatc AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Operation operation = client.AnalyzeBatchDocuments(WaitUntil.Completed, "customModel"); + AnalyzeBatchDocumentsOptions analyzeBatchRequest = new AnalyzeBatchDocumentsOptions(new Uri("https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken")) + { + ResultPrefix = "trainingDocsResult/", + OverwriteExisting = true, + }; + Operation operation = client.AnalyzeBatchDocuments(WaitUntil.Completed, "customModel", analyzeBatchRequest); AnalyzeBatchResult responseData = operation.Value; } @@ -344,7 +309,12 @@ public async Task Example_DocumentIntelligenceClient_AnalyzeBatchDocuments_Analy AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - Operation operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "customModel"); + AnalyzeBatchDocumentsOptions analyzeBatchRequest = new AnalyzeBatchDocumentsOptions(new Uri("https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken")) + { + ResultPrefix = "trainingDocsResult/", + OverwriteExisting = true, + }; + Operation operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "customModel", analyzeBatchRequest); AnalyzeBatchResult responseData = operation.Value; } @@ -406,9 +376,9 @@ public void Example_DocumentIntelligenceClient_ClassifyDocument_ClassifyDocument AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - ClassifyDocumentContent classifyRequest = new ClassifyDocumentContent + ClassifyDocumentOptions classifyRequest = new ClassifyDocumentOptions { - UrlSource = new Uri("http://host.com/doc.pdf"), + UriSource = new Uri("http://host.com/doc.pdf"), }; Operation operation = client.ClassifyDocument(WaitUntil.Completed, "classifierId", classifyRequest); AnalyzeResult responseData = operation.Value; @@ -422,9 +392,9 @@ public async Task Example_DocumentIntelligenceClient_ClassifyDocument_ClassifyDo AzureKeyCredential credential = new AzureKeyCredential(""); DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential); - ClassifyDocumentContent classifyRequest = new ClassifyDocumentContent + ClassifyDocumentOptions classifyRequest = new ClassifyDocumentOptions { - UrlSource = new Uri("http://host.com/doc.pdf"), + UriSource = new Uri("http://host.com/doc.pdf"), }; Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, "classifierId", classifyRequest); AnalyzeResult 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 index 366ebda2ef16..70367dbef8f8 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentClassifier.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentClassifier.cs @@ -22,9 +22,9 @@ private DisposableDocumentClassifier(DocumentIntelligenceAdministrationClient cl public string ClassifierId => Value.ClassifierId; - public static async Task BuildAsync(DocumentIntelligenceAdministrationClient client, BuildDocumentClassifierContent buildContent) + public static async Task BuildAsync(DocumentIntelligenceAdministrationClient client, BuildClassifierOptions buildOptions) { - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildContent); + Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, buildOptions); return new DisposableDocumentClassifier(client, operation); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs index ec3b5a36fdab..4cd9766f4938 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DisposableDocumentModel.cs @@ -22,9 +22,9 @@ private DisposableDocumentModel(DocumentIntelligenceAdministrationClient client, public string ModelId => Value.ModelId; - public static async Task BuildAsync(DocumentIntelligenceAdministrationClient client, BuildDocumentModelContent buildContent) + public static async Task BuildAsync(DocumentIntelligenceAdministrationClient client, BuildDocumentModelOptions buildOptions) { - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildContent); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, buildOptions); return new DisposableDocumentModel(client, operation); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs index 5e15593536d3..811eab8d57ef 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceLiveTestBase.cs @@ -11,15 +11,18 @@ namespace Azure.AI.DocumentIntelligence.Tests { public class DocumentIntelligenceLiveTestBase : RecordedTestBase { + private const string SanitizedContainerUri = "https://sanitized.blob.core.windows.net"; + public DocumentIntelligenceLiveTestBase(bool isAsync, RecordedTestMode? mode = null) : base(isAsync, mode) { JsonPathSanitizers.Add("$..accessToken"); - BodyKeySanitizers.Add(new BodyKeySanitizer("$..containerUrl") { Value = "https://sanitized.blob.core.windows.net" }); + BodyKeySanitizers.Add(new BodyKeySanitizer("$..containerUrl") { Value = SanitizedContainerUri }); + BodyKeySanitizers.Add(new BodyKeySanitizer("$..resultContainerUrl") { Value = SanitizedContainerUri }); SanitizedHeaders.Add("Ocp-Apim-Subscription-Key"); } - protected string ServiceVersionString { get; } = "2024-07-31-preview"; + protected string ServiceVersionString { get; } = "2024-11-30"; protected DocumentIntelligenceClient CreateDocumentIntelligenceClient(bool useApiKey = false) { @@ -66,11 +69,10 @@ protected async Task BuildDisposableDocumentModelAsync( var client = CreateDocumentIntelligenceAdministrationClient(); var modelId = Recording.GenerateId(); var containerUrl = new Uri(containerUrlString); - var source = new AzureBlobContentSource(containerUrl); + var source = new BlobContentSource(containerUrl); - var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) + var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, source) { - AzureBlobSource = source, Description = description }; @@ -78,11 +80,11 @@ protected async Task BuildDisposableDocumentModelAsync( { foreach (var tag in tags) { - content.Tags.Add(tag); + options.Tags.Add(tag); } } - return await DisposableDocumentModel.BuildAsync(client, content); + return await DisposableDocumentModel.BuildAsync(client, options); } protected async Task BuildDisposableDocumentClassifierAsync(string description = null) @@ -90,16 +92,16 @@ protected async Task BuildDisposableDocumentClassi var client = CreateDocumentIntelligenceAdministrationClient(); 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 sourceA = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-A/train" }; + var sourceB = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-B/train" }; + var sourceC = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-C/train" }; + var sourceD = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-D/train" }; + var sourceE = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-E/train" }; + var docTypeA = new ClassifierDocumentTypeDetails(sourceA); + var docTypeB = new ClassifierDocumentTypeDetails(sourceB); + var docTypeC = new ClassifierDocumentTypeDetails(sourceC); + var docTypeD = new ClassifierDocumentTypeDetails(sourceD); + var docTypeE = new ClassifierDocumentTypeDetails(sourceE); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, @@ -109,12 +111,12 @@ protected async Task BuildDisposableDocumentClassi { "IRS-1040-E", docTypeE } }; - var content = new BuildDocumentClassifierContent(classifierId, docTypes) + var options = new BuildClassifierOptions(classifierId, docTypes) { Description = description }; - return await DisposableDocumentClassifier.BuildAsync(client, content); + return await DisposableDocumentClassifier.BuildAsync(client, options); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs index 88872f260da7..f07f3d31ea87 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Infrastructure/DocumentIntelligenceTestEnvironment.cs @@ -6,7 +6,6 @@ using System.Reflection; using System.Threading.Tasks; using Azure.Core.TestFramework; -using Azure.Identity; namespace Azure.AI.DocumentIntelligence.Tests { @@ -34,6 +33,10 @@ public class DocumentIntelligenceTestEnvironment : TestEnvironment public string ClassifierTrainingSasUrl => GetRecordedVariable("CLASSIFIER_BLOB_CONTAINER_SAS_URL", options => options.IsSecret(SanitizedSasUrl)); + public string BatchSourceBlobSasUrl => GetRecordedVariable("BATCH_SOURCE_BLOB_CONTAINER_SAS_URL", options => options.IsSecret(SanitizedSasUrl)); + + public string BatchResultBlobSasUrl => GetRecordedVariable("BATCH_RESULT_BLOB_CONTAINER_SAS_URL", options => options.IsSecret(SanitizedSasUrl)); + public static string CreatePath(string filename) { return Path.Combine(s_currentWorkingDirectory, AssetsFolderName, filename); @@ -62,7 +65,7 @@ protected override async ValueTask IsEnvironmentReadyAsync() try { - await client.GetResourceInfoAsync(); + await client.GetResourceDetailsAsync(); } catch (RequestFailedException e) when (e.Status == 401) { diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/OperationWithIdLiveTests.cs similarity index 63% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/OperationWithIdLiveTests.cs index 27ac4e43543a..4ceacf6451e6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/DocumentIntelligenceAdministrationClient/OperationWithIdLiveTests.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/OperationWithIdLiveTests.cs @@ -30,15 +30,56 @@ public async Task AnalyzeDocumentOperationCanParseOperationId(WaitUntil waitUnti { var client = CreateDocumentIntelligenceClient(); - var content = new AnalyzeDocumentContent() + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt); + var options = new AnalyzeDocumentOptions("prebuilt-receipt", uriSource); + + Operation operation = await client.AnalyzeDocumentAsync(waitUntil, options); + string operationId = operation.Id; + + var match = Regex.Match(operationId, AnalysisOperationIdPattern); + + Assert.That(match.Success); + } + + [RecordedTest] + [TestCase(WaitUntil.Started)] + [TestCase(WaitUntil.Completed)] + public async Task AnalyzeBatchDocumentsOperationCanParseOperationId(WaitUntil waitUntil) + { + var client = CreateDocumentIntelligenceClient(); + + var sourceContainerUri = new Uri(TestEnvironment.BatchSourceBlobSasUrl); + var resultContainerUri = new Uri(TestEnvironment.BatchResultBlobSasUrl); + var blobSource = new BlobContentSource(sourceContainerUri); + var options = new AnalyzeBatchDocumentsOptions("prebuilt-read", blobSource, resultContainerUri) { - UrlSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.ContosoReceipt) + OverwriteExisting = true }; - Operation operation = await client.AnalyzeDocumentAsync(waitUntil, "prebuilt-receipt", content); - await operation.WaitForCompletionAsync(); + var operation = await client.AnalyzeBatchDocumentsAsync(waitUntil, options); + string operationId = operation.Id; + + var match = Regex.Match(operationId, AnalysisOperationIdPattern); + + Assert.That(match.Success); + } + + [RecordedTest] + [TestCase(WaitUntil.Started)] + [TestCase(WaitUntil.Completed)] + public async Task ClassifyDocumentOperationCanParseOperationId(WaitUntil waitUntil) + { + var client = CreateDocumentIntelligenceClient(); + + await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); + + var uriSource = DocumentIntelligenceTestEnvironment.CreateUri(TestFile.Irs1040); + var options = new ClassifyDocumentOptions(disposableClassifier.ClassifierId, uriSource); + + var operation = await client.ClassifyDocumentAsync(waitUntil, options); + string operationId = operation.Id; - var match = Regex.Match(operation.Id, AnalysisOperationIdPattern); + var match = Regex.Match(operationId, AnalysisOperationIdPattern); Assert.That(match.Success); } @@ -52,18 +93,17 @@ public async Task BuildDocumentModelOperationCanParseOperationId(WaitUntil waitU var modelId = Recording.GenerateId(); var containerUrl = new Uri(TestEnvironment.BlobContainerSasUrl); - var source = new AzureBlobContentSource(containerUrl); - - var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) - { - AzureBlobSource = source - }; + var source = new BlobContentSource(containerUrl); + var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, source); Operation operation = null; + string operationId = null; try { - operation = await client.BuildDocumentModelAsync(waitUntil, content); + operation = await client.BuildDocumentModelAsync(waitUntil, options); + operationId = operation.Id; + await operation.WaitForCompletionAsync(); } finally @@ -74,7 +114,7 @@ public async Task BuildDocumentModelOperationCanParseOperationId(WaitUntil waitU } } - var match = Regex.Match(operation.Id, TrainingOperationIdPattern); + var match = Regex.Match(operationId, TrainingOperationIdPattern); Assert.That(match.Success); } @@ -89,15 +129,18 @@ public async Task CopyModelToOperationCanParseOperationId(WaitUntil waitUntil) await using var disposableModel = await BuildDisposableDocumentModelAsync(TestEnvironment.BlobContainerSasUrl); - var authorizeCopyContent = new AuthorizeCopyContent(modelId); + var authorizeCopyOptions = new AuthorizeModelCopyOptions(modelId); - CopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(authorizeCopyContent); + ModelCopyAuthorization copyAuthorization = await client.AuthorizeModelCopyAsync(authorizeCopyOptions); Operation operation = null; + string operationId = null; try { operation = await client.CopyModelToAsync(waitUntil, disposableModel.ModelId, copyAuthorization); + operationId = operation.Id; + await operation.WaitForCompletionAsync(); } finally @@ -108,7 +151,7 @@ public async Task CopyModelToOperationCanParseOperationId(WaitUntil waitUntil) } } - var match = Regex.Match(operation.Id, TrainingOperationIdPattern); + var match = Regex.Match(operationId, TrainingOperationIdPattern); Assert.That(match.Success); } @@ -132,13 +175,16 @@ public async Task ComposeModelOperationCanParseOperationId(WaitUntil waitUntil) { "model1", new DocumentTypeDetails() { ModelId = disposableModel1.ModelId } } }; - var content = new ComposeDocumentModelContent(modelId, disposableClassifier.ClassifierId, docTypes); + var options = new ComposeModelOptions(modelId, disposableClassifier.ClassifierId, docTypes); Operation operation = null; + string operationId = null; try { - operation = await client.ComposeModelAsync(waitUntil, content); + operation = await client.ComposeModelAsync(waitUntil, options); + operationId = operation.Id; + await operation.WaitForCompletionAsync(); } finally @@ -149,7 +195,7 @@ public async Task ComposeModelOperationCanParseOperationId(WaitUntil waitUntil) } } - var match = Regex.Match(operation.Id, TrainingOperationIdPattern); + var match = Regex.Match(operationId, TrainingOperationIdPattern); Assert.That(match.Success); } @@ -163,23 +209,26 @@ public async Task BuildClassifierOperationCanParseOperationId(WaitUntil waitUnti 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 docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; + var sourceA = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-A/train" }; + var sourceB = new BlobContentSource(containerUrl) { Prefix = "IRS-1040-B/train" }; + var docTypeA = new ClassifierDocumentTypeDetails(sourceA); + var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; - var content = new BuildDocumentClassifierContent(classifierId, docTypes); + var options = new BuildClassifierOptions(classifierId, docTypes); Operation operation = null; + string operationId = null; try { - operation = await client.BuildClassifierAsync(waitUntil, content); + operation = await client.BuildClassifierAsync(waitUntil, options); + operationId = operation.Id; + await operation.WaitForCompletionAsync(); } finally @@ -190,7 +239,7 @@ public async Task BuildClassifierOperationCanParseOperationId(WaitUntil waitUnti } } - var match = Regex.Match(operation.Id, TrainingOperationIdPattern); + var match = Regex.Match(operationId, TrainingOperationIdPattern); Assert.That(match.Success); } @@ -205,15 +254,18 @@ public async Task CopyClassifierToOperationCanParseOperationId(WaitUntil waitUnt await using var disposableClassifier = await BuildDisposableDocumentClassifierAsync(); - var authorizeCopyContent = new AuthorizeClassifierCopyContent(classifierId); + var authorizeCopyOptions = new AuthorizeClassifierCopyOptions(classifierId); - ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(authorizeCopyContent); + ClassifierCopyAuthorization copyAuthorization = await client.AuthorizeClassifierCopyAsync(authorizeCopyOptions); Operation operation = null; + string operationId = null; try { operation = await client.CopyClassifierToAsync(waitUntil, disposableClassifier.ClassifierId, copyAuthorization); + operationId = operation.Id; + await operation.WaitForCompletionAsync(); } finally @@ -224,7 +276,7 @@ public async Task CopyClassifierToOperationCanParseOperationId(WaitUntil waitUnt } } - var match = Regex.Match(operation.Id, TrainingOperationIdPattern); + var match = Regex.Match(operationId, TrainingOperationIdPattern); Assert.That(match.Success); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleSnippets.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleSnippets.cs index d166e87293ed..89ad160a1bb5 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleSnippets.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleSnippets.cs @@ -81,14 +81,12 @@ public async Task BadRequestSnippet() var client = new DocumentIntelligenceClient(new Uri(endpoint), TestEnvironment.Credential); #region Snippet:DocumentIntelligenceBadRequest - var content = new AnalyzeDocumentContent() - { - UrlSource = new Uri("http://invalid.uri") - }; + var uriSource = new Uri("http://invalid.uri"); + var options = new AnalyzeDocumentOptions("prebuilt-receipt", uriSource); try { - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-receipt", content); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); } catch (RequestFailedException e) { @@ -110,12 +108,9 @@ public async Task GetWordsSnippet() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() - { - UrlSource = uriSource - }; + var options = new AnalyzeDocumentOptions("prebuilt-invoice", uriSource); - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; DocumentPage firstPage = result.Pages[0]; diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithAddOnCapabilities.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithAddOnCapabilities.cs index 3dd5cc8ba013..26dcbb5ad354 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithAddOnCapabilities.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithAddOnCapabilities.cs @@ -25,17 +25,12 @@ public async Task AnalyzeWithFormulaExtraction() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - UrlSource = uriSource + Features = { DocumentAnalysisFeature.Formulas } }; - List features = new List - { - DocumentAnalysisFeature.Formulas - }; - - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -73,17 +68,12 @@ public async Task AnalyzeWithFontStyling() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() - { - UrlSource = uriSource - }; - - List features = new List + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - DocumentAnalysisFeature.StyleFont + Features = { DocumentAnalysisFeature.FontStyling } }; - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; // Handwritten styles @@ -236,17 +226,12 @@ public async Task AnalyzeWithBarcodeExtraction() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - UrlSource = uriSource + Features = { DocumentAnalysisFeature.Barcodes } }; - List features = new List - { - DocumentAnalysisFeature.Barcodes - }; - - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -286,17 +271,12 @@ public async Task AnalyzeWithLanguageDetection() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() - { - UrlSource = uriSource - }; - - List features = new List + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - DocumentAnalysisFeature.Languages + Features = { DocumentAnalysisFeature.Languages } }; - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine("----Languages detected in the document----"); @@ -328,17 +308,12 @@ public async Task AnalyzeWithKeyValuePairs() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() - { - UrlSource = uriSource - }; - - List features = new List + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - DocumentAnalysisFeature.KeyValuePairs + Features = { DocumentAnalysisFeature.KeyValuePairs } }; - var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, features: features); + var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine("----Key Value Pair Options detected in the document----"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleAnalyzeWithPrebuiltModelWithBase64.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromBytes.cs similarity index 81% rename from sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleAnalyzeWithPrebuiltModelWithBase64.cs rename to sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromBytes.cs index 15da927b6f89..09243ab4c3ea 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/SampleAnalyzeWithPrebuiltModelWithBase64.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromBytes.cs @@ -13,12 +13,12 @@ namespace Azure.AI.DocumentIntelligence.Samples public partial class DocumentIntelligenceSamples { [RecordedTest] - public async Task AnalyzeWithPrebuiltModelWithBase64Async() + public async Task AnalyzeWithPrebuiltModelFromBytesAsync() { string endpoint = TestEnvironment.Endpoint; var client = new DocumentIntelligenceClient(new Uri(endpoint), TestEnvironment.Credential); - #region Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelWithBase64Async + #region Snippet:DocumentIntelligenceAnalyzeWithPrebuiltModelFromBytesAsync #if SNIPPET string filePath = ""; #else @@ -26,12 +26,8 @@ public async Task AnalyzeWithPrebuiltModelWithBase64Async() #endif byte[] fileBytes = File.ReadAllBytes(filePath); - var content = new AnalyzeDocumentContent() - { - Base64Source = BinaryData.FromBytes(fileBytes) - }; - - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); + BinaryData bytesSource = BinaryData.FromBytes(fileBytes); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", bytesSource); AnalyzeResult result = operation.Value; // To see the list of all the supported fields returned by service and its corresponding types for the @@ -45,39 +41,39 @@ public async Task AnalyzeWithPrebuiltModelWithBase64Async() AnalyzedDocument document = result.Documents[i]; if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField) - && vendorNameField.Type == DocumentFieldType.String) + && vendorNameField.FieldType == DocumentFieldType.String) { string vendorName = vendorNameField.ValueString; Console.WriteLine($"Vendor Name: '{vendorName}', with confidence {vendorNameField.Confidence}"); } if (document.Fields.TryGetValue("CustomerName", out DocumentField customerNameField) - && customerNameField.Type == DocumentFieldType.String) + && customerNameField.FieldType == DocumentFieldType.String) { string customerName = customerNameField.ValueString; Console.WriteLine($"Customer Name: '{customerName}', with confidence {customerNameField.Confidence}"); } if (document.Fields.TryGetValue("Items", out DocumentField itemsField) - && itemsField.Type == DocumentFieldType.List) + && itemsField.FieldType == DocumentFieldType.List) { foreach (DocumentField itemField in itemsField.ValueList) { Console.WriteLine("Item:"); - if (itemField.Type == DocumentFieldType.Dictionary) + if (itemField.FieldType == DocumentFieldType.Dictionary) { IReadOnlyDictionary itemFields = itemField.ValueDictionary; if (itemFields.TryGetValue("Description", out DocumentField itemDescriptionField) - && itemDescriptionField.Type == DocumentFieldType.String) + && itemDescriptionField.FieldType == DocumentFieldType.String) { string itemDescription = itemDescriptionField.ValueString; Console.WriteLine($" Description: '{itemDescription}', with confidence {itemDescriptionField.Confidence}"); } if (itemFields.TryGetValue("Amount", out DocumentField itemAmountField) - && itemAmountField.Type == DocumentFieldType.Currency) + && itemAmountField.FieldType == DocumentFieldType.Currency) { CurrencyValue itemAmount = itemAmountField.ValueCurrency; Console.WriteLine($" Amount: '{itemAmount.CurrencySymbol}{itemAmount.Amount}', with confidence {itemAmountField.Confidence}"); @@ -87,21 +83,21 @@ public async Task AnalyzeWithPrebuiltModelWithBase64Async() } if (document.Fields.TryGetValue("SubTotal", out DocumentField subTotalField) - && subTotalField.Type == DocumentFieldType.Currency) + && subTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue subTotal = subTotalField.ValueCurrency; Console.WriteLine($"Sub Total: '{subTotal.CurrencySymbol}{subTotal.Amount}', with confidence {subTotalField.Confidence}"); } if (document.Fields.TryGetValue("TotalTax", out DocumentField totalTaxField) - && totalTaxField.Type == DocumentFieldType.Currency) + && totalTaxField.FieldType == DocumentFieldType.Currency) { CurrencyValue totalTax = totalTaxField.ValueCurrency; Console.WriteLine($"Total Tax: '{totalTax.CurrencySymbol}{totalTax.Amount}', with confidence {totalTaxField.Confidence}"); } if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField) - && invoiceTotalField.Type == DocumentFieldType.Currency) + && invoiceTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency; Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}', with confidence {invoiceTotalField.Confidence}"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromUri.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromUri.cs index 9c7538a11187..da1ce0c4edd6 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromUri.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_AnalyzeWithPrebuiltModelFromUri.cs @@ -23,13 +23,7 @@ public async Task AnalyzeWithPrebuiltModelFromUriAsync() #else Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - - var content = new AnalyzeDocumentContent() - { - UrlSource = uriSource - }; - - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", uriSource); AnalyzeResult result = operation.Value; // To see the list of all the supported fields returned by service and its corresponding types for the @@ -43,39 +37,39 @@ public async Task AnalyzeWithPrebuiltModelFromUriAsync() AnalyzedDocument document = result.Documents[i]; if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField) - && vendorNameField.Type == DocumentFieldType.String) + && vendorNameField.FieldType == DocumentFieldType.String) { string vendorName = vendorNameField.ValueString; Console.WriteLine($"Vendor Name: '{vendorName}', with confidence {vendorNameField.Confidence}"); } if (document.Fields.TryGetValue("CustomerName", out DocumentField customerNameField) - && customerNameField.Type == DocumentFieldType.String) + && customerNameField.FieldType == DocumentFieldType.String) { string customerName = customerNameField.ValueString; Console.WriteLine($"Customer Name: '{customerName}', with confidence {customerNameField.Confidence}"); } if (document.Fields.TryGetValue("Items", out DocumentField itemsField) - && itemsField.Type == DocumentFieldType.List) + && itemsField.FieldType == DocumentFieldType.List) { foreach (DocumentField itemField in itemsField.ValueList) { Console.WriteLine("Item:"); - if (itemField.Type == DocumentFieldType.Dictionary) + if (itemField.FieldType == DocumentFieldType.Dictionary) { IReadOnlyDictionary itemFields = itemField.ValueDictionary; if (itemFields.TryGetValue("Description", out DocumentField itemDescriptionField) - && itemDescriptionField.Type == DocumentFieldType.String) + && itemDescriptionField.FieldType == DocumentFieldType.String) { string itemDescription = itemDescriptionField.ValueString; Console.WriteLine($" Description: '{itemDescription}', with confidence {itemDescriptionField.Confidence}"); } if (itemFields.TryGetValue("Amount", out DocumentField itemAmountField) - && itemAmountField.Type == DocumentFieldType.Currency) + && itemAmountField.FieldType == DocumentFieldType.Currency) { CurrencyValue itemAmount = itemAmountField.ValueCurrency; Console.WriteLine($" Amount: '{itemAmount.CurrencySymbol}{itemAmount.Amount}', with confidence {itemAmountField.Confidence}"); @@ -85,21 +79,21 @@ public async Task AnalyzeWithPrebuiltModelFromUriAsync() } if (document.Fields.TryGetValue("SubTotal", out DocumentField subTotalField) - && subTotalField.Type == DocumentFieldType.Currency) + && subTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue subTotal = subTotalField.ValueCurrency; Console.WriteLine($"Sub Total: '{subTotal.CurrencySymbol}{subTotal.Amount}', with confidence {subTotalField.Confidence}"); } if (document.Fields.TryGetValue("TotalTax", out DocumentField totalTaxField) - && totalTaxField.Type == DocumentFieldType.Currency) + && totalTaxField.FieldType == DocumentFieldType.Currency) { CurrencyValue totalTax = totalTaxField.ValueCurrency; Console.WriteLine($"Total Tax: '{totalTax.CurrencySymbol}{totalTax.Amount}', with confidence {totalTaxField.Confidence}"); } if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField) - && invoiceTotalField.Type == DocumentFieldType.Currency) + && invoiceTotalField.FieldType == DocumentFieldType.Currency) { CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency; Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}', with confidence {invoiceTotalField.Confidence}"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildCustomModelAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildCustomModelAsync.cs index 1988e301887a..cc23be6b4bdd 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildCustomModelAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildCustomModelAsync.cs @@ -37,19 +37,17 @@ public async Task BuildCustomModelAsync() // build modes and their differences, see: // https://aka.ms/azsdk/formrecognizer/buildmode - var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) - { - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) - }; + var blobSource = new BlobContentSource(blobContainerUri); + var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource); - Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); + Operation operation = await client.BuildDocumentModelAsync(WaitUntil.Completed, options); DocumentModelDetails model = operation.Value; Console.WriteLine($"Model ID: {model.ModelId}"); Console.WriteLine($"Created on: {model.CreatedOn}"); Console.WriteLine("Document types the model can recognize:"); - foreach (KeyValuePair docType in model.DocTypes) + foreach (KeyValuePair docType in model.DocumentTypes) { Console.WriteLine($" Document type: '{docType.Key}', which has the following fields:"); foreach (KeyValuePair schema in docType.Value.FieldSchema) diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildDocumentClassifierAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildDocumentClassifierAsync.cs index 55d793d53563..543d86e9195c 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildDocumentClassifierAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_BuildDocumentClassifierAsync.cs @@ -32,26 +32,26 @@ public async Task BuildDocumentClassifierAsync() string classifierId = Guid.NewGuid().ToString(); Uri blobContainerUri = new Uri(TestEnvironment.ClassifierTrainingSasUrl); #endif - var sourceA = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; - var sourceB = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; - var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; + var sourceA = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; + var sourceB = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; + var docTypeA = new ClassifierDocumentTypeDetails(sourceA); + var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; - var content = new BuildDocumentClassifierContent(classifierId, docTypes); + var options = new BuildClassifierOptions(classifierId, docTypes); - Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, content); + Operation operation = await client.BuildClassifierAsync(WaitUntil.Completed, options); DocumentClassifierDetails classifier = operation.Value; Console.WriteLine($"Classifier ID: {classifier.ClassifierId}"); Console.WriteLine($"Created on: {classifier.CreatedOn}"); Console.WriteLine("Document types the classifier can recognize:"); - foreach (KeyValuePair docType in classifier.DocTypes) + foreach (KeyValuePair docType in classifier.DocumentTypes) { Console.WriteLine($" {docType.Key}"); } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ClassifyDocumentFromUriAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ClassifyDocumentFromUriAsync.cs index 77f8e090e5b0..b843b33aa5ea 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ClassifyDocumentFromUriAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ClassifyDocumentFromUriAsync.cs @@ -21,24 +21,24 @@ public async Task ClassifyDocumentFromUriAsync() string setupClassifierId = Guid.NewGuid().ToString(); Uri blobContainerUri = new Uri(TestEnvironment.ClassifierTrainingSasUrl); - var sourceA = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; - var sourceB = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; - var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; + var sourceA = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; + var sourceB = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; + var docTypeA = new ClassifierDocumentTypeDetails(sourceA); + var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; - var buildContent = new BuildDocumentClassifierContent(setupClassifierId, docTypes); + var buildOptions = new BuildClassifierOptions(setupClassifierId, docTypes); // Firstly, create a document classifier we can use to classify the custom document. Note that // classifiers can also be built using a graphical user interface such as the Document Intelligence // Studio found here: // https://aka.ms/azsdk/formrecognizer/formrecognizerstudio - await adminClient.BuildClassifierAsync(WaitUntil.Completed, buildContent); + await adminClient.BuildClassifierAsync(WaitUntil.Completed, buildOptions); // Proceed with the document classification. @@ -51,19 +51,16 @@ public async Task ClassifyDocumentFromUriAsync() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("IRS-1040_2.pdf"); #endif - var content = new ClassifyDocumentContent() - { - UrlSource = uriSource - }; + var options = new ClassifyDocumentOptions(classifierId, uriSource); - Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, classifierId, content); + Operation operation = await client.ClassifyDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine($"Input was classified by the classifier with ID '{result.ModelId}'."); foreach (AnalyzedDocument document in result.Documents) { - Console.WriteLine($"Found a document of type: {document.DocType}"); + Console.WriteLine($"Found a document of type: {document.DocumentType}"); } #endregion diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ComposeModelAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ComposeModelAsync.cs index 245798e26acd..e37b90493cd1 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ComposeModelAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ComposeModelAsync.cs @@ -29,13 +29,13 @@ public async Task ComposeModelAsync() string officeSuppliesModelId = Guid.NewGuid().ToString(); Uri officeSuppliesUri = new Uri(TestEnvironment.BlobContainerSasUrl); #endif - var officeSuppliesContent = new BuildDocumentModelContent(officeSuppliesModelId, DocumentBuildMode.Template) + var officeSuppliesSource = new BlobContentSource(officeSuppliesUri); + var officeSuppliesOptions = new BuildDocumentModelOptions(officeSuppliesModelId, DocumentBuildMode.Template, officeSuppliesSource) { - AzureBlobSource = new AzureBlobContentSource(officeSuppliesUri), Description = "Purchase order - Office supplies" }; - Operation officeSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeSuppliesContent); + Operation officeSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeSuppliesOptions); DocumentModelDetails officeSuppliesModel = officeSuppliesOperation.Value; #if SNIPPET @@ -45,13 +45,13 @@ public async Task ComposeModelAsync() string officeEquipmentModelId = Guid.NewGuid().ToString(); Uri officeEquipmentUri = new Uri(TestEnvironment.BlobContainerSasUrl); #endif - var officeEquipmentContent = new BuildDocumentModelContent(officeEquipmentModelId, DocumentBuildMode.Template) + var officeEquipmentSource = new BlobContentSource(officeEquipmentUri); + var officeEquipmentOptions = new BuildDocumentModelOptions(officeEquipmentModelId, DocumentBuildMode.Template, officeEquipmentSource) { - AzureBlobSource = new AzureBlobContentSource(officeEquipmentUri), Description = "Purchase order - Office Equipment" }; - Operation officeEquipmentOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeEquipmentContent); + Operation officeEquipmentOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, officeEquipmentOptions); DocumentModelDetails officeEquipmentModel = officeEquipmentOperation.Value; #if SNIPPET @@ -61,13 +61,13 @@ public async Task ComposeModelAsync() string furnitureModelId = Guid.NewGuid().ToString(); Uri furnitureUri = new Uri(TestEnvironment.BlobContainerSasUrl); #endif - var furnitureContent = new BuildDocumentModelContent(furnitureModelId, DocumentBuildMode.Template) + var furnitureSource = new BlobContentSource(furnitureUri); + var furnitureOptions = new BuildDocumentModelOptions(furnitureModelId, DocumentBuildMode.Template, furnitureSource) { - AzureBlobSource = new AzureBlobContentSource(furnitureUri), Description = "Purchase order - Furniture" }; - Operation furnitureOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, furnitureContent); + Operation furnitureOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, furnitureOptions); DocumentModelDetails furnitureModel = furnitureOperation.Value; #if SNIPPET @@ -77,13 +77,13 @@ public async Task ComposeModelAsync() string cleaningSuppliesModelId = Guid.NewGuid().ToString(); Uri cleaningSuppliesUri = new Uri(TestEnvironment.BlobContainerSasUrl); #endif - var cleaningSuppliesContent = new BuildDocumentModelContent(cleaningSuppliesModelId, DocumentBuildMode.Template) + var cleaningSuppliesSource = new BlobContentSource(cleaningSuppliesUri); + var cleaningSuppliesOptions = new BuildDocumentModelOptions(cleaningSuppliesModelId, DocumentBuildMode.Template, cleaningSuppliesSource) { - AzureBlobSource = new AzureBlobContentSource(cleaningSuppliesUri), Description = "Purchase order - Cleaning Supplies" }; - Operation cleaningSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, cleaningSuppliesContent); + Operation cleaningSuppliesOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, cleaningSuppliesOptions); DocumentModelDetails cleaningSuppliesModel = cleaningSuppliesOperation.Value; #endregion @@ -106,7 +106,7 @@ public async Task ComposeModelAsync() { "furniture", new DocumentTypeDetails() { ModelId = furnitureModelId } }, { "cleaningSupplies", new DocumentTypeDetails() { ModelId = cleaningSuppliesModelId } } }; - var purchaseOrderContent = new ComposeDocumentModelContent(purchaseOrderModelId, classifierId, docTypes) + var purchaseOrderOptions = new ComposeModelOptions(purchaseOrderModelId, classifierId, docTypes) { Description = "Composed Purchase order" }; @@ -114,7 +114,7 @@ public async Task ComposeModelAsync() #if !SNIPPET await BuildClassifierAsync(client, classifierId); #endif - Operation purchaseOrderOperation = await client.ComposeModelAsync(WaitUntil.Completed, purchaseOrderContent); + Operation purchaseOrderOperation = await client.ComposeModelAsync(WaitUntil.Completed, purchaseOrderOptions); DocumentModelDetails purchaseOrderModel = purchaseOrderOperation.Value; Console.WriteLine($"Model ID: {purchaseOrderModel.ModelId}"); @@ -138,19 +138,19 @@ public async Task BuildClassifierAsync(DocumentIntelligenceAdministrationClient { Uri blobContainerUri = new Uri(TestEnvironment.ClassifierTrainingSasUrl); - var sourceA = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; - var sourceB = new AzureBlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; - var docTypeA = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceA }; - var docTypeB = new ClassifierDocumentTypeDetails() { AzureBlobSource = sourceB }; + var sourceA = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-A/train" }; + var sourceB = new BlobContentSource(blobContainerUri) { Prefix = "IRS-1040-B/train" }; + var docTypeA = new ClassifierDocumentTypeDetails(sourceA); + var docTypeB = new ClassifierDocumentTypeDetails(sourceB); var docTypes = new Dictionary() { { "IRS-1040-A", docTypeA }, { "IRS-1040-B", docTypeB } }; - var buildContent = new BuildDocumentClassifierContent(classifierId, docTypes); + var buildOptions = new BuildClassifierOptions(classifierId, docTypes); - await client.BuildClassifierAsync(WaitUntil.Completed, buildContent); + await client.BuildClassifierAsync(WaitUntil.Completed, buildOptions); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_CopyModelToAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_CopyModelToAsync.cs index eef61ad2e2f3..75f526052dbd 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_CopyModelToAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_CopyModelToAsync.cs @@ -29,12 +29,10 @@ public async Task CopyModelToAsync() string setupModelId = Guid.NewGuid().ToString(); Uri blobContainerUri = new Uri(TestEnvironment.BlobContainerSasUrl); - var buildContent = new BuildDocumentModelContent(setupModelId, DocumentBuildMode.Template) - { - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) - }; + var blobSource = new BlobContentSource(blobContainerUri); + var buildOptions = new BuildDocumentModelOptions(setupModelId, DocumentBuildMode.Template, blobSource); - await sourceClient.BuildDocumentModelAsync(WaitUntil.Completed, buildContent); + await sourceClient.BuildDocumentModelAsync(WaitUntil.Completed, buildOptions); #region Snippet:DocumentIntelligenceSampleCreateCopyTargetClient #if SNIPPET @@ -53,8 +51,8 @@ public async Task CopyModelToAsync() #else string targetModelId = Guid.NewGuid().ToString(); #endif - var authorizeCopyContent = new AuthorizeCopyContent(targetModelId); - CopyAuthorization copyAuthorization = await targetClient.AuthorizeModelCopyAsync(authorizeCopyContent); + var authorizeCopyOptions = new AuthorizeModelCopyOptions(targetModelId); + ModelCopyAuthorization copyAuthorization = await targetClient.AuthorizeModelCopyAsync(authorizeCopyOptions); #endregion #region Snippet:DocumentIntelligenceSampleCreateCopyModel diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutAsMarkdownAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutAsMarkdownAsync.cs index d55a20f520d4..e895be4f281b 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutAsMarkdownAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutAsMarkdownAsync.cs @@ -23,12 +23,12 @@ public async Task ExtractLayoutAsMarkdownAsync() Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - var content = new AnalyzeDocumentContent() + var options = new AnalyzeDocumentOptions("prebuilt-layout", uriSource) { - UrlSource = uriSource + OutputContentFormat = DocumentContentFormat.Markdown }; - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, outputContentFormat: ContentFormat.Markdown); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, options); AnalyzeResult result = operation.Value; Console.WriteLine(result.Content); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutFromUriAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutFromUriAsync.cs index e0f2c50c906e..ef4d5222feed 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutFromUriAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ExtractLayoutFromUriAsync.cs @@ -23,13 +23,7 @@ public async Task ExtractLayoutFromUriAsync() #else Uri uriSource = DocumentIntelligenceTestEnvironment.CreateUri("Form_1.jpg"); #endif - - var content = new AnalyzeDocumentContent() - { - UrlSource = uriSource - }; - - Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content); + Operation operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", uriSource); AnalyzeResult result = operation.Value; foreach (DocumentPage page in result.Pages) @@ -96,8 +90,8 @@ public async Task ExtractLayoutFromUriAsync() foreach (DocumentSpan span in style.Spans) { - var handwrittenContent = result.Content.Substring(span.Offset, span.Length); - Console.WriteLine($" {handwrittenContent}"); + var handwrittenOptions = result.Content.Substring(span.Offset, span.Length); + Console.WriteLine($" {handwrittenOptions}"); } } } diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_GetAndListOperationsAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_GetAndListOperationsAsync.cs index 0b70ff07dfb8..19306bbe3f7d 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_GetAndListOperationsAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_GetAndListOperationsAsync.cs @@ -18,12 +18,10 @@ public async Task GetAndListOperationsAsync() // Build a custom model to make sure that there is at least one operation. string modelId = Guid.NewGuid().ToString(); Uri blobContainerUri = new Uri(TestEnvironment.BlobContainerSasUrl); - var content = new BuildDocumentModelContent(modelId, DocumentBuildMode.Template) - { - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) - }; + var blobSource = new BlobContentSource(blobContainerUri); + var options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource); - Operation buildOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, content); + Operation buildOperation = await client.BuildDocumentModelAsync(WaitUntil.Completed, options); #region Snippet:DocumentIntelligenceSampleGetAndListOperations // Get an operation by ID. @@ -32,9 +30,9 @@ public async Task GetAndListOperationsAsync() #else string operationId = buildOperation.Id; #endif - OperationDetails operationDetails = await client.GetOperationAsync(operationId); + DocumentIntelligenceOperationDetails operationDetails = await client.GetOperationAsync(operationId); - if (operationDetails.Status == OperationStatus.Succeeded) + if (operationDetails.Status == DocumentIntelligenceOperationStatus.Succeeded) { Console.WriteLine($"Operation with ID '{operationDetails.OperationId}' has succeeded."); @@ -56,9 +54,13 @@ public async Task GetAndListOperationsAsync() case DocumentClassifierBuildOperationDetails classifierOperation: Console.WriteLine($"Classifier ID: {classifierOperation.Result.ClassifierId}"); break; + + case DocumentClassifierCopyToOperationDetails classifierOperation: + Console.WriteLine($"Classifier ID: {classifierOperation.Result.ClassifierId}"); + break; } } - else if (operationDetails.Status == OperationStatus.Failed) + else if (operationDetails.Status == DocumentIntelligenceOperationStatus.Failed) { Console.WriteLine($"Operation with ID '{operationDetails.OperationId}' has failed."); Console.WriteLine($"Error code: {operationDetails.Error.Code}"); @@ -72,7 +74,7 @@ public async Task GetAndListOperationsAsync() // List up to 10 operations that have been executed in the last 24 hours. int count = 0; - await foreach (OperationDetails operationItem in client.GetOperationsAsync()) + await foreach (DocumentIntelligenceOperationDetails operationItem in client.GetOperationsAsync()) { Console.WriteLine($"Operation details:"); Console.WriteLine($" Operation ID: {operationItem.OperationId}"); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ManageModelsAsync.cs b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ManageModelsAsync.cs index e5c84bf6d705..efb2d6dee377 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ManageModelsAsync.cs +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/samples/Sample_ManageModelsAsync.cs @@ -18,18 +18,16 @@ public async Task ManageModelsAsync() // Build to make sure that there is at least one custom model. string setupModelId = Guid.NewGuid().ToString(); Uri blobContainerUri = new Uri(TestEnvironment.BlobContainerSasUrl); - var content = new BuildDocumentModelContent(setupModelId, DocumentBuildMode.Template) - { - AzureBlobSource = new AzureBlobContentSource(blobContainerUri) - }; + var blobSource = new BlobContentSource(blobContainerUri); + var options = new BuildDocumentModelOptions(setupModelId, DocumentBuildMode.Template, blobSource); - await client.BuildDocumentModelAsync(WaitUntil.Completed, content); + await client.BuildDocumentModelAsync(WaitUntil.Completed, options); #region Snippet:DocumentIntelligenceSampleManageModelsAsync // Check number of custom models in the Document Intelligence resource, and the maximum number // of custom models that can be stored. - ResourceDetails resourceDetails = await client.GetResourceInfoAsync(); + DocumentIntelligenceResourceDetails resourceDetails = await client.GetResourceDetailsAsync(); Console.WriteLine($"Resource has {resourceDetails.CustomDocumentModels.Count} custom models."); Console.WriteLine($"It can have at most {resourceDetails.CustomDocumentModels.Limit} custom models."); diff --git a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml index 66ce35132bd2..34d76f338750 100644 --- a/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml +++ b/sdk/documentintelligence/Azure.AI.DocumentIntelligence/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/ai/DocumentIntelligence -commit: ec2a81edaecf3970e5938936e8256759905163e6 +commit: 28a0baf2c401a0b9bf839688c4d235398868835e repo: Azure/azure-rest-api-specs diff --git a/sdk/documentintelligence/test-resources.json b/sdk/documentintelligence/test-resources.json index 877bb5d5260a..9be82b93941f 100644 --- a/sdk/documentintelligence/test-resources.json +++ b/sdk/documentintelligence/test-resources.json @@ -42,6 +42,14 @@ "type": "string", "defaultValue": "training-data-classifier" }, + "batchSourceContainer": { + "type": "string", + "defaultValue": "trainingdata-batch" + }, + "batchResultContainer": { + "type": "string", + "defaultValue": "trainingdata-batch-result" + }, "trainingDataResourceId": { "type": "string", "defaultValue": "[resourceId('static-test-resources', 'Microsoft.Storage/storageAccounts', parameters('trainingDataAccount'))]" @@ -63,6 +71,24 @@ "signedPermission": "rl", "signedResource": "c" } + }, + "batchSourceSasProperties": { + "type": "object", + "defaultValue": { + "canonicalizedResource": "[concat('/blob/', parameters('trainingDataAccount'), '/', parameters('batchSourceContainer'))]", + "signedExpiry": "[dateTimeAdd(utcNow('u'), 'PT2H')]", + "signedPermission": "rwdl", + "signedResource": "c" + } + }, + "batchResultSasProperties": { + "type": "object", + "defaultValue": { + "canonicalizedResource": "[concat('/blob/', parameters('trainingDataAccount'), '/', parameters('batchResultContainer'))]", + "signedExpiry": "[dateTimeAdd(utcNow('u'), 'PT2H')]", + "signedPermission": "rwdl", + "signedResource": "c" + } } }, "variables": { @@ -118,6 +144,14 @@ "CLASSIFIER_BLOB_CONTAINER_SAS_URL": { "type": "string", "value": "[concat(reference(parameters('trainingDataResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('classifierTrainingDataContainer'), '?', listServiceSas(parameters('trainingDataResourceId'), '2019-06-01', parameters('classifierTrainingSasProperties')).serviceSasToken)]" + }, + "BATCH_SOURCE_BLOB_CONTAINER_SAS_URL": { + "type": "string", + "value": "[concat(reference(parameters('trainingDataResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('batchSourceContainer'), '?', listServiceSas(parameters('trainingDataResourceId'), '2019-06-01', parameters('batchSourceSasProperties')).serviceSasToken)]" + }, + "BATCH_RESULT_BLOB_CONTAINER_SAS_URL": { + "type": "string", + "value": "[concat(reference(parameters('trainingDataResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('batchResultContainer'), '?', listServiceSas(parameters('trainingDataResourceId'), '2019-06-01', parameters('batchResultSasProperties')).serviceSasToken)]" } } } diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/CHANGELOG.md b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/CHANGELOG.md index 88800a10e5f8..1f3e08ce8146 100644 --- a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/CHANGELOG.md +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/CHANGELOG.md @@ -85,4 +85,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/README.md b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/README.md index 0476147e1129..f6218888d21e 100644 --- a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/README.md +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/README.md b/sdk/easm/Azure.Analytics.Defender.Easm/README.md index 30db42d815b1..3e895427e6f2 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/README.md +++ b/sdk/easm/Azure.Analytics.Defender.Easm/README.md @@ -174,7 +174,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.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/easm/Azure.Analytics.Defender.Easm/README.png) diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/samples/README.md b/sdk/easm/Azure.Analytics.Defender.Easm/samples/README.md index c5f2ec5b02f9..e4a24fb2d600 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/samples/README.md +++ b/sdk/easm/Azure.Analytics.Defender.Easm/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.Analytics.Defender.Easm samples for .NET description: Samples for the Azure.Analytics.Defender.Easm client library. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml b/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml index 904af13f7b12..506ec154280a 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/riskiq/Easm -commit: 31cfd1dac13409c3b6915c24344a4995b61a4f50 +commit: 823fa0c70ae5dc9d4693f65dde6b5e943e8183b4 repo: Azure/azure-rest-api-specs diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/CHANGELOG.md b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/CHANGELOG.md index d16780db67fa..c4bd94ce7933 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/CHANGELOG.md +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/CHANGELOG.md @@ -51,7 +51,7 @@ Polishing since last public beta release: - Prepended `EdgeOrder` prefix to all single / simple model names. - Corrected the format of all `Guid` type properties / parameters. - Corrected the format of all `ResourceIdentifier` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Optimized the name of some models and functions. ### Other Changes @@ -106,4 +106,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/README.md b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/README.md index d97ee890d8e4..889a7e749ea4 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/README.md +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/edgezones/Azure.ResourceManager.EdgeZones/CHANGELOG.md b/sdk/edgezones/Azure.ResourceManager.EdgeZones/CHANGELOG.md index cac8b01b0c80..a5cdfd0123d4 100644 --- a/sdk/edgezones/Azure.ResourceManager.EdgeZones/CHANGELOG.md +++ b/sdk/edgezones/Azure.ResourceManager.EdgeZones/CHANGELOG.md @@ -26,4 +26,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/edgezones/Azure.ResourceManager.EdgeZones/README.md b/sdk/edgezones/Azure.ResourceManager.EdgeZones/README.md index ca1190517572..5f33a74d7e94 100644 --- a/sdk/edgezones/Azure.ResourceManager.EdgeZones/README.md +++ b/sdk/edgezones/Azure.ResourceManager.EdgeZones/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/CHANGELOG.md b/sdk/elastic/Azure.ResourceManager.Elastic/CHANGELOG.md index d139ea90367c..078002092211 100644 --- a/sdk/elastic/Azure.ResourceManager.Elastic/CHANGELOG.md +++ b/sdk/elastic/Azure.ResourceManager.Elastic/CHANGELOG.md @@ -69,4 +69,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/README.md b/sdk/elastic/Azure.ResourceManager.Elastic/README.md index 3641e4b1eb0f..6b8ae8aeba98 100644 --- a/sdk/elastic/Azure.ResourceManager.Elastic/README.md +++ b/sdk/elastic/Azure.ResourceManager.Elastic/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md index 8f8a5b6e0c3c..53fbe59bc1d2 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md @@ -107,4 +107,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/README.md b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/README.md index f6a383b72717..db0d39350721 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/README.md +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md b/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md index 49b43e7fe27a..4f688226f52c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.md @@ -1,6 +1,6 @@ # Azure Event Grid client library for .NET -Azure Event Grid allows you to easily build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source, to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://docs.microsoft.com/azure/event-grid/overview) +Azure Event Grid allows you to easily build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source, to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://learn.microsoft.com/azure/event-grid/overview) Use the client library for Azure Event Grid to: - Publish events to Event Grid topics using the Cloud Event schema @@ -20,19 +20,19 @@ dotnet add package Azure.Messaging.EventGrid.Namespaces ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://docs.microsoft.com/cli/azure). +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://learn.microsoft.com/cli/azure). ### Authenticate the client In order for the client library to interact with a topic or domain, you will need the `endpoint` of the Event Grid topic and a `credential`, which can be created using the topic's access key. -You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://docs.microsoft.com/cli/azure) snippet below. +You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://learn.microsoft.com/cli/azure) snippet below. ```bash az eventgrid topic show --name --resource-group --query "endpoint" ``` -The access key can also be found through the [portal](https://docs.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: +The access key can also be found through the [portal](https://learn.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: ```bash az eventgrid topic key list --name --resource-group --query "key1" ``` @@ -103,7 +103,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.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/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md index e1cd3c91bb69..9d996a9de982 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md @@ -1,6 +1,6 @@ # Azure Event Grid System Events client library for .NET -Azure Event Grid allows you to build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://docs.microsoft.com/azure/event-grid/overview) +Azure Event Grid allows you to build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://learn.microsoft.com/azure/event-grid/overview) Use the client library for Azure Event Grid System Events to: - Deserialize Event Grid system events into strongly typed models. @@ -19,13 +19,13 @@ dotnet add package Azure.Messaging.EventGrid.SystemEvents --prerelease ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://docs.microsoft.com/cli/azure). +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://learn.microsoft.com/cli/azure). ### Receiving and Deserializing Events -There are several different Azure services that act as [event handlers](https://docs.microsoft.com/azure/event-grid/event-handlers). +There are several different Azure services that act as [event handlers](https://learn.microsoft.com/azure/event-grid/event-handlers). -Note: if using Webhooks for event delivery of the *Event Grid schema*, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint, as seen below. Learn more about completing the handshake here: [Webhook event delivery](https://docs.microsoft.com/azure/event-grid/webhook-event-delivery). For the *CloudEvents schema*, the service validates the connection using the HTTP options method. Learn more here: [CloudEvents validation](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). +Note: if using Webhooks for event delivery of the *Event Grid schema*, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint, as seen below. Learn more about completing the handshake here: [Webhook event delivery](https://learn.microsoft.com/azure/event-grid/webhook-event-delivery). For the *CloudEvents schema*, the service validates the connection using the HTTP options method. Learn more here: [CloudEvents validation](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). Once events are delivered to the event handler, we can deserialize the JSON payload into a list of events. @@ -157,7 +157,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.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/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/README.md b/sdk/eventgrid/Azure.Messaging.EventGrid/README.md index bcd4a092e289..045ccfe7329f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/README.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/README.md @@ -1,13 +1,13 @@ # Azure Event Grid client library for .NET -Azure Event Grid allows you to easily build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source, to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://docs.microsoft.com/azure/event-grid/overview) +Azure Event Grid allows you to easily build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source, to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://learn.microsoft.com/azure/event-grid/overview) Use the client library for Azure Event Grid to: - Publish events to the Event Grid service using the Event Grid Event, Cloud Event 1.0, or custom schemas - Consume events that have been delivered to event handlers - Generate SAS tokens to authenticate the client publishing events to Azure Event Grid topics - [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Messaging.EventGrid/) | [API reference documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventgrid) | [Product documentation](https://docs.microsoft.com/azure/event-grid/) | [Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventgrid/Azure.Messaging.EventGrid/samples) | [Migration guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventgrid/Azure.Messaging.EventGrid/MigrationGuide.md) + [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Messaging.EventGrid/) | [API reference documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventgrid) | [Product documentation](https://learn.microsoft.com/azure/event-grid/) | [Samples](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventgrid/Azure.Messaging.EventGrid/samples) | [Migration guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventgrid/Azure.Messaging.EventGrid/MigrationGuide.md) ## Getting started @@ -21,19 +21,19 @@ dotnet add package Azure.Messaging.EventGrid ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://docs.microsoft.com/cli/azure). +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://learn.microsoft.com/cli/azure). ### Authenticate the Client In order for the client library to interact with a topic or domain, you will need the `endpoint` of the Event Grid topic and a `credential`, which can be created using the topic's access key. -You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://docs.microsoft.com/cli/azure) snippet below. +You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://learn.microsoft.com/cli/azure) snippet below. ```bash az eventgrid topic show --name --resource-group --query "endpoint" ``` -The access key can also be found through the [portal](https://docs.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: +The access key can also be found through the [portal](https://learn.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: ```bash az eventgrid topic key list --name --resource-group --query "key1" ``` @@ -82,7 +82,7 @@ EventGridPublisherClient client = new EventGridPublisherClient( ## Key concepts -For information about general Event Grid concepts: [Concepts in Azure Event Grid](https://docs.microsoft.com/azure/event-grid/concepts). +For information about general Event Grid concepts: [Concepts in Azure Event Grid](https://learn.microsoft.com/azure/event-grid/concepts). ### EventGridPublisherClient A **publisher** sends events to the Event Grid service. Microsoft publishes events for several Azure services. You can publish events from your own application using the `EventGridPublisherClient`. @@ -91,10 +91,10 @@ A **publisher** sends events to the Event Grid service. Microsoft publishes even An **event** is the smallest amount of information that fully describes something that happened in the system. Event Grid supports multiple schemas for encoding events. When a custom topic or domain is created, you specify the schema that will be used when publishing events. #### Event Grid schema -While you may configure your topic to use a custom schema, it is more common to use the already-defined Event Grid schema. See the specifications and requirements [here](https://docs.microsoft.com/azure/event-grid/event-schema). +While you may configure your topic to use a custom schema, it is more common to use the already-defined Event Grid schema. See the specifications and requirements [here](https://learn.microsoft.com/azure/event-grid/event-schema). #### CloudEvents v1.0 schema -Another option is to use the CloudEvents v1.0 schema. [CloudEvents](https://cloudevents.io/) is a Cloud Native Computing Foundation project which produces a specification for describing event data in a common way. The service summary of CloudEvents can be found [here](https://docs.microsoft.com/azure/event-grid/cloud-event-schema). +Another option is to use the CloudEvents v1.0 schema. [CloudEvents](https://cloudevents.io/) is a Cloud Native Computing Foundation project which produces a specification for describing event data in a common way. The service summary of CloudEvents can be found [here](https://learn.microsoft.com/azure/event-grid/cloud-event-schema). Regardless of what schema your topic or domain is configured to use, `EventGridPublisherClient` will be used to publish events to it. Use the `SendEvents` or `SendEventsAsync` method for publishing. @@ -250,9 +250,9 @@ await client.SendEventsAsync(eventsList); ``` ### Receiving and Deserializing Events -There are several different Azure services that act as [event handlers](https://docs.microsoft.com/azure/event-grid/event-handlers). +There are several different Azure services that act as [event handlers](https://learn.microsoft.com/azure/event-grid/event-handlers). -Note: if using Webhooks for event delivery of the *Event Grid schema*, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint, as seen below. Learn more about completing the handshake here: [Webhook event delivery](https://docs.microsoft.com/azure/event-grid/webhook-event-delivery). For the *CloudEvents schema*, the service validates the connection using the HTTP options method. Learn more here: [CloudEvents validation](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). +Note: if using Webhooks for event delivery of the *Event Grid schema*, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint, as seen below. Learn more about completing the handshake here: [Webhook event delivery](https://learn.microsoft.com/azure/event-grid/webhook-event-delivery). For the *CloudEvents schema*, the service validates the connection using the HTTP options method. Learn more here: [CloudEvents validation](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). Once events are delivered to the event handler, we can deserialize the JSON payload into a list of events. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample2_PublishEventsToDomain.md b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample2_PublishEventsToDomain.md index 34b0960d4c8c..9db37a60510d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample2_PublishEventsToDomain.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample2_PublishEventsToDomain.md @@ -6,7 +6,7 @@ This sample demonstrates how to publish Event Grid schema events to an Event Gri To begin, create an Event Grid domain that accepts events of the Event Grid schema. An *event domain* is a management tool for large numbers of Event Grid topics related to the same application. You can think of it as a meta-topic that can have thousands of individual topics. -See the this [step-by-step tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart-portal#create-a-custom-topic) for instructions on creating custom topics using Azure Portal; however, instead of searching for "Event Grid Topics", search for "Event Grid Domains". When you create an event domain, you're given a publishing endpoint and access key similar to if you had created a topic in Event Grid. +See the this [step-by-step tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart-portal#create-a-custom-topic) for instructions on creating custom topics using Azure Portal; however, instead of searching for "Event Grid Topics", search for "Event Grid Domains". When you create an event domain, you're given a publishing endpoint and access key similar to if you had created a topic in Event Grid. ## Create and Authenticate `EventGridPublisherClient` diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md index 70ad8c64d685..895af4ee3ffe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/samples/Sample3_ParseAndDeserializeEvents.md @@ -1,8 +1,8 @@ # Deserializing Events Delivered to Event Handlers -This sample will demonstrate how to deserialize events that have been delivered to event handlers. There are several different Azure services that act as [event handlers](https://docs.microsoft.com/azure/event-grid/event-handlers). Regardless of the event handler, however, events are always sent as UTF-8 encoded JSON. +This sample will demonstrate how to deserialize events that have been delivered to event handlers. There are several different Azure services that act as [event handlers](https://learn.microsoft.com/azure/event-grid/event-handlers). Regardless of the event handler, however, events are always sent as UTF-8 encoded JSON. -Note: if using Webhooks for event delivery of the *Event Grid schema*, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint, as seen below. Learn more about completing the handshake here: [Webhook event delivery](https://docs.microsoft.com/azure/event-grid/webhook-event-delivery). For the *CloudEvents schema*, the service validates the connection using the HTTP options method. Learn more here: [CloudEvents validation](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). +Note: if using Webhooks for event delivery of the *Event Grid schema*, Event Grid requires you to prove ownership of your Webhook endpoint before it starts delivering events to that endpoint. At the time of event subscription creation, Event Grid sends a subscription validation event to your endpoint, as seen below. Learn more about completing the handshake here: [Webhook event delivery](https://learn.microsoft.com/azure/event-grid/webhook-event-delivery). For the *CloudEvents schema*, the service validates the connection using the HTTP options method. Learn more here: [CloudEvents validation](https://github.com/cloudevents/spec/blob/v1.0/http-webhook.md#4-abuse-protection). Handling events will be different based on which schema the event was delivered as. However, the general pattern will remain the same: - Parse events from JSON into individual events. Based on the event schema (Event Grid or CloudEvents 1.0), you can now access basic information about the event on the envelope (properties that are present for all events, like event time and type). diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.ResourceManager.EventGrid/CHANGELOG.md index 22b8157ba98e..8086d65c0d62 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/CHANGELOG.md @@ -125,4 +125,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/README.md b/sdk/eventgrid/Azure.ResourceManager.EventGrid/README.md index 5f80f032c275..6569ef538372 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/README.md +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md b/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md index 2f0a557afbc1..a25ab02fc29e 100644 --- a/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md +++ b/sdk/eventgrid/Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents/README.md @@ -14,19 +14,19 @@ dotnet add package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://docs.microsoft.com/cli/azure). +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://learn.microsoft.com/cli/azure). ### Authenticate the client In order for the client library to interact with a topic or domain, you will need the `endpoint` of the Event Grid topic and a `credential`, which can be created using the topic's access key. -You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://docs.microsoft.com/cli/azure) snippet below. +You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://learn.microsoft.com/cli/azure) snippet below. ```bash az eventgrid topic show --name --resource-group --query "endpoint" ``` -The access key can also be found through the [portal](https://docs.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: +The access key can also be found through the [portal](https://learn.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: ```bash az eventgrid topic key list --name --resource-group --query "key1" ``` @@ -42,7 +42,7 @@ EventGridPublisherClient client = new EventGridPublisherClient( ## Key concepts -For information about general Event Grid concepts: [Concepts in Azure Event Grid](https://docs.microsoft.com/azure/event-grid/concepts). +For information about general Event Grid concepts: [Concepts in Azure Event Grid](https://learn.microsoft.com/azure/event-grid/concepts). For detailed information about the Event Grid client library concepts: [Event Grid Client Library](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid#key-concepts) diff --git a/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md b/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md index 5a00ea531dea..507b11a09c1f 100644 --- a/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md +++ b/sdk/eventgrid/Microsoft.Azure.WebJobs.Extensions.EventGrid/README.md @@ -14,19 +14,19 @@ dotnet add package Microsoft.Azure.WebJobs.Extensions.EventGrid ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://docs.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://docs.microsoft.com/cli/azure). +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a custom Event Grid topic or domain. Follow this [step-by-step tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart-portal) to register the Event Grid resource provider and create Event Grid topics using the [Azure portal](https://portal.azure.com/). There is a [similar tutorial](https://learn.microsoft.com/azure/event-grid/custom-event-quickstart) using [Azure CLI](https://learn.microsoft.com/cli/azure). ### Authenticate the Client In order for the extension publish events, you will need the `endpoint` of the Event Grid topic and a `credential`, which can be created using the topic's access key. -You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://docs.microsoft.com/cli/azure) snippet below. +You can find the endpoint for your Event Grid topic either in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://learn.microsoft.com/cli/azure) snippet below. ```bash az eventgrid topic show --name --resource-group --query "endpoint" ``` -The access key can also be found through the [portal](https://docs.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: +The access key can also be found through the [portal](https://learn.microsoft.com/azure/event-grid/get-access-keys), or by using the Azure CLI snippet below: ```bash az eventgrid topic key list --name --resource-group --query "key1" ``` @@ -35,11 +35,11 @@ az eventgrid topic key list --name --resource-group [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.EventGrid/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventGrid/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.EventGrid +[docs]: https://learn.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.EventGrid [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/eventgrid/README.md b/sdk/eventgrid/README.md index 06de8ed17263..f70341ad018e 100644 --- a/sdk/eventgrid/README.md +++ b/sdk/eventgrid/README.md @@ -1,6 +1,6 @@ # Azure Event Grid libraries for .NET -Azure Event Grid allows you to build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source, to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://docs.microsoft.com/azure/event-grid/overview) +Azure Event Grid allows you to build applications with event-based architectures. The Event Grid service fully manages all routing of events from any source, to any destination, for any application. Azure service events and custom events can be published directly to the service, where the events can then be filtered and sent to various recipients, such as built-in handlers or custom webhooks. To learn more about Azure Event Grid: [What is Event Grid?](https://learn.microsoft.com/azure/event-grid/overview) ## Libraries for data access @@ -14,7 +14,7 @@ Use the following packages to publish and consume events from Event Grid: | Nuget Package | Reference | Samples | |--------------------------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------| -| [Azure.Messaging.EventGrid](https://www.nuget.org/packages/Azure.Messaging.EventGrid) | [API Reference for Azure.Messaging.EventGrid](https://docs.microsoft.com/dotnet/api/azure.messaging.eventgrid?view=azure-dotnet) | [Samples for Azure.Messaging.EventGrid](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid/samples) | +| [Azure.Messaging.EventGrid](https://www.nuget.org/packages/Azure.Messaging.EventGrid) | [API Reference for Azure.Messaging.EventGrid](https://learn.microsoft.com/dotnet/api/azure.messaging.eventgrid?view=azure-dotnet) | [Samples for Azure.Messaging.EventGrid](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid/samples) | ### `Microsoft.Azure.EventGrid` @@ -22,7 +22,7 @@ Use the following legacy packages to publish and consume events from Event Grid: | Nuget Package | Reference | Samples | |--------------------------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------| -| [Microsoft.Azure.EventGrid](https://www.nuget.org/packages/Microsoft.Azure.EventGrid) | [API Reference for Microsoft.Azure.EventGrid](https://docs.microsoft.com/dotnet/api/microsoft.azure.eventgrid?view=azure-dotnet) | [Samples for Azure.Messaging.EventGrid](https://github.com/Azure-Samples/event-grid-dotnet-publish-consume-events/tree/master/) | +| [Microsoft.Azure.EventGrid](https://www.nuget.org/packages/Microsoft.Azure.EventGrid) | [API Reference for Microsoft.Azure.EventGrid](https://learn.microsoft.com/dotnet/api/microsoft.azure.eventgrid?view=azure-dotnet) | [Samples for Azure.Messaging.EventGrid](https://github.com/Azure-Samples/event-grid-dotnet-publish-consume-events/tree/master/) | ## Libraries for resource management diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md index dedf8d02c896..2e392a4e9af4 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md @@ -570,9 +570,9 @@ Thank you to our developer community members who helped to make the Event Hubs c - Load balancing will now detect when it has reached a balanced state more accurately; this will allow it to operate more efficiently when `LoadBalancingStrategy.Greedy` is in use. -- The `EventProcessorClient` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorClientOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). +- The `EventProcessorClient` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorClientOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). -- The `EventProcessorClientOptions` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions?view=azure-dotnet). +- The `EventProcessorClientOptions` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions?view=azure-dotnet). - Connection strings for each of the clients now supports a `SharedAccessSignature` token, allowing a pre-generated SAS to be used for authorization. @@ -621,9 +621,9 @@ Thank you to our developer community members who helped to make the Event Hubs c #### Processing events -- The `EventProcessorClient` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorClientOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). +- The `EventProcessorClient` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorClientOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). -- The `EventProcessorClientOptions` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions?view=azure-dotnet). +- The `EventProcessorClientOptions` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions?view=azure-dotnet). #### Bug fixes and foundation diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.net8.0.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.net8.0.cs index 681137633b6d..efc7c767e2f8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.net8.0.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.net8.0.cs @@ -38,6 +38,8 @@ public EventProcessorClient(Azure.Storage.Blobs.BlobContainerClient checkpointSt [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } protected override System.Threading.Tasks.Task ValidateProcessingPreconditions(System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -71,6 +73,8 @@ public BlobCheckpointStore(Azure.Storage.Blobs.BlobContainerClient blobContainer public override System.Threading.Tasks.Task> ClaimOwnershipAsync(System.Collections.Generic.IEnumerable desiredOwnership, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.Task GetCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.Task> ListOwnershipAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] public override System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.netstandard2.0.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.netstandard2.0.cs index 681137633b6d..efc7c767e2f8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.netstandard2.0.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/api/Azure.Messaging.EventHubs.Processor.netstandard2.0.cs @@ -38,6 +38,8 @@ public EventProcessorClient(Azure.Storage.Blobs.BlobContainerClient checkpointSt [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } protected override System.Threading.Tasks.Task ValidateProcessingPreconditions(System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -71,6 +73,8 @@ public BlobCheckpointStore(Azure.Storage.Blobs.BlobContainerClient blobContainer public override System.Threading.Tasks.Task> ClaimOwnershipAsync(System.Collections.Generic.IEnumerable desiredOwnership, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.Task GetCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.Task> ListOwnershipAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] public override System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md index d53cb5b42835..52b41ee0210a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample01_HelloWorld.md @@ -76,7 +76,7 @@ Now that the events have been published, we'll process them using the `EventProc The `EventProcessorClient` is associated with a specific Event Hub and [consumer group](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#consumer-groups). Conceptually, the consumer group is a label that identifies one or more event consumers as a set. Often, consumer groups are named after the responsibility of the consumer in an application, such as "Telemetry" or "OrderProcessing". When an Event Hub is created, a default consumer group is created for it. The default group, named "$Default", is what we'll be using for illustration. -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://learn.microsoft.com/azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. Each `EventProcessorClient` has its own full view of the events each partition of an Event Hub, meaning that events are available to all processors and are not removed from the partition when a processor reads them. This allows for one or more of the different Event Hub clients to read and process events from the partition at different speeds and beginning with different events without interfering with one another. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md index 17864c4779d2..c93de39bc96a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample04_ProcessingEvents.md @@ -25,7 +25,7 @@ The `EventProcessorClient` is safe to cache and use for the lifetime of the appl ## Event lifetime -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age greater than the [retention period](https://learn.microsoft.com/azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ## Processing and consumer groups diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_MockingClientTypes.md b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_MockingClientTypes.md index 8207da4d3aed..9f83dce7b8b1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_MockingClientTypes.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples/Sample08_MockingClientTypes.md @@ -49,7 +49,7 @@ EventData eventData = EventHubsModelFactory.EventData( systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:1:3344.1", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); // This creates a new instance of ProcessEventArgs to pass into the handler directly. @@ -110,7 +110,7 @@ TimerCallback dispatchEvent = async _ => systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:1:1111", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); ProcessEventArgs eventArgs = new( diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj index 8d86942d6405..0dee15d11d0f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Azure.Messaging.EventHubs.Processor.csproj @@ -2,7 +2,7 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This library extends its Event Processor with durable storage for checkpoint information using Azure Blob storage. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ 5.12.0-beta.2 - + 5.11.5 Azure;Event Hubs;EventHubs;.NET;Event Processor;EventProcessor;$(PackageCommonTags) $(RequiredTargetFrameworks) @@ -16,7 +16,9 @@ - + + + diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobCheckpointStoreInternal.Diagnostics.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobCheckpointStoreInternal.Diagnostics.cs index a9e370843ac6..20db8c05e4fe 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobCheckpointStoreInternal.Diagnostics.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobCheckpointStoreInternal.Diagnostics.cs @@ -97,7 +97,6 @@ partial void InvalidCheckpointFound(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with the checkpoint. - /// The replication segment associated with the checkpoint. /// The offset associated with the checkpoint. /// The exception that occurred. /// @@ -107,10 +106,9 @@ partial void UpdateCheckpointError(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset, Exception exception) => - Logger.UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, exception.Message, sequenceNumber, replicationSegment, offset); + Logger.UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, exception.Message, sequenceNumber, offset); /// /// Indicates that an attempt to update a checkpoint has completed. @@ -122,7 +120,6 @@ partial void UpdateCheckpointError(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// partial void UpdateCheckpointComplete(string partitionId, @@ -131,9 +128,8 @@ partial void UpdateCheckpointComplete(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset) => - Logger.UpdateCheckpointComplete(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, replicationSegment, offset); + Logger.UpdateCheckpointComplete(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, offset); /// /// Indicates that an attempt to create/update a checkpoint has started. @@ -145,7 +141,6 @@ partial void UpdateCheckpointComplete(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// partial void UpdateCheckpointStart(string partitionId, @@ -154,9 +149,8 @@ partial void UpdateCheckpointStart(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset) => - Logger.UpdateCheckpointStart(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, replicationSegment, offset); + Logger.UpdateCheckpointStart(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, offset); /// /// Indicates that an attempt to retrieve claim partition ownership has completed. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobEventStoreEventSource.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobEventStoreEventSource.cs index b68614332fee..73af92afcc38 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobEventStoreEventSource.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobEventStoreEventSource.cs @@ -254,22 +254,20 @@ public virtual void OwnershipClaimed(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// - [Event(32, Level = EventLevel.Verbose, Message = "Starting to create/update a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'; ClientIdentifier: '{4}'; at SequenceNumber: '{5}' ReplicationSegment: '{6}' Offset: '{7}'.")] + [Event(32, Level = EventLevel.Verbose, Message = "Starting to create/update a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'; ClientIdentifier: '{4}'; at SequenceNumber: '{5}' Offset: '{6}'.")] public virtual void UpdateCheckpointStart(string partitionId, string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset) { if (IsEnabled()) { - WriteEvent(32, partitionId ?? string.Empty, fullyQualifiedNamespace ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, clientIdentifier ?? string.Empty, sequenceNumber ?? string.Empty, replicationSegment ?? string.Empty, offset ?? string.Empty); + WriteEvent(32, partitionId ?? string.Empty, fullyQualifiedNamespace ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, clientIdentifier ?? string.Empty, sequenceNumber ?? string.Empty, offset ?? string.Empty); } } @@ -283,22 +281,20 @@ public virtual void UpdateCheckpointStart(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// - [Event(33, Level = EventLevel.Verbose, Message = "Completed the attempt to create/update a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'; ClientIdentifier: '{4}'; at SequenceNumber: '{5}' ReplicationSegment: '{6}' Offset: '{7}'.")] + [Event(33, Level = EventLevel.Verbose, Message = "Completed the attempt to create/update a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'; ClientIdentifier: '{4}'; at SequenceNumber: '{5}' Offset: '{6}'.")] public virtual void UpdateCheckpointComplete(string partitionId, string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset) { if (IsEnabled()) { - WriteEvent(33, partitionId ?? string.Empty, fullyQualifiedNamespace ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, clientIdentifier ?? string.Empty, sequenceNumber ?? string.Empty, replicationSegment ?? string.Empty, offset ?? string.Empty); + WriteEvent(33, partitionId ?? string.Empty, fullyQualifiedNamespace ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, clientIdentifier ?? string.Empty, sequenceNumber ?? string.Empty, offset ?? string.Empty); } } @@ -312,11 +308,10 @@ public virtual void UpdateCheckpointComplete(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the processor that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// The message for the exception that occurred. /// - [Event(34, Level = EventLevel.Error, Message = "An exception occurred when creating/updating a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'; ClientIdentifier: '{5}'; at SequenceNumber: '{6}' ReplicationSegment '{7}' Offset '{8}'. ErrorMessage: '{4}'.")] + [Event(34, Level = EventLevel.Error, Message = "An exception occurred when creating/updating a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'; ErrorMessage: '{4}'; ClientIdentifier: '{5}'; at SequenceNumber: '{6}' Offset '{7}'.")] public virtual void UpdateCheckpointError(string partitionId, string fullyQualifiedNamespace, string eventHubName, @@ -324,12 +319,11 @@ public virtual void UpdateCheckpointError(string partitionId, string clientIdentifier, string errorMessage, string sequenceNumber, - string replicationSegment, string offset) { if (IsEnabled()) { - WriteEvent(34, partitionId ?? string.Empty, fullyQualifiedNamespace ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, errorMessage ?? string.Empty, clientIdentifier ?? string.Empty, sequenceNumber ?? string.Empty, replicationSegment ?? string.Empty, offset ?? string.Empty); + WriteEvent(34, partitionId ?? string.Empty, fullyQualifiedNamespace ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, errorMessage ?? string.Empty, clientIdentifier ?? string.Empty, sequenceNumber ?? string.Empty, offset ?? string.Empty); } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/EventProcessorClientEventSource.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/EventProcessorClientEventSource.cs index d22b36948279..da596dbb8688 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/EventProcessorClientEventSource.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/EventProcessorClientEventSource.cs @@ -120,16 +120,20 @@ public virtual void EventBatchProcessingError(string partitionId, /// A unique name used to identify the event processor. /// The name of the Event Hub that the processor is associated with. /// The name of the consumer group that the processor is associated with. + /// The sequence number associated with the checkpoint being written. + /// The offset associated with the checkpoint being written. /// - [Event(23, Level = EventLevel.Verbose, Message = "Starting to perform a checkpoint update for partition '{0}' by processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3}.")] + [Event(23, Level = EventLevel.Verbose, Message = "Starting to perform a checkpoint update for partition '{0}' by processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3} Sequence Number: {4} Offset {5}.")] public virtual void UpdateCheckpointStart(string partitionId, string identifier, string eventHubName, - string consumerGroup) + string consumerGroup, + string sequenceNumber, + string offset) { if (IsEnabled()) { - WriteEvent(23, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); + WriteEvent(23, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, sequenceNumber ?? string.Empty, offset ?? string.Empty); } } @@ -141,16 +145,20 @@ public virtual void UpdateCheckpointStart(string partitionId, /// A unique name used to identify the event processor. /// The name of the Event Hub that the processor is associated with. /// The name of the consumer group that the processor is associated with. + /// The sequence number associated with the checkpoint being written. + /// The offset associated with the checkpoint being written. /// - [Event(24, Level = EventLevel.Verbose, Message = "Completed performing a checkpoint update for partition '{0}' by processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3}.")] + [Event(24, Level = EventLevel.Verbose, Message = "Completed performing a checkpoint update for partition '{0}' by processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3} Sequence Number: {4} Offset: {5}.")] public virtual void UpdateCheckpointComplete(string partitionId, string identifier, string eventHubName, - string consumerGroup) + string consumerGroup, + string sequenceNumber, + string offset) { if (IsEnabled()) { - WriteEvent(24, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty); + WriteEvent(24, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, sequenceNumber ?? string.Empty, offset ?? string.Empty); } } @@ -163,17 +171,21 @@ public virtual void UpdateCheckpointComplete(string partitionId, /// The name of the Event Hub that the processor is associated with. /// The name of the consumer group that the processor is associated with. /// The message for the exception that occurred. + /// The sequence number associated with the checkpoint being written. + /// The offset associated with the checkpoint being written. /// - [Event(25, Level = EventLevel.Error, Message = "An exception occurred while attempting to perform a checkpoint update for partition '{0}' by processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3}. Error Message: '{4}'")] + [Event(25, Level = EventLevel.Error, Message = "An exception occurred while attempting to perform a checkpoint update for partition '{0}' by processor instance with identifier '{1}' for Event Hub: {2} and Consumer Group: {3}. Error Message: '{4}. Sequence Number: {5} Offset: {6}'")] public virtual void UpdateCheckpointError(string partitionId, string identifier, string eventHubName, string consumerGroup, - string errorMessage) + string errorMessage, + string sequenceNumber, + string offset) { if (IsEnabled()) { - WriteEvent(25, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, errorMessage ?? string.Empty); + WriteEvent(25, partitionId ?? string.Empty, identifier ?? string.Empty, eventHubName ?? string.Empty, consumerGroup ?? string.Empty, errorMessage ?? string.Empty, sequenceNumber ?? string.Empty, offset ?? string.Empty); } } @@ -363,11 +375,72 @@ private unsafe void WriteEvent(int eventId, eventPayload[4].Size = (arg5.Length + 1) * sizeof(char); eventPayload[4].DataPointer = (IntPtr)arg5Ptr; - eventPayload[5].Size = (arg5.Length + 1) * sizeof(char); - eventPayload[5].DataPointer = (IntPtr)arg5Ptr; + eventPayload[5].Size = (arg6.Length + 1) * sizeof(char); + eventPayload[5].DataPointer = (IntPtr)arg6Ptr; WriteEventCore(eventId, 6, eventPayload); } } + + /// + /// Writes an event with five string arguments into a stack allocated + /// struct to avoid the parameter array allocation on the WriteEvent methods. + /// + /// + /// The identifier of the event. + /// The first argument. + /// The second argument. + /// The third argument. + /// The fourth argument. + /// The fifth argument. + /// The sixth argument. + /// The seventh argument. + /// + [NonEvent] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = EventSourceSuppressMessage)] + private unsafe void WriteEvent(int eventId, + string arg1, + string arg2, + string arg3, + string arg4, + string arg5, + string arg6, + string arg7) + { + fixed (char* arg1Ptr = arg1) + fixed (char* arg2Ptr = arg2) + fixed (char* arg3Ptr = arg3) + fixed (char* arg4Ptr = arg4) + fixed (char* arg5Ptr = arg5) + fixed (char* arg6Ptr = arg6) + fixed (char* arg7Ptr = arg7) + { + var eventPayload = stackalloc EventData[7]; + + eventPayload[0].Size = (arg1.Length + 1) * sizeof(char); + eventPayload[0].DataPointer = (IntPtr)arg1Ptr; + + eventPayload[1].Size = (arg2.Length + 1) * sizeof(char); + eventPayload[1].DataPointer = (IntPtr)arg2Ptr; + + eventPayload[2].Size = (arg3.Length + 1) * sizeof(char); + eventPayload[2].DataPointer = (IntPtr)arg3Ptr; + + eventPayload[3].Size = (arg4.Length + 1) * sizeof(char); + eventPayload[3].DataPointer = (IntPtr)arg4Ptr; + + eventPayload[4].Size = (arg5.Length + 1) * sizeof(char); + eventPayload[4].DataPointer = (IntPtr)arg5Ptr; + + eventPayload[5].Size = (arg6.Length + 1) * sizeof(char); + eventPayload[5].DataPointer = (IntPtr)arg6Ptr; + + eventPayload[6].Size = (arg7.Length + 1) * sizeof(char); + eventPayload[6].DataPointer = (IntPtr)arg7Ptr; + + WriteEventCore(eventId, 7, eventPayload); + } + } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs index 6366e98724bb..c967c8e4a5bd 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs @@ -902,15 +902,23 @@ protected override async Task ValidateProcessingPreconditions(CancellationToken } /// + /// Obsolete. + /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream /// that an event processor should begin reading from. /// /// /// The identifier of the partition the checkpoint is for. - /// The offset to associate with the checkpoint, intended as informational metadata. This will only be used for positioning if there is no value provided for . + /// The offset to associate with the checkpoint, intended as informational metadata. This will only be used from positioning if there is no value provided for . /// The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream. /// A instance to signal a request to cancel the operation. /// + /// + /// This method is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetUpdateCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] protected override Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, @@ -919,14 +927,16 @@ protected override Task UpdateCheckpointAsync(string partitionId, cancellationToken.ThrowIfCancellationRequested(); Argument.AssertNotNull(partitionId, nameof(partitionId)); - Logger.UpdateCheckpointStart(partitionId, Identifier, EventHubName, ConsumerGroup); + var offsetString = offset.ToString(CultureInfo.InvariantCulture); + Logger.UpdateCheckpointStart(partitionId, Identifier, EventHubName, ConsumerGroup, sequenceNumber?.ToString(CultureInfo.InvariantCulture), offsetString); using var scope = ClientDiagnostics.CreateScope(DiagnosticProperty.EventProcessorCheckpointActivityName, ActivityKind.Internal); scope.Start(); try { - return CheckpointStore.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, partitionId, offset, sequenceNumber, cancellationToken); + var checkpointPosition = new CheckpointPosition(offsetString, sequenceNumber ?? long.MinValue); + return CheckpointStore.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, partitionId, Identifier, checkpointPosition, cancellationToken); } catch (Exception ex) { @@ -934,13 +944,13 @@ protected override Task UpdateCheckpointAsync(string partitionId, // be thrown directly to the caller here. scope.Failed(ex); - Logger.UpdateCheckpointError(partitionId, Identifier, EventHubName, ConsumerGroup, ex.Message); + Logger.UpdateCheckpointError(partitionId, Identifier, EventHubName, ConsumerGroup, ex.Message, sequenceNumber?.ToString(CultureInfo.InvariantCulture), offsetString); throw; } finally { - Logger.UpdateCheckpointComplete(partitionId, Identifier, EventHubName, ConsumerGroup); + Logger.UpdateCheckpointComplete(partitionId, Identifier, EventHubName, ConsumerGroup, sequenceNumber?.ToString(CultureInfo.InvariantCulture), offset.ToString(CultureInfo.InvariantCulture)); } } @@ -960,9 +970,19 @@ protected override Task UpdateCheckpointAsync(string partitionId, cancellationToken.ThrowIfCancellationRequested(); Argument.AssertNotNull(partitionId, nameof(partitionId)); - Argument.AssertAtLeast(startingPosition.SequenceNumber, 0, nameof(startingPosition.SequenceNumber)); + if (string.IsNullOrEmpty(startingPosition.OffsetString)) + { + if (EventHubProperties?.IsGeoReplicationEnabled ?? false) + { + var message = string.Format(CultureInfo.InvariantCulture, Resources.ProcessorAttemptingToWriteCheckpointWithoutOffset); + var updateCheckpointException = new EventHubsException(true, EventHubName, message, EventHubsException.FailureReason.GeneralError); + _ = InvokeOnProcessingErrorAsync(updateCheckpointException, Resources.OperationEventProcessingLoop, CancellationToken.None); + } - Logger.UpdateCheckpointStart(partitionId, Identifier, EventHubName, ConsumerGroup); + Argument.AssertAtLeast(startingPosition.SequenceNumber, 0, nameof(startingPosition.SequenceNumber)); + } + + Logger.UpdateCheckpointStart(partitionId, Identifier, EventHubName, ConsumerGroup, startingPosition.SequenceNumber.ToString(CultureInfo.InvariantCulture), startingPosition.OffsetString); using var scope = ClientDiagnostics.CreateScope(DiagnosticProperty.EventProcessorCheckpointActivityName, ActivityKind.Internal); scope.Start(); @@ -977,16 +997,29 @@ protected override Task UpdateCheckpointAsync(string partitionId, // be thrown directly to the caller here. scope.Failed(ex); - Logger.UpdateCheckpointError(partitionId, Identifier, EventHubName, ConsumerGroup, ex.Message); + Logger.UpdateCheckpointError(partitionId, Identifier, EventHubName, ConsumerGroup, ex.Message, startingPosition.SequenceNumber.ToString(CultureInfo.InvariantCulture), startingPosition.OffsetString); throw; } finally { - Logger.UpdateCheckpointComplete(partitionId, Identifier, EventHubName, ConsumerGroup); + Logger.UpdateCheckpointComplete(partitionId, Identifier, EventHubName, ConsumerGroup, startingPosition.SequenceNumber.ToString(), startingPosition.OffsetString); } } + /// + /// Performs the tasks needed invoke the method in the background, + /// as it is intended to be a fire-and-forget operation. + /// + /// + /// The exception that occurred during operation of the event processor. + /// A short textual description of the operation during which the exception occurred; intended to be informational only. + /// A instance to signal the request to cancel the processing. + /// + private Task InvokeOnProcessingErrorAsync(Exception exception, + string operationDescription, + CancellationToken cancellationToken) => Task.Run(() => OnProcessingErrorAsync(exception, null, operationDescription, cancellationToken), CancellationToken.None); + /// /// Creates an to use for communicating with the Event Hubs service. /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Primitives/BlobCheckpointStore.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Primitives/BlobCheckpointStore.cs index 78ae93f7f05d..dcaf741db69e 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Primitives/BlobCheckpointStore.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Primitives/BlobCheckpointStore.cs @@ -1,10 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; +using Azure.Messaging.EventHubs.Core; using Azure.Messaging.EventHubs.Processor; using Azure.Storage.Blobs; @@ -95,6 +98,8 @@ public override Task GetCheckpointAsync(string fullyQu CancellationToken cancellationToken) => _checkpointStoreImplementation.GetCheckpointAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, cancellationToken); /// + /// Obsolete. + /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream /// that an event processor should begin reading from. /// @@ -103,17 +108,23 @@ public override Task GetCheckpointAsync(string fullyQu /// The name of the specific Event Hub the ownership are associated with, relative to the Event Hubs namespace that contains it. /// The name of the consumer group the checkpoint is associated with. /// The identifier of the partition the checkpoint is for. - /// The offset to associate with the checkpoint, intended as informational metadata. This will only be used for positioning if there is no value provided for . + /// The offset to associate with the checkpoint, intended as informational metadata. This will only be used from positioning if there is no value provided for . /// The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream. /// A instance to signal a request to cancel the operation. /// + /// + /// This method is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetUpdateCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override Task UpdateCheckpointAsync(string fullyQualifiedNamespace, - string eventHubName, - string consumerGroup, - string partitionId, - long offset, - long? sequenceNumber, - CancellationToken cancellationToken) => _checkpointStoreImplementation.UpdateCheckpointAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, offset, sequenceNumber, cancellationToken); + string eventHubName, + string consumerGroup, + string partitionId, + long offset, + long? sequenceNumber, + CancellationToken cancellationToken) => _checkpointStoreImplementation.UpdateCheckpointAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, offset, sequenceNumber, cancellationToken); /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/BlobCheckpointStoreInternalDiagnosticsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/BlobCheckpointStoreInternalDiagnosticsTests.cs index 5957c12a03f1..39769026c832 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/BlobCheckpointStoreInternalDiagnosticsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/BlobCheckpointStoreInternalDiagnosticsTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Ignore Spelling: Etag + using System; using System.Collections.Generic; using System.IO; @@ -268,9 +270,10 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists() target.Logger = mockLog.Object; var expectedSequenceNumber = 0; - await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedSequenceNumber), CancellationToken.None); - mockLog.Verify(log => log.UpdateCheckpointStart(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequenceNumber.ToString(), "-1", string.Empty)); - mockLog.Verify(log => log.UpdateCheckpointComplete(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequenceNumber.ToString(), "-1", string.Empty)); + var expectedOffset = "10:1:9853.1"; + await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedOffset, expectedSequenceNumber), CancellationToken.None); + mockLog.Verify(log => log.UpdateCheckpointStart(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequenceNumber.ToString(), expectedOffset)); + mockLog.Verify(log => log.UpdateCheckpointComplete(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequenceNumber.ToString(), expectedOffset)); } /// @@ -296,11 +299,12 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobDoesNotExist() var mockLog = new Mock(); target.Logger = mockLog.Object; - var expectedSequenceNumber = 0; + var expectedOffset = "1:0:8833"; + var expectedSequence = 23432; - await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedSequenceNumber), CancellationToken.None); - mockLog.Verify(log => log.UpdateCheckpointStart(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequenceNumber.ToString(), "-1", string.Empty)); - mockLog.Verify(log => log.UpdateCheckpointComplete(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequenceNumber.ToString(), "-1", string.Empty)); + await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedOffset, expectedSequence), CancellationToken.None); + mockLog.Verify(log => log.UpdateCheckpointStart(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequence.ToString(), expectedOffset)); + mockLog.Verify(log => log.UpdateCheckpointComplete(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedSequence.ToString(), expectedOffset)); } /// @@ -324,8 +328,9 @@ public void UpdateCheckpointLogsErrorsWhenTheBlobExists() target.Logger = mockLog.Object; var expectedSequenceNumber = 456; - Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedSequenceNumber), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); - mockLog.Verify(log => log.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedException.Message, expectedSequenceNumber.ToString(), "-1", string.Empty)); + var expectedOffset = "404"; + Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedOffset, expectedSequenceNumber), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); + mockLog.Verify(log => log.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedException.Message, expectedSequenceNumber.ToString(), expectedOffset)); } /// @@ -348,8 +353,9 @@ public void UpdateCheckpointLogsErrorsWhenTheBlobDoesNotExist() target.Logger = mockLog.Object; var expectedSequenceNumber = 6; - Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedSequenceNumber), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); - mockLog.Verify(log => log.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedException.Message, expectedSequenceNumber.ToString(), "-1", string.Empty)); + var expectedOffset = "9"; + Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedOffset, expectedSequenceNumber), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); + mockLog.Verify(log => log.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, expectedException.Message, expectedSequenceNumber.ToString(), expectedOffset)); } /// @@ -367,8 +373,9 @@ public void UpdateCheckpointForMissingContainerLogsCheckpointUpdateError() target.Logger = mockLog.Object; var expectedSequenceNumber = 999; - Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedSequenceNumber), CancellationToken.None), Throws.InstanceOf()); - mockLog.Verify(m => m.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, ex.Message, expectedSequenceNumber.ToString(), "-1", string.Empty)); + var expectedOffset = "777"; + Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(expectedOffset, expectedSequenceNumber), CancellationToken.None), Throws.InstanceOf()); + mockLog.Verify(m => m.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, ex.Message, expectedSequenceNumber.ToString(), expectedOffset)); } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsActivitySourceTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsActivitySourceTests.cs index f7e802373165..e26c88dd1d63 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsActivitySourceTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsActivitySourceTests.cs @@ -73,13 +73,14 @@ public async Task CheckpointStoreActivitySourceDisabled() var mockLogger = new Mock(); mockLogger - .Setup(log => log.UpdateCheckpointComplete(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(log => log.UpdateCheckpointComplete(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Callback(() => completionSource.TrySetResult(true)); mockProcessor.Object.Logger = mockLogger.Object; using var listener = new TestActivitySourceListener(source => source.Name.StartsWith(DiagnosticProperty.DiagnosticNamespace)); - await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, 998, default); + await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, "998", default); + await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, "1:0:556", default); Assert.IsEmpty(listener.Activities); } @@ -106,7 +107,7 @@ public async Task UpdateCheckpointAsyncCreatesScope() .Returns(Mock.Of()); mockLogger - .Setup(log => log.UpdateCheckpointComplete(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(log => log.UpdateCheckpointComplete(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Callback(() => completionSource.TrySetResult(true)); mockProcessor.Object.Logger = mockLogger.Object; @@ -114,7 +115,7 @@ public async Task UpdateCheckpointAsyncCreatesScope() using var _ = SetAppConfigSwitch(); using var listener = new TestActivitySourceListener(source => source.Name.StartsWith(DiagnosticProperty.DiagnosticNamespace)); - await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, 998, default); + await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, "1:0:998", default); await Task.WhenAny(completionSource.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -141,8 +142,8 @@ public async Task EventProcessorClientCreatesScopeForEachEventProcessing() var enqueuedTime = DateTimeOffset.UtcNow; var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123, enqueuedTime: enqueuedTime), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456, enqueuedTime: enqueuedTime) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123, enqueuedTime: enqueuedTime), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456, enqueuedTime: enqueuedTime) }; for (int i = 0; i < eventBatch.Length; i++) @@ -199,8 +200,8 @@ public async Task EventProcessorClientCreatesScopeError() using var listener = new TestActivitySourceListener(source => source.Name.StartsWith(DiagnosticProperty.DiagnosticNamespace)); var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456) }; var mockLogger = new Mock(); @@ -252,8 +253,8 @@ public async Task EventProcessorClientCreatesScopeForEachEventProcessingWithoutR var enqueuedTime = DateTimeOffset.UtcNow; var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123, enqueuedTime: enqueuedTime), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456, enqueuedTime: enqueuedTime) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123, enqueuedTime: enqueuedTime), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456, enqueuedTime: enqueuedTime) }; var mockLogger = new Mock(); @@ -295,19 +296,38 @@ public async Task EventProcessorClientCreatesScopeForEachEventProcessingWithoutR /// The client whose method to invoke. /// The identifier of the partition the checkpoint is for. /// The offset to associate with the checkpoint, indicating that a processor should begin reading form the next event in the stream. - /// An optional sequence number to associate with the checkpoint, intended as informational metadata. The will be used for positioning when events are read. /// A instance to signal a request to cancel the operation. /// /// The translated options. /// private static Task InvokeUpdateCheckpointAsync(EventProcessorClient target, string partitionId, - long sequenceNumber, + string offset, CancellationToken cancellationToken) => (Task) typeof(EventProcessorClient) .GetMethod("UpdateCheckpointAsync", BindingFlags.Instance | BindingFlags.NonPublic, new Type[] { typeof(string), typeof(CheckpointPosition), typeof(CancellationToken) }) - .Invoke(target, new object[] { partitionId, new CheckpointPosition(sequenceNumber), cancellationToken }); + .Invoke(target, new object[] { partitionId, new CheckpointPosition(offset), cancellationToken }); + + /// + /// Invokes the protected UpdateCheckpointAsync method on the processor client. + /// + /// + /// The client whose method to invoke. + /// The identifier of the partition the checkpoint is for. + /// The offset to associate with the checkpoint, indicating that a processor should begin reading form the next event in the stream. + /// An optional sequence number to associate with the checkpoint, intended as informational metadata. The will be used for positioning when events are read. + /// A instance to signal a request to cancel the operation. + /// + private static Task InvokeOldUpdateCheckpointAsync(EventProcessorClient target, + string partitionId, + string offset, + long sequenceNumber, + CancellationToken cancellationToken) => + (Task) + typeof(EventProcessorClient) + .GetMethod("UpdateCheckpointAsync", BindingFlags.Instance | BindingFlags.NonPublic, new Type[] { typeof(string), typeof(string), typeof(long), typeof(CancellationToken) }) + .Invoke(target, new object[] { partitionId, offset, sequenceNumber, cancellationToken }); /// /// Sets and returns the app config switch to enable Activity Source. The switch must be disposed at the end of the test. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsTests.cs index 371ff6910b0f..2a7b79454404 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Diagnostics/DiagnosticsTests.cs @@ -62,13 +62,13 @@ public async Task UpdateCheckpointAsyncCreatesScope() .Returns(Mock.Of()); mockLogger - .Setup(log => log.UpdateCheckpointComplete(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(log => log.UpdateCheckpointComplete(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Callback(() => completionSource.TrySetResult(true)); mockProcessor.Object.Logger = mockLogger.Object; using var listener = new ClientDiagnosticListener(DiagnosticProperty.DiagnosticNamespace); - await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, 998, default); + await InvokeUpdateCheckpointAsync(mockProcessor.Object, mockContext.Object.PartitionId, "998", default); await Task.WhenAny(completionSource.Task, Task.Delay(Timeout.Infinite, cancellationSource.Token)); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -93,8 +93,8 @@ public async Task EventProcessorClientCreatesScopeForEachEventProcessing() var enqueuedTime = DateTimeOffset.UtcNow; var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123, enqueuedTime: enqueuedTime), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456, enqueuedTime: enqueuedTime) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123, enqueuedTime: enqueuedTime), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456, enqueuedTime: enqueuedTime) }; for (int i = 0; i < eventBatch.Length; i++) @@ -150,8 +150,8 @@ public async Task EventProcessorClientCreatesScopeError() using var listener = new ClientDiagnosticListener(DiagnosticProperty.DiagnosticNamespace); var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456) }; var mockLogger = new Mock(); @@ -199,8 +199,8 @@ public async Task EventProcessorClientCreatesScopeForEachEventProcessingWithoutR var enqueuedTime = DateTimeOffset.UtcNow; var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123, enqueuedTime: enqueuedTime), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456, enqueuedTime: enqueuedTime) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123, enqueuedTime: enqueuedTime), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456, enqueuedTime: enqueuedTime) }; var mockLogger = new Mock(); @@ -252,18 +252,17 @@ public void EventProcessorClientDisablesBaseBatchTracing() /// The client whose method to invoke. /// The identifier of the partition the checkpoint is for. /// The offset to associate with the checkpoint, indicating that a processor should begin reading form the next event in the stream. - /// An optional sequence number to associate with the checkpoint, intended as informational metadata. The will be used for positioning when events are read. /// A instance to signal a request to cancel the operation. /// /// The translated options. /// private static Task InvokeUpdateCheckpointAsync(EventProcessorClient target, string partitionId, - long sequenceNumber, + string offset, CancellationToken cancellationToken) => (Task) typeof(EventProcessorClient) .GetMethod("UpdateCheckpointAsync", BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof(string), typeof(CheckpointPosition), typeof(CancellationToken) }, null) - .Invoke(target, new object[] { partitionId, new CheckpointPosition(sequenceNumber), cancellationToken }); + .Invoke(target, new object[] { partitionId, new CheckpointPosition(offset), cancellationToken }); } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Primitives/BlobCheckpointStoreTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Primitives/BlobCheckpointStoreTests.cs index e2b474a33994..a59c921dd1ce 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Primitives/BlobCheckpointStoreTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Primitives/BlobCheckpointStoreTests.cs @@ -119,11 +119,11 @@ public async Task UpdateCheckpointAsyncDelegatesTheCall() var expectedConsumerGroup = "fakeGroup"; var expectedPartition = "fakePart"; var expectedProcessorId = "Id"; - var expectedSequence = 999; + var expectedOffset = "999"; var mockCheckpointStore = new Mock(); var blobCheckpointStore = new BlobCheckpointStore(mockCheckpointStore.Object); - await blobCheckpointStore.UpdateCheckpointAsync(expectedNamespace, expectedHub, expectedConsumerGroup, expectedPartition, expectedProcessorId, new CheckpointPosition(expectedSequence), cancellationSource.Token); + await blobCheckpointStore.UpdateCheckpointAsync(expectedNamespace, expectedHub, expectedConsumerGroup, expectedPartition, expectedProcessorId, new CheckpointPosition(expectedOffset), cancellationSource.Token); mockCheckpointStore.Verify(store => store.UpdateCheckpointAsync( expectedNamespace, @@ -132,39 +132,7 @@ public async Task UpdateCheckpointAsyncDelegatesTheCall() expectedPartition, expectedProcessorId, It.Is(csp => - csp.SequenceNumber == expectedSequence), - cancellationSource.Token), - Times.Once); - } - - /// - /// Verifies functionality of the - /// method. - /// - /// - [Test] - public async Task UpdateCheckpointAsyncOldOverloadDelegatesTheCall() - { - using var cancellationSource = new CancellationTokenSource(); - - var expectedNamespace = "fakeNS"; - var expectedHub = "fakeHub"; - var expectedConsumerGroup = "fakeGroup"; - var expectedPartition = "fakePart"; - var expectedOffset = 123; - var expectedSequence = 999; - var mockCheckpointStore = new Mock(); - var blobCheckpointStore = new BlobCheckpointStore(mockCheckpointStore.Object); - - await blobCheckpointStore.UpdateCheckpointAsync(expectedNamespace, expectedHub, expectedConsumerGroup, expectedPartition, expectedOffset, expectedSequence, cancellationSource.Token); - - mockCheckpointStore.Verify(store => store.UpdateCheckpointAsync( - expectedNamespace, - expectedHub, - expectedConsumerGroup, - expectedPartition, - expectedOffset, - expectedSequence, + csp.OffsetString == expectedOffset), cancellationSource.Token), Times.Once); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientLiveTests.cs index 1a505588d2fb..f6b5cb710543 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientLiveTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Ignore Spelling: Checkpointing + using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -391,7 +393,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() // Read the initial set back, marking the offset and sequence number of the last event in the initial set. - var startingOffset = 0L; + string startingOffset = null; await using (var consumer = new EventHubConsumerClient( scope.ConsumerGroups.First(), @@ -403,8 +405,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition() { if (partitionEvent.Data.IsEquivalentTo(lastSourceEvent)) { - startingOffset = partitionEvent.Data.Offset; - + startingOffset = partitionEvent.Data.OffsetString; break; } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientTests.cs index 3d31e9674b21..33ee543727b3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientTests.cs @@ -793,7 +793,7 @@ public async Task ProcessorRaisesInitializeEventHandlerWhenPartitionIsInitialize var capturedEventArgs = default(PartitionInitializingEventArgs); var partitionId = "0"; - var startingPosition = EventPosition.FromOffset(433); + var startingPosition = EventPosition.FromOffset("433"); var options = new EventProcessorOptions { DefaultStartingPosition = startingPosition }; var processorClient = new TestEventProcessorClient(Mock.Of(), "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), options); @@ -925,8 +925,8 @@ public async Task ProcessorRaisesProcessEventHandlerWhenEventsAreRead() var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456) }; var capturedEventArgs = new List(); @@ -1043,8 +1043,8 @@ public void EventProcessingToleratesAndSurfacesAnException() var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456) }; var invokeCount = 0; @@ -1089,7 +1089,7 @@ public async Task EventProcessingToleratesAndSurfacesMultipleExceptions() var eventBatch = Enumerable .Range(0, eventCount) - .Select(index => new MockEventData(Array.Empty(), offset: 1000 + index, sequenceNumber: 2000 + index)) + .Select(index => new MockEventData(Array.Empty(), offset: (1000 + index).ToString(), sequenceNumber: 2000 + index)) .ToList(); processorClient.ProcessEventAsync += eventArgs => @@ -1133,8 +1133,8 @@ public async Task EventProcessingLogsExecution() var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456) }; var partitionId = "3"; @@ -1179,8 +1179,8 @@ public async Task EventProcessingLogsExceptions() var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456) }; var partitionId = "3"; @@ -1218,10 +1218,10 @@ public async Task EventProcessingRespectsCancellation() var eventBatch = new[] { - new MockEventData(new byte[] { 0x11 }, offset: 123, sequenceNumber: 123), - new MockEventData(new byte[] { 0x22 }, offset: 456, sequenceNumber: 456), - new MockEventData(new byte[] { 0x33 }, offset: 789, sequenceNumber: 789), - new MockEventData(new byte[] { 0x44 }, offset: 000, sequenceNumber: 000) + new MockEventData(new byte[] { 0x11 }, offset: "123", sequenceNumber: 123), + new MockEventData(new byte[] { 0x22 }, offset: "456", sequenceNumber: 456), + new MockEventData(new byte[] { 0x33 }, offset: "789", sequenceNumber: 789), + new MockEventData(new byte[] { 0x44 }, offset: "000", sequenceNumber: 000) }; var processedEventsCount = 0; @@ -1291,7 +1291,7 @@ public async Task GetCheckpointIncludesInitializeEventHandlerStartingPositionWhe cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partitionId = "0"; - var startingPosition = EventPosition.FromOffset(433); + var startingPosition = EventPosition.FromOffset("433"); var options = new EventProcessorOptions { DefaultStartingPosition = EventPosition.Latest }; var mockCheckpointStore = new Mock(); var processorClient = new TestEventProcessorClient(mockCheckpointStore.Object, "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), options); @@ -1330,7 +1330,7 @@ public async Task GetCheckpointPrefersNaturalCheckpointOverInitializeEventHandle cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partitionId = "0"; - var startingPosition = EventPosition.FromOffset(433); + var startingPosition = EventPosition.FromOffset("433"); var checkpointStartingPosition = EventPosition.FromSequenceNumber(999); var options = new EventProcessorOptions { DefaultStartingPosition = EventPosition.Latest }; var mockCheckpointStore = new Mock(); @@ -1464,8 +1464,8 @@ public async Task UpdateCheckpointDelegatesToTheStorageManager() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partitionId = "3"; - var sequenceNumber = 789; - var checkpointStartingPosition = new CheckpointPosition(sequenceNumber); + var offset = "789"; + var checkpointStartingPosition = new CheckpointPosition(offset); var mockStorage = new Mock(); var processorClient = new TestEventProcessorClient(mockStorage.Object, "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), default); @@ -1479,41 +1479,7 @@ public async Task UpdateCheckpointDelegatesToTheStorageManager() partitionId, processorClient.Identifier, It.Is(csp => - csp.SequenceNumber == sequenceNumber), - It.IsAny()), - Times.Once); - - cancellationSource.Cancel(); - } - - /// - /// Verifies functionality of the - /// method. - /// - /// - [Test] - public async Task PreviousUpdateCheckpointCallsTheOldUpdateCheckpoint() - { - using var cancellationSource = new CancellationTokenSource(); - cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - - var partitionId = "3"; - var offset = 456; - var sequenceNumber = 789; - var checkpointPosition = new CheckpointPosition(sequenceNumber); - var mockStorage = new Mock(); - var processorClient = new TestEventProcessorClient(mockStorage.Object, "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), default); - - await processorClient.InvokeOldUpdateCheckpointAsync(partitionId, offset, sequenceNumber, cancellationSource.Token); - - mockStorage - .Verify(storage => storage.UpdateCheckpointAsync( - processorClient.FullyQualifiedNamespace, - processorClient.EventHubName, - processorClient.ConsumerGroup, - partitionId, - offset, - sequenceNumber, + csp.OffsetString == offset), It.IsAny()), Times.Once); @@ -1532,7 +1498,7 @@ public void UpdateCheckpointRespectsTheCancellationToken() cancellationSource.Cancel(); var processorClient = new TestEventProcessorClient(Mock.Of(), "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), default); - Assert.That(async () => await processorClient.InvokeUpdateCheckpointAsync("0", new CheckpointPosition(123), cancellationSource.Token), Throws.InstanceOf()); + Assert.That(async () => await processorClient.InvokeUpdateCheckpointAsync("0", new CheckpointPosition("123"), cancellationSource.Token), Throws.InstanceOf()); } /// @@ -1548,7 +1514,8 @@ public async Task UpdateCheckpointLogsExecution() var partitionId = "3"; var sequenceNumber = 789; - var checkpointStartingPosition = new CheckpointPosition(sequenceNumber); + var offset = "135"; + var checkpointStartingPosition = new CheckpointPosition(offset, sequenceNumber); var mockLogger = new Mock(); var processorClient = new TestEventProcessorClient(Mock.Of(), "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), default); @@ -1560,7 +1527,9 @@ public async Task UpdateCheckpointLogsExecution() partitionId, processorClient.Identifier, processorClient.EventHubName, - processorClient.ConsumerGroup), + processorClient.ConsumerGroup, + sequenceNumber.ToString(), + offset), Times.Once); mockLogger @@ -1568,7 +1537,9 @@ public async Task UpdateCheckpointLogsExecution() partitionId, processorClient.Identifier, processorClient.EventHubName, - processorClient.ConsumerGroup), + processorClient.ConsumerGroup, + sequenceNumber.ToString(), + offset), Times.Once); cancellationSource.Cancel(); @@ -1587,7 +1558,7 @@ public void UpdateCheckpointLogsExceptions() var expectedException = new NotImplementedException("This didn't work."); var partitionId = "3"; - var checkpointStartingPosition = new CheckpointPosition(789); + var checkpointStartingPosition = new CheckpointPosition("44", 789); var mockLogger = new Mock(); var mockStorage = new Mock(); var processorClient = new TestEventProcessorClient(mockStorage.Object, "consumerGroup", "namespace", "eventHub", Mock.Of(), Mock.Of(), default); @@ -1612,7 +1583,9 @@ public void UpdateCheckpointLogsExceptions() processorClient.Identifier, processorClient.EventHubName, processorClient.ConsumerGroup, - expectedException.Message), + expectedException.Message, + "789", + "44"), Times.Once); cancellationSource.Cancel(); @@ -1726,7 +1699,6 @@ internal TestEventProcessorClient(BlobContainerClient containerClient, public Task InvokeGetCheckpointAsync(string partitionId, CancellationToken cancellationToken) => base.GetCheckpointAsync(partitionId, cancellationToken); public Task> InvokeListOwnershipAsync(CancellationToken cancellationToken) => base.ListOwnershipAsync(cancellationToken); public Task> InvokeClaimOwnershipAsync(IEnumerable desiredOwnership, CancellationToken cancellationToken) => base.ClaimOwnershipAsync(desiredOwnership, cancellationToken); - public Task InvokeOldUpdateCheckpointAsync(string partitionId, long offset, long sequenceNumber, CancellationToken cancellationToken) => base.UpdateCheckpointAsync(partitionId, offset, sequenceNumber, cancellationToken); public Task InvokeUpdateCheckpointAsync(string partitionId, CheckpointPosition checkpointStartingPosition, CancellationToken cancellationToken) => base.UpdateCheckpointAsync(partitionId, checkpointStartingPosition, cancellationToken); protected override EventHubConnection CreateConnection() => InjectedConnection; protected override Task ValidateProcessingPreconditions(CancellationToken cancellationToken = default) => Task.CompletedTask; diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample08_MockingClientTypesLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample08_MockingClientTypesLiveTests.cs index fb002cd6c66c..ce6f9020d25f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample08_MockingClientTypesLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Snippets/Sample08_MockingClientTypesLiveTests.cs @@ -64,7 +64,7 @@ Task processErrorHandler(ProcessErrorEventArgs args) systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:1:3344.1", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); // This creates a new instance of ProcessEventArgs to pass into the handler directly. @@ -130,7 +130,7 @@ Task processEventHandler(ProcessEventArgs args) systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:1:1111", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); ProcessEventArgs eventArgs = new( diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs index 6915a4f70983..daca314fa2d8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/BlobCheckpointStore/BlobCheckpointStoreInternal.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.IO; using System.Text.Json; @@ -354,6 +355,8 @@ public override async Task GetCheckpointAsync(string f } /// + /// Obsolete. + /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream /// that an event processor should begin reading from. /// @@ -362,10 +365,16 @@ public override async Task GetCheckpointAsync(string f /// The name of the specific Event Hub the ownership are associated with, relative to the Event Hubs namespace that contains it. /// The name of the consumer group the checkpoint is associated with. /// The identifier of the partition the checkpoint is for. - /// The offset to associate with the checkpoint, intended as informational metadata. This will only be used for positioning if there is no value provided for . + /// The offset to associate with the checkpoint, intended as informational metadata. This will only be used from positioning if there is no value provided for . /// The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream. /// A instance to signal a request to cancel the operation. /// + /// + /// This method is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetUpdateCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override async Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, @@ -373,7 +382,7 @@ public override async Task UpdateCheckpointAsync(string fullyQualifiedNamespace, long offset, long? sequenceNumber, CancellationToken cancellationToken) - => await UpdateCheckpointInternalAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, string.Empty, offset, sequenceNumber, cancellationToken).ConfigureAwait(false); + => await UpdateCheckpointInternalAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, string.Empty, offset.ToString(CultureInfo.InvariantCulture), sequenceNumber, cancellationToken).ConfigureAwait(false); /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream @@ -395,7 +404,7 @@ public override async Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string clientIdentifier, CheckpointPosition startingPosition, CancellationToken cancellationToken) - => await UpdateCheckpointInternalAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, clientIdentifier, null, startingPosition.SequenceNumber, cancellationToken).ConfigureAwait(false); + => await UpdateCheckpointInternalAsync(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId, clientIdentifier, startingPosition.OffsetString, startingPosition.SequenceNumber, cancellationToken).ConfigureAwait(false); /// /// Gets the name of the Storage Blob representing the checkpoint for a given partition. @@ -428,14 +437,22 @@ internal string GetCheckpointBlobName(string fullyQualifiedNamespace, /// The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream. /// A instance to signal a request to cancel the operation. /// - private async Task UpdateCheckpointInternalAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, long? offset, long? sequenceNumber, CancellationToken cancellationToken) + private async Task UpdateCheckpointInternalAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, string offset, long? sequenceNumber, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); - UpdateCheckpointStart(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber.ToString(), "-1", offset.ToString()); + UpdateCheckpointStart(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber?.ToString(), offset); var blobName = GetCheckpointBlobName(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId); var blobClient = ContainerClient.GetBlobClient(blobName); + if (sequenceNumber == long.MinValue) + { + // We don't want to set the sequence number in the checkpoint to long.MinValue. This can break in-process upgrade since old SDKs don't have + // the long.MinValue check. Since CheckpointPosition.SequenceNumber is not nullable, the default value is long.MinValue. If we get + // the default, just set it to null. + sequenceNumber = null; + } + // Because the checkpoint format changed and offset is no longer populated by the EventProcessor, we need to ensure that a value is present for // the Functions scale controller which uses a null check on the offset to determine if a checkpoint is in the legacy format or current. Because // GetCheckpointAsync will only populate the offset if a long.TryParse is successful, adding a nonsense string value to satisfy the null check @@ -443,7 +460,7 @@ private async Task UpdateCheckpointInternalAsync(string fullyQualifiedNamespace, var metadata = new Dictionary() { - { BlobMetadataKey.Offset, offset.HasValue ? offset.Value.ToString(CultureInfo.InvariantCulture) : "no offset" }, + { BlobMetadataKey.Offset, offset ?? ""}, { BlobMetadataKey.SequenceNumber, sequenceNumber.HasValue ? sequenceNumber.Value.ToString(CultureInfo.InvariantCulture) : "" }, { BlobMetadataKey.ClientIdentifier, clientIdentifier } }; @@ -466,17 +483,17 @@ private async Task UpdateCheckpointInternalAsync(string fullyQualifiedNamespace, } catch (RequestFailedException ex) when (ex.ErrorCode == BlobErrorCode.ContainerNotFound) { - UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber.ToString(), "-1", offset.ToString(), ex); + UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber?.ToString(), offset, ex); throw new RequestFailedException(BlobsResourceDoesNotExist, ex); } catch (Exception ex) { - UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber.ToString(), "-1", offset.ToString(), ex); + UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber?.ToString(), offset, ex); throw; } finally { - UpdateCheckpointComplete(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber.ToString(), "-1", offset.ToString()); + UpdateCheckpointComplete(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber?.ToString(), offset); } } @@ -501,24 +518,21 @@ private EventProcessorCheckpoint CreateCheckpoint(string fullyQualifiedNamespace DateTimeOffset modifiedDate) { var startingPosition = default(EventPosition?); - var offset = default(long?); + var offset = default(string); var sequenceNumber = default(long?); var clientIdentifier = default(string); + if (metadata.TryGetValue(BlobMetadataKey.Offset, out var offsetStr) && !string.IsNullOrEmpty(offsetStr)) + { + offset = offsetStr; + startingPosition = EventPosition.FromOffset(offsetStr, false); + } if (metadata.TryGetValue(BlobMetadataKey.SequenceNumber, out var sequenceStr) && long.TryParse(sequenceStr, NumberStyles.Integer, CultureInfo.InvariantCulture, out var sequenceResult)) { sequenceNumber = sequenceResult; if (sequenceNumber != long.MinValue) // If the sequence number is not equal to the default (long.MinValue), then a value was passed in. { - startingPosition = EventPosition.FromSequenceNumber(sequenceResult, false); - } - } - if (metadata.TryGetValue(BlobMetadataKey.Offset, out var offsetStr) && long.TryParse(offsetStr, NumberStyles.Integer, CultureInfo.InvariantCulture, out var offsetResult)) - { - offset = offsetResult; - if (offset != long.MinValue) // If the offset is not equal to the default (long.MinValue), then a value was passed in. - { - startingPosition ??= EventPosition.FromOffset(offsetResult, false); + startingPosition ??= EventPosition.FromSequenceNumber(sequenceResult, false); } } if (metadata.TryGetValue(BlobMetadataKey.ClientIdentifier, out var idStr)) @@ -577,16 +591,16 @@ private async Task CreateLegacyCheckpoint(string fully if (TryReadLegacyCheckpoint( memoryStream.GetBuffer().AsSpan(0, (int)memoryStream.Length), - out long? offset, + out string offset, out long? sequenceNumber)) { - if (sequenceNumber.HasValue && sequenceNumber.Value != long.MinValue) + if (!string.IsNullOrEmpty(offset)) { - startingPosition = EventPosition.FromSequenceNumber(sequenceNumber.Value, false); + startingPosition ??= EventPosition.FromOffset(offset, false); } - else if (offset.HasValue) + else if (sequenceNumber.HasValue && sequenceNumber.Value != long.MinValue) { - startingPosition ??= EventPosition.FromOffset(offset.Value, false); + startingPosition = EventPosition.FromSequenceNumber(sequenceNumber.Value, false); } else { @@ -616,7 +630,7 @@ private async Task CreateLegacyCheckpoint(string fully } /// - /// Attempts to read a legacy checkpoint JSON format and extract an offset and a sequence number + /// Attempts to read a legacy checkpoint JSON format and extract an offset and a sequence number. /// /// /// The binary representation of the checkpoint JSON. @@ -636,7 +650,7 @@ private async Task CreateLegacyCheckpoint(string fully /// /// private static bool TryReadLegacyCheckpoint(Span data, - out long? offset, + out string offset, out long? sequenceNumber) { offset = null; @@ -666,14 +680,7 @@ private static bool TryReadLegacyCheckpoint(Span data, var offsetString = jsonReader.GetString(); if (!string.IsNullOrEmpty(offsetString)) { - if (long.TryParse(offsetString, out long offsetValue)) - { - offset = offsetValue; - } - else - { - return false; - } + offset = offsetString; } break; @@ -814,7 +821,6 @@ partial void InvalidCheckpointFound(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored the checkpoint. /// The sequence number associated with the checkpoint. - /// The replication segment associated with the checkpoint. /// The offset associated with the checkpoint. /// The message for the exception that occurred. /// @@ -824,7 +830,6 @@ partial void UpdateCheckpointError(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset, Exception exception); @@ -838,7 +843,6 @@ partial void UpdateCheckpointError(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored the checkpoint. /// The sequence number associated with the checkpoint. - /// The replication segment associated with the checkpoint. /// The offset associated with the checkpoint. /// partial void UpdateCheckpointComplete(string partitionId, @@ -847,7 +851,6 @@ partial void UpdateCheckpointComplete(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset); /// @@ -860,7 +863,6 @@ partial void UpdateCheckpointComplete(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with the checkpoint. - /// The replication segment associated with the checkpoint. /// The offset associated with the checkpoint. /// partial void UpdateCheckpointStart(string partitionId, @@ -869,7 +871,6 @@ partial void UpdateCheckpointStart(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset); /// @@ -975,7 +976,7 @@ partial void BlobsCheckpointStoreCreated(string typeName, /// internal class BlobStorageCheckpoint : EventProcessorCheckpoint { - public long? Offset { get; set; } + public string Offset { get; set; } public long? SequenceNumber { get; set; } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Core/AttributeMessageText.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Core/AttributeMessageText.cs new file mode 100644 index 000000000000..df3b4a70e591 --- /dev/null +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Core/AttributeMessageText.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Messaging.EventHubs.Core +{ + /// + /// The set of common message text used in attributes, + /// which are unable to be represented in the shared + /// resources due to the constraint of needing to be + /// defined as a constant. + /// + /// + internal static class AttributeMessageText + { + /// + /// The message text detailing numeric offset deprecation. + /// + /// + public const string LongOffsetOffsetPropertyObsolete = "The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead."; + + /// + /// The message text detailing numeric offset deprecation. + /// + /// + public const string LongOffsetOffsetParameterObsolete = "The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead."; + + /// + /// The message text detailing numeric offset deprecation. + /// + /// + public const string LongLastEnqueuedOffsetOffsetObsolete = "The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'LastEnqueuedOffsetString' instead."; + + /// + /// The message text detailing numeric offset deprecation for the checkpoint-related operations. + /// + /// + public const string LongOffsetCheckpointObsolete = "The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset instead."; + + /// + /// The message text detailing numeric offset deprecation for the checkpoint-related operations. + /// + /// + public const string LongOffsetUpdateCheckpointObsolete = "The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead."; + + /// + /// The message text detailing numeric offset deprecation when positioning readers. + /// + /// + public const string LongOffsetEventPositionObsolete = "The Event Hubs service does not guarantee a numeric offset for all resource configurations. Reading events using a numeric offset may not work in all cases going forward. Please use a string-based offset instead."; + + /// + /// The message text detailing sequence-only checkpoints for processors. + /// + /// + public const string SequenceNumberOnlyCheckpointObsolete = "The Event Hubs service does not guarantee that a sequence number-only checkpoint can access the event stream for all resource configurations. Reading events may not work in all cases going forward. Please provide a string-based offset."; + } +} diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.Designer.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.Designer.cs index 889f5675c93d..07cbef312b04 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.Designer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.Designer.cs @@ -847,6 +847,17 @@ internal static string ProcessorLoadBalancingCycleSlowMask } } + /// + /// Looks up a localized string similar to WARNING: A processor for a geo-replication-enabled Event Hub is trying to write a checkpoint without an offset. Readers of geo-replicated Event Hubs cannot be positioned without an offset.. + /// + internal static string ProcessorAttemptingToWriteCheckpointWithoutOffset + { + get + { + return ResourceManager.GetString("ProcessorLoadBalancingCycleSlowMask", resourceCulture); + } + } + /// /// Looks up a localized string similar to WARNING: The 'PartitionOwnershipExpirationInterval' and 'LoadBalancingUpdateInterval' are configured for intervals that may cause stability issues with partition ownership. It is recommended that the 'PartitionOwnershipExpirationInterval' be at least 3 times greater than the 'LoadBalancingUpdateInterval' and very strongly advised that it should be no less than twice as long. It is advised to adjust the intervals in the processor options. Load Balancing Interval '{1:0:00}' seconds. Partition Ownership Interval '{1:0:00}' seconds.. /// @@ -923,5 +934,27 @@ internal static string BufferedProducerStartupTimeout return ResourceManager.GetString("BufferedProducerStartupTimeout", resourceCulture); } } + + /// + /// Looks up a localized string similar to The Event Hubs services does not return a numeric offset for GeoDR-enabled namespaces. Please use 'OffsetString' instead.. + /// + internal static string LongOffsetOffsetUnsupported + { + get + { + return ResourceManager.GetString("LongOffsetOffsetUnsupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Event Hubs services does not return a numeric offset for GeoDR-enabled namespaces. Please use 'LastEnqueuedOffsetString' instead.. + /// + internal static string LongLastEnqueuedOffsetOffsetUnsupported + { + get + { + return ResourceManager.GetString("LongLastEnqueuedOffsetOffsetUnsupported", resourceCulture); + } + } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.resx b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.resx index 11f936463320..078493abecd9 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.resx +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Resources.resx @@ -1,17 +1,17 @@  - @@ -351,4 +351,13 @@ FATAL: The processor has experienced a fatal error in its load balancing and health check task. Recovery is NOT possible; the processor is shutting down. Error message: {0} - \ No newline at end of file + + WARNING: A processor for a geo-replication-enabled Event Hub is trying to write a checkpoint without an offset. Readers of geo-replicated Event Hubs cannot be positioned without an offset. + + + The Event Hubs services does not return a numeric offset for GeoDR-enabled namespaces. Please use 'OffsetString' instead. + + + The Event Hubs services does not return a numeric offset for GeoDR-enabled namespaces. Please use 'LastEnqueuedOffsetString' instead. + + diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/EventDataExtensions.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/EventDataExtensions.cs index a799711350cb..8fb2915c455f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/EventDataExtensions.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/EventDataExtensions.cs @@ -65,7 +65,7 @@ public static bool IsEquivalentTo(this EventData instance, // Verify that the stand-alone system properties are equivalent. if ((considerSystemProperties) - && ((instance.Offset != other.Offset) + && ((instance.OffsetString != other.OffsetString) || (instance.EnqueuedTime != other.EnqueuedTime) || (instance.PartitionKey != other.PartitionKey) || (instance.SequenceNumber != other.SequenceNumber))) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/MockEventData.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/MockEventData.cs index b1b2d59c1ac8..4fe5c82cfeb7 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/MockEventData.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/src/Testing/MockEventData.cs @@ -29,9 +29,15 @@ public MockEventData(ReadOnlyMemory eventBody, IDictionary properties = null, IReadOnlyDictionary systemProperties = null, long sequenceNumber = long.MinValue, - long offset = long.MinValue, + string offset = null, DateTimeOffset enqueuedTime = default, - string partitionKey = null) : base(eventBody, properties, systemProperties, sequenceNumber, offset, enqueuedTime, partitionKey) + string partitionKey = null) : base(BinaryData.FromBytes(eventBody), + properties, + systemProperties, + sequenceNumber, + offset, + enqueuedTime, + partitionKey) { } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalLiveTests.cs index 7d9a94dce1c3..68cd6c5e6ea7 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalLiveTests.cs @@ -131,8 +131,7 @@ public async Task BlobStorageManagerCanUpdateCheckpoint() }; await checkpointStore.ClaimOwnershipAsync(ownershipList, default); - Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition(10), default), Throws.Nothing); - Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId", 0, 10, default), Throws.Nothing); + Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition("0", 10), default), Throws.Nothing); } } @@ -707,7 +706,7 @@ public async Task CheckpointUpdateFailsWhenContainerDoesNotExist() var containerClient = new BlobContainerClient(storageConnectionString, $"test-container-{Guid.NewGuid()}"); var checkpointStore = new BlobCheckpointStoreInternal(containerClient); - Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition(10), default), Throws.InstanceOf()); + Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition("100"), default), Throws.InstanceOf()); } } @@ -736,7 +735,7 @@ public async Task CheckpointUpdateCreatesTheBlobOnFirstCall() var mockEvent = new MockEventData( eventBody: Array.Empty(), - offset: 10, + offset: "10", sequenceNumber: 20); // There should be no blobs or checkpoints before the first call. @@ -755,11 +754,11 @@ public async Task CheckpointUpdateCreatesTheBlobOnFirstCall() // Calling update should create the checkpoint. - await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(mockEvent.SequenceNumber), default); + await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(mockEvent.OffsetString, mockEvent.SequenceNumber), default); storedCheckpoint = await checkpointStore.GetCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, default); Assert.That(storedCheckpoint, Is.Not.Null); - Assert.That(storedCheckpoint.StartingPosition, Is.EqualTo(EventPosition.FromSequenceNumber(mockEvent.SequenceNumber, false))); + Assert.That(storedCheckpoint.StartingPosition, Is.EqualTo(EventPosition.FromOffset(mockEvent.OffsetString, false))); Assert.That(storedCheckpoint.ClientIdentifier, Is.EqualTo("Id")); // There should be a single blob in the container. @@ -780,63 +779,6 @@ public async Task CheckpointUpdateCreatesTheBlobOnFirstCall() } } - /// - /// Verifies functionality of the - /// method. - /// - /// - [Test] - public async Task CheckpointUpdateWritesAnInvalidOffsetString() - { - await using (StorageScope storageScope = await StorageScope.CreateAsync()) - { - var storageConnectionString = StorageTestEnvironment.Instance.StorageConnectionString; - var containerClient = new BlobContainerClient(storageConnectionString, storageScope.ContainerName); - var checkpointStore = new BlobCheckpointStoreInternal(containerClient); - - var checkpoint = new EventProcessorCheckpoint - { - FullyQualifiedNamespace = "namespace", - EventHubName = "eventHubName", - ConsumerGroup = "consumerGroup", - PartitionId = "partitionId", - ClientIdentifier = "Id" - }; - - var mockEvent = new MockEventData( - eventBody: Array.Empty(), - offset: 10, - sequenceNumber: 20); - - // Calling update should create the checkpoint. - - await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(mockEvent.SequenceNumber), default); - - var blobCount = 0; - var checkpointBlobName = default(string); - var checkpointBlob = default(BlobProperties); - var storedCheckpoint = await checkpointStore.GetCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, default); - - await foreach (var blob in containerClient.GetBlobsAsync()) - { - ++blobCount; - checkpointBlobName = blob.Name; - checkpointBlob = await containerClient.GetBlobClient(blob.Name).GetPropertiesAsync(); - - if (blobCount > 1) - { - break; - } - } - - Assert.That(blobCount, Is.EqualTo(1)); - Assert.That(checkpointBlobName, Is.EqualTo(checkpointStore.GetCheckpointBlobName(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId))); - Assert.That(checkpointBlob.Metadata.TryGetValue("offset", out var offset), Is.True); - Assert.That(offset, Is.Not.Null); - Assert.That(long.TryParse(offset, out _), Is.False); - } - } - /// /// Verifies functionality of the /// method. @@ -862,12 +804,12 @@ public async Task CheckpointUpdatesAnExistingBlob() var mockEvent = new MockEventData( eventBody: Array.Empty(), - offset: 10, + offset: "10", sequenceNumber: 20); // Calling update should create the checkpoint. - await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(mockEvent.SequenceNumber), default); + await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, CheckpointPosition.FromEvent(mockEvent), default); var blobCount = 0; var storedCheckpoint = await checkpointStore.GetCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, default); @@ -884,17 +826,17 @@ public async Task CheckpointUpdatesAnExistingBlob() Assert.That(blobCount, Is.EqualTo(1)); Assert.That(storedCheckpoint, Is.Not.Null); - Assert.That(storedCheckpoint.StartingPosition, Is.EqualTo(EventPosition.FromSequenceNumber(mockEvent.SequenceNumber, false))); + Assert.That(storedCheckpoint.StartingPosition, Is.EqualTo(EventPosition.FromOffset(mockEvent.OffsetString, false))); Assert.That(storedCheckpoint.ClientIdentifier, Is.EqualTo("Id")); // Calling update again should update the existing checkpoint. mockEvent = new MockEventData( eventBody: Array.Empty(), - offset: 50, + offset: "50", sequenceNumber: 60); - await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(mockEvent.SequenceNumber), default); + await checkpointStore.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, CheckpointPosition.FromEvent(mockEvent), default); blobCount = 0; storedCheckpoint = await checkpointStore.GetCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, default); @@ -911,7 +853,7 @@ public async Task CheckpointUpdatesAnExistingBlob() Assert.That(blobCount, Is.EqualTo(1)); Assert.That(storedCheckpoint, Is.Not.Null); - Assert.That(storedCheckpoint.StartingPosition, Is.EqualTo(EventPosition.FromSequenceNumber(mockEvent.SequenceNumber, false))); + Assert.That(storedCheckpoint.StartingPosition, Is.EqualTo(EventPosition.FromOffset(mockEvent.OffsetString, false))); Assert.That(storedCheckpoint.ClientIdentifier, Is.EqualTo("Id")); } } @@ -930,8 +872,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherConsumerGroups() var containerClient = new BlobContainerClient(storageConnectionString, storageScope.ContainerName); var checkpointStore = new BlobCheckpointStoreInternal(containerClient); - await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup1", "partitionId", "Id", new CheckpointPosition(20), default); - await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup2", "partitionId", "Id", new CheckpointPosition(20), default); + await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup1", "partitionId", "Id", new CheckpointPosition("10"), default); + await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup2", "partitionId", "Id", new CheckpointPosition("444", 10), default); var storedCheckpoint1 = await checkpointStore.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup1", "partitionId", default); var storedCheckpoint2 = await checkpointStore.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup2", "partitionId", default); @@ -955,8 +897,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherEventHubs() var containerClient = new BlobContainerClient(storageConnectionString, storageScope.ContainerName); var checkpointStore = new BlobCheckpointStoreInternal(containerClient); - await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName1", "consumerGroup", "partitionId", "Id", new CheckpointPosition(20), default); - await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName2", "consumerGroup", "partitionId", "Id", new CheckpointPosition(20), default); + await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName1", "consumerGroup", "partitionId", "Id", new CheckpointPosition("20"), default); + await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName2", "consumerGroup", "partitionId", "Id", new CheckpointPosition("777", 10), default); var storedCheckpoint1 = await checkpointStore.GetCheckpointAsync("namespace", "eventHubName1", "consumerGroup", "partitionId", default); var storedCheckpoint2 = await checkpointStore.GetCheckpointAsync("namespace", "eventHubName2", "consumerGroup", "partitionId", default); @@ -980,8 +922,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherNamespaces() var containerClient = new BlobContainerClient(storageConnectionString, storageScope.ContainerName); var checkpointStore = new BlobCheckpointStoreInternal(containerClient); - await checkpointStore.UpdateCheckpointAsync("namespace1", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition(20), default); - await checkpointStore.UpdateCheckpointAsync("namespace2", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition(20), default); + await checkpointStore.UpdateCheckpointAsync("namespace1", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition("20"), default); + await checkpointStore.UpdateCheckpointAsync("namespace2", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition("111", 20), default); var storedCheckpoint1 = await checkpointStore.GetCheckpointAsync("namespace1", "eventHubName", "consumerGroup", "partitionId", default); var storedCheckpoint2 = await checkpointStore.GetCheckpointAsync("namespace2", "eventHubName", "consumerGroup", "partitionId", default); @@ -1005,8 +947,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherPartitions() var containerClient = new BlobContainerClient(storageConnectionString, storageScope.ContainerName); var checkpointStore = new BlobCheckpointStoreInternal(containerClient); - await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId1", "Id", new CheckpointPosition(20), default); - await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId2", "Id", new CheckpointPosition(20), default); + await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId1", "Id", new CheckpointPosition("20", 222), default); + await checkpointStore.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId2", "Id", new CheckpointPosition("20"), default); var storedCheckpoint1 = await checkpointStore.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId1", default); var storedCheckpoint2 = await checkpointStore.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId2", default); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs index 3e9dd64c74c8..e821e99379c6 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/BlobCheckpointStore/BlobsCheckpointStoreInternalTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Text; @@ -362,7 +363,7 @@ public async Task GetCheckpointLogsStartAndComplete() [Test] public async Task GetCheckpointUsesOffsetAsTheStartingPositionWhenNoSequenceNumberIsPresent() { - var expectedOffset = 13; + var expectedOffset = "13"; var expectedStartingPosition = EventPosition.FromOffset(expectedOffset, false); var partition = Guid.NewGuid().ToString(); @@ -428,48 +429,10 @@ public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenNoOffs /// /// [Test] - public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenOffsetIsMinValue() + public async Task GetCheckpointUsesOffsetAsTheStartingPosition() { - var expectedSequence = 133; - var expectedStartingPosition = EventPosition.FromSequenceNumber(expectedSequence, false); - var partition = Guid.NewGuid().ToString(); - - var blobList = new List - { - BlobsModelFactory.BlobItem($"{FullyQualifiedNamespaceLowercase}/{EventHubNameLowercase}/{ConsumerGroupLowercase}/checkpoint/{partition}", - false, - BlobsModelFactory.BlobItemProperties(true, lastModified: DateTime.UtcNow, eTag: new ETag(MatchingEtag)), - "snapshot", - new Dictionary - { - {BlobMetadataKey.OwnerIdentifier, Guid.NewGuid().ToString()}, - {BlobMetadataKey.Offset, long.MinValue.ToString()}, - {BlobMetadataKey.SequenceNumber, expectedSequence.ToString()} - }) - }; - - var target = new BlobCheckpointStoreInternal(new MockBlobContainerClient() { Blobs = blobList }); - var checkpoint = await target.GetCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, partition, CancellationToken.None); - - Assert.That(checkpoint, Is.Not.Null, "A checkpoint should have been returned."); - Assert.That(checkpoint.StartingPosition, Is.EqualTo(expectedStartingPosition)); - - Assert.That(checkpoint, Is.InstanceOf(), "Checkpoint instance was not the expected type."); - var blobCheckpoint = (BlobCheckpointStoreInternal.BlobStorageCheckpoint)checkpoint; - Assert.That(blobCheckpoint.Offset, Is.EqualTo(long.MinValue), "The offset should have been long.MinValue."); - Assert.That(expectedSequence, Is.EqualTo(blobCheckpoint.SequenceNumber), "Checkpoint sequence number did not have the correct value."); - } - - /// - /// Verifies basic functionality of GetCheckpointAsync and ensures the starting position is set correctly. - /// - /// - [Test] - public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenInvalidOffsetIsPresent() - { - var expectedSequence = 133; - var expectedOffset = "invalid offset"; - var expectedStartingPosition = EventPosition.FromSequenceNumber(expectedSequence, false); + var expectedOffset = "133"; + var expectedStartingPosition = EventPosition.FromOffset(expectedOffset, false); var partition = Guid.NewGuid().ToString(); var blobList = new List @@ -482,7 +445,7 @@ public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenInvali { {BlobMetadataKey.OwnerIdentifier, Guid.NewGuid().ToString()}, {BlobMetadataKey.Offset, expectedOffset}, - {BlobMetadataKey.SequenceNumber, expectedSequence.ToString()} + {BlobMetadataKey.SequenceNumber, long.MinValue.ToString()} }) }; @@ -494,8 +457,8 @@ public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenInvali Assert.That(checkpoint, Is.InstanceOf(), "Checkpoint instance was not the expected type."); var blobCheckpoint = (BlobCheckpointStoreInternal.BlobStorageCheckpoint)checkpoint; - Assert.That(blobCheckpoint.Offset, Is.Null, $"The offset should not have been populated, as it was an invalid number."); - Assert.That(expectedSequence, Is.EqualTo(blobCheckpoint.SequenceNumber), "Checkpoint sequence number did not have the correct value."); + Assert.That(blobCheckpoint.SequenceNumber, Is.EqualTo(long.MinValue), "The offset should have been long.MinValue."); + Assert.That(expectedOffset, Is.EqualTo(blobCheckpoint.Offset), "Checkpoint sequence number did not have the correct value."); } /// @@ -503,11 +466,11 @@ public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenInvali /// /// [Test] - public async Task GetCheckpointPrefersSequenceNumberAsTheStartingPosition() + public async Task GetCheckpointPrefersOffsetAsTheStartingPosition() { - var offset = 13; + var offset = "13"; var sequenceNumber = 7777; - var expectedStartingPosition = EventPosition.FromSequenceNumber(sequenceNumber, false); + var expectedStartingPosition = EventPosition.FromOffset(offset, false); var partition = Guid.NewGuid().ToString(); var blobList = new List @@ -519,7 +482,7 @@ public async Task GetCheckpointPrefersSequenceNumberAsTheStartingPosition() new Dictionary { {BlobMetadataKey.OwnerIdentifier, Guid.NewGuid().ToString()}, - {BlobMetadataKey.Offset, offset.ToString()}, + {BlobMetadataKey.Offset, offset}, {BlobMetadataKey.SequenceNumber, sequenceNumber.ToString()} }) }; @@ -548,7 +511,7 @@ public async Task GetCheckpointConsidersDataInvalidWithNoOffsetOrSequenceNumber( new Dictionary { {BlobMetadataKey.OwnerIdentifier, Guid.NewGuid().ToString()}, - {BlobMetadataKey.Offset, "invalid"}, + {BlobMetadataKey.Offset, ""}, {BlobMetadataKey.SequenceNumber, long.MinValue.ToString()} }) }; @@ -569,7 +532,7 @@ public async Task GetCheckpointConsidersDataInvalidWithNoOffsetOrSequenceNumber( /// /// [Test] - public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenPresentInLegacyCheckpoint() + public async Task GetCheckpointUsesOffsetAsTheStartingPositionWhenPresentInLegacyCheckpoint() { var blobList = new List { @@ -596,7 +559,7 @@ public async Task GetCheckpointUsesSequenceNumberAsTheStartingPositionWhenPresen var checkpoint = await target.GetCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0", CancellationToken.None); Assert.That(checkpoint, Is.Not.Null, "A checkpoints should have been returned."); - Assert.That(checkpoint.StartingPosition, Is.EqualTo(EventPosition.FromSequenceNumber(960180, false))); + Assert.That(checkpoint.StartingPosition, Is.EqualTo(EventPosition.FromOffset("13", false))); Assert.That(checkpoint.PartitionId, Is.EqualTo("0")); } @@ -629,11 +592,10 @@ public void GetCheckpointForMissingPartitionThrowsAndLogsGetCheckpointError() /// /// [Test] - [TestCase(true)] - [TestCase(false)] - public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists(bool useCheckpointPositionOverload) + public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists() { - var sequenceNumber = 777; + var position = new CheckpointPosition("777", 89); + var expectedSequenceNumber = position.SequenceNumber.ToString(CultureInfo.InvariantCulture); var checkpoint = new EventProcessorCheckpoint { @@ -642,7 +604,7 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists(bool use ConsumerGroup = ConsumerGroup, PartitionId = PartitionId, ClientIdentifier = Identifier, - StartingPosition = EventPosition.FromSequenceNumber(sequenceNumber) + StartingPosition = EventPosition.FromOffset(position.OffsetString) }; var blobInfo = BlobsModelFactory.BlobInfo(new ETag($@"""{MatchingEtag}"""), DateTime.UtcNow); @@ -655,7 +617,8 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists(bool use "snapshot", new Dictionary { { BlobMetadataKey.OwnerIdentifier, Guid.NewGuid().ToString() }, - { BlobMetadataKey.SequenceNumber, sequenceNumber.ToString() }, + { BlobMetadataKey.Offset, position.OffsetString }, + { BlobMetadataKey.SequenceNumber, expectedSequenceNumber }, { BlobMetadataKey.ClientIdentifier, Identifier } }) }; @@ -673,18 +636,9 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists(bool use var mockLog = new Mock(); target.Logger = mockLog.Object; - if (useCheckpointPositionOverload) - { - await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(sequenceNumber), CancellationToken.None); - mockLog.Verify(log => log.UpdateCheckpointStart(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), "-1", string.Empty)); - mockLog.Verify(log => log.UpdateCheckpointComplete(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), "-1", string.Empty)); - } - else - { - await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, 123, null, CancellationToken.None); - mockLog.Verify(log => log.UpdateCheckpointStart(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, string.Empty, string.Empty, "-1", "123")); - mockLog.Verify(log => log.UpdateCheckpointComplete(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, string.Empty, string.Empty, "-1", "123")); - } + await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, position, CancellationToken.None); + mockLog.Verify(log => log.UpdateCheckpointStart(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, expectedSequenceNumber, position.OffsetString)); + mockLog.Verify(log => log.UpdateCheckpointComplete(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, expectedSequenceNumber, position.OffsetString)); } /// @@ -692,12 +646,10 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobExists(bool use /// /// [Test] - [TestCase(true)] - [TestCase(false)] - public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobDoesNotExist(bool useCheckpointPositionOverload) + public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobDoesNotExist() { var sequenceNumber = 1234; - var offset = 5678; + var offset = "5678"; var checkpoint = new EventProcessorCheckpoint { @@ -726,18 +678,9 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobDoesNotExist(bo var mockLog = new Mock(); target.Logger = mockLog.Object; - if (useCheckpointPositionOverload) - { - await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(sequenceNumber), CancellationToken.None); - mockLog.Verify(log => log.UpdateCheckpointStart(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), "-1", string.Empty)); - mockLog.Verify(log => log.UpdateCheckpointComplete(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), "-1", string.Empty)); - } - else - { - await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, offset, sequenceNumber, CancellationToken.None); - mockLog.Verify(log => log.UpdateCheckpointStart(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, string.Empty, sequenceNumber.ToString(), "-1", offset.ToString())); - mockLog.Verify(log => log.UpdateCheckpointComplete(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, string.Empty, sequenceNumber.ToString(), "-1", offset.ToString())); - } + await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(offset, sequenceNumber), CancellationToken.None); + mockLog.Verify(log => log.UpdateCheckpointStart(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), offset)); + mockLog.Verify(log => log.UpdateCheckpointComplete(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), offset)); } /// @@ -746,12 +689,10 @@ public async Task UpdateCheckpointLogsStartAndCompleteWhenTheBlobDoesNotExist(bo /// /// [Test] - [TestCase(true)] - [TestCase(false)] - public void UpdateCheckpointLogsErrorsWhenTheBlobExists(bool useCheckpointPositionOverload) + public void UpdateCheckpointLogsErrorsWhenTheBlobExists() { var sequenceNumber = 456; - var offset = 789; + var offset = "789"; var checkpoint = new EventProcessorCheckpoint { @@ -775,16 +716,8 @@ public void UpdateCheckpointLogsErrorsWhenTheBlobExists(bool useCheckpointPositi var target = new BlobCheckpointStoreInternal(mockContainerClient); target.Logger = mockLog.Object; - if (useCheckpointPositionOverload) - { - Assert.That(async () => await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(sequenceNumber), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); - mockLog.Verify(log => log.UpdateCheckpointError(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), "-1", string.Empty, expectedException.Message)); - } - else - { - Assert.That(async () => await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, offset, sequenceNumber, CancellationToken.None), Throws.Exception.EqualTo(expectedException)); - mockLog.Verify(log => log.UpdateCheckpointError(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, string.Empty, sequenceNumber.ToString(), "-1", offset.ToString(), expectedException.Message)); - } + Assert.That(async () => await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(offset, sequenceNumber), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); + mockLog.Verify(log => log.UpdateCheckpointError(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, sequenceNumber.ToString(), offset.ToString(), expectedException.Message)); } /// @@ -793,9 +726,7 @@ public void UpdateCheckpointLogsErrorsWhenTheBlobExists(bool useCheckpointPositi /// /// [Test] - [TestCase(true)] - [TestCase(false)] - public void UpdateCheckpointLogsErrorsWhenTheBlobDoesNotExist(bool useCheckpointPositionOverload) + public void UpdateCheckpointLogsErrorsWhenTheBlobDoesNotExist() { var checkpoint = new EventProcessorCheckpoint { @@ -817,16 +748,8 @@ public void UpdateCheckpointLogsErrorsWhenTheBlobDoesNotExist(bool useCheckpoint var target = new BlobCheckpointStoreInternal(mockContainerClient); target.Logger = mockLog.Object; - if (useCheckpointPositionOverload) - { - Assert.That(async () => await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition(0), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); - mockLog.Verify(log => log.UpdateCheckpointError(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, "0", "-1", string.Empty, expectedException.Message)); - } - else - { - Assert.That(async () => await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, 0, 0, CancellationToken.None), Throws.Exception.EqualTo(expectedException)); - mockLog.Verify(log => log.UpdateCheckpointError(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, string.Empty, "0", "-1", "0", expectedException.Message)); - } + Assert.That(async () => await target.UpdateCheckpointAsync(checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.PartitionId, checkpoint.ClientIdentifier, new CheckpointPosition("0", 0), CancellationToken.None), Throws.Exception.EqualTo(expectedException)); + mockLog.Verify(log => log.UpdateCheckpointError(checkpoint.PartitionId, checkpoint.FullyQualifiedNamespace, checkpoint.EventHubName, checkpoint.ConsumerGroup, checkpoint.ClientIdentifier, "0", "0", expectedException.Message)); } /// @@ -843,8 +766,8 @@ public void UpdateCheckpointForMissingContainerThrowsAndLogsCheckpointUpdateErro var mockLog = new Mock(); target.Logger = mockLog.Object; - Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition(0), CancellationToken.None), Throws.InstanceOf()); - mockLog.Verify(m => m.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, "0", "-1", string.Empty, ex.Message)); + Assert.That(async () => await target.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, PartitionId, Identifier, new CheckpointPosition("111", 0), CancellationToken.None), Throws.InstanceOf()); + mockLog.Verify(m => m.UpdateCheckpointError(PartitionId, FullyQualifiedNamespace, EventHubName, ConsumerGroup, Identifier, "0", "111", ex.Message)); } /// @@ -1210,7 +1133,7 @@ public void UpdateCheckpointAsyncSurfacesNonRetriableExceptionsWhenTheBlobExists using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - Assert.That(async () => await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition(10), cancellationSource.Token), Throws.TypeOf(exception.GetType()), "The method call should surface the exception."); + Assert.That(async () => await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition("10"), cancellationSource.Token), Throws.TypeOf(exception.GetType()), "The method call should surface the exception."); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The operation should have stopped without cancellation."); Assert.That(serviceCalls, Is.EqualTo(expectedServiceCalls), "The retry policy should have been applied."); } @@ -1239,7 +1162,7 @@ public void UpdateCheckpointAsyncSurfacesNonRetriableExceptionsWhenTheBlobDoesNo using var cancellationSource = new CancellationTokenSource(); cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - Assert.That(async () => await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition(10), cancellationSource.Token), Throws.TypeOf(exception.GetType()), "The method call should surface the exception."); + Assert.That(async () => await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition("10"), cancellationSource.Token), Throws.TypeOf(exception.GetType()), "The method call should surface the exception."); Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The operation should have stopped without cancellation."); } @@ -1249,9 +1172,7 @@ public void UpdateCheckpointAsyncSurfacesNonRetriableExceptionsWhenTheBlobDoesNo /// /// [Test] - [TestCase(true)] - [TestCase(false)] - public async Task UpdateCheckpointAsyncDelegatesTheCancellationTokenWhenTheBlobExists(bool useCheckpointPositionOverload) + public async Task UpdateCheckpointAsyncDelegatesTheCancellationTokenWhenTheBlobExists() { using var cancellationSource = new CancellationTokenSource(); @@ -1277,14 +1198,7 @@ public async Task UpdateCheckpointAsyncDelegatesTheCancellationTokenWhenTheBlobE var checkpointStore = new BlobCheckpointStoreInternal(mockContainerClient); - if (useCheckpointPositionOverload) - { - await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition(10), cancellationSource.Token); - } - else - { - await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, 0, 10, cancellationSource.Token); - } + await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition("10"), cancellationSource.Token); Assert.That(stateBeforeCancellation.HasValue, Is.True, "State before cancellation should have been captured."); Assert.That(stateBeforeCancellation.Value, Is.False, "The token should not have been canceled before cancellation request."); @@ -1320,7 +1234,7 @@ public async Task UpdateCheckpointAsyncDelegatesTheCancellationTokenWhenTheBlobD }); var checkpointStore = new BlobCheckpointStoreInternal(mockContainerClient); - await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition(10), cancellationSource.Token); + await checkpointStore.UpdateCheckpointAsync(FullyQualifiedNamespaceLowercase, EventHubNameLowercase, ConsumerGroupLowercase, partition, "Id", new CheckpointPosition("10"), cancellationSource.Token); Assert.That(stateBeforeCancellation.HasValue, Is.True, "State before cancellation should have been captured."); Assert.That(stateBeforeCancellation.Value, Is.False, "The token should not have been canceled before cancellation request."); @@ -1341,7 +1255,7 @@ public void AlreadyCanceledTokenMakesUpdateCheckpointAsyncThrow() using var cancellationSource = new CancellationTokenSource(); cancellationSource.Cancel(); - Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("ns", "eh", "cg", "p0", "Id", new CheckpointPosition(10), cancellationSource.Token), Throws.InstanceOf()); + Assert.That(async () => await checkpointStore.UpdateCheckpointAsync("ns", "eh", "cg", "p0", "Id", new CheckpointPosition("10"), cancellationSource.Token), Throws.InstanceOf()); } /// @@ -1388,12 +1302,12 @@ public async Task GetCheckpointPreferredNewCheckpointOverLegacy() var checkpoint = await target.GetCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0", CancellationToken.None); Assert.That(checkpoint, Is.Not.Null, "A single checkpoint should have been returned."); - Assert.That(checkpoint.StartingPosition, Is.EqualTo(EventPosition.FromSequenceNumber(960182, false))); + Assert.That(checkpoint.StartingPosition, Is.EqualTo(EventPosition.FromOffset("14", false))); Assert.That(checkpoint.PartitionId, Is.EqualTo("0")); Assert.That(checkpoint, Is.InstanceOf(), "Checkpoint instance was not the expected type."); var blobCheckpoint = (BlobCheckpointStoreInternal.BlobStorageCheckpoint)checkpoint; - Assert.That(14, Is.EqualTo(blobCheckpoint.Offset), "Checkpoint offset did not have the correct value."); + Assert.That("14", Is.EqualTo(blobCheckpoint.Offset), "Checkpoint offset did not have the correct value."); Assert.That(960182, Is.EqualTo(blobCheckpoint.SequenceNumber), "Checkpoint sequence number did not have the correct value."); } @@ -1430,7 +1344,7 @@ public async Task GetCheckpointsUsesOffsetAsTheStartingPositionWhenPresentInLega var checkpoint = await target.GetCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0", CancellationToken.None); Assert.That(checkpoint, Is.Not.Null, "A set of checkpoints should have been returned."); - Assert.That(checkpoint.StartingPosition, Is.EqualTo(EventPosition.FromSequenceNumber(960180, false))); + Assert.That(checkpoint.StartingPosition, Is.EqualTo(EventPosition.FromOffset("13", false))); Assert.That(checkpoint.PartitionId, Is.EqualTo("0")); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/BlobsCheckpointStoreInternal.Diagnostics.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/BlobsCheckpointStoreInternal.Diagnostics.cs index aaa66f163bce..23d19e1c51c4 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/BlobsCheckpointStoreInternal.Diagnostics.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/BlobsCheckpointStoreInternal.Diagnostics.cs @@ -87,7 +87,6 @@ partial void InvalidCheckpointFound(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// The exception that occurred. /// @@ -97,10 +96,9 @@ partial void UpdateCheckpointError(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset, Exception exception) => - Logger.UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, replicationSegment, offset, exception.Message); + Logger.UpdateCheckpointError(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, offset, exception.Message); /// /// Indicates that an attempt to update a checkpoint has completed. @@ -112,7 +110,6 @@ partial void UpdateCheckpointError(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// partial void UpdateCheckpointComplete(string partitionId, @@ -121,9 +118,8 @@ partial void UpdateCheckpointComplete(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset) => - Logger.UpdateCheckpointComplete(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, replicationSegment, offset); + Logger.UpdateCheckpointComplete(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, offset); /// /// Indicates that an attempt to create/update a checkpoint has started. @@ -135,7 +131,6 @@ partial void UpdateCheckpointComplete(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// partial void UpdateCheckpointStart(string partitionId, @@ -144,9 +139,8 @@ partial void UpdateCheckpointStart(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset) => - Logger.UpdateCheckpointStart(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, replicationSegment, offset); + Logger.UpdateCheckpointStart(partitionId, fullyQualifiedNamespace, eventHubName, consumerGroup, clientIdentifier, sequenceNumber, offset); /// /// Indicates that an attempt to retrieve claim partition ownership has completed. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/IBlobEventLogger.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/IBlobEventLogger.cs index 9f37487c033c..e6ca8eaf158a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/IBlobEventLogger.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Infrastructure/IBlobEventLogger.cs @@ -116,7 +116,6 @@ void ListCheckpointsStart(string fullyQualifiedNamespace, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// The exception that occurred. /// @@ -126,7 +125,6 @@ void UpdateCheckpointError(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset, string exception); @@ -140,7 +138,6 @@ void UpdateCheckpointError(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// void UpdateCheckpointComplete(string partitionId, @@ -149,7 +146,6 @@ void UpdateCheckpointComplete(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset); /// @@ -162,7 +158,6 @@ void UpdateCheckpointComplete(string partitionId, /// The name of the consumer group the checkpoint is associated with. /// The unique identifier of the client that authored this checkpoint. /// The sequence number associated with this checkpoint. - /// The replication segment associated with this checkpoint. /// The offset associated with this checkpoint. /// void UpdateCheckpointStart(string partitionId, @@ -171,7 +166,6 @@ void UpdateCheckpointStart(string partitionId, string consumerGroup, string clientIdentifier, string sequenceNumber, - string replicationSegment, string offset); /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/EventDataExtensionsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/EventDataExtensionsTests.cs index 0efbbccdc3ce..beca3c3f15e6 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/EventDataExtensionsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/EventDataExtensionsTests.cs @@ -39,13 +39,13 @@ public void IsEquivalentToDetectsDifferentDifferentOffset() { var firstEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); var secondEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44 }, - offset: 111, + offset: "111", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -62,13 +62,13 @@ public void IsEquivalentToDetectsDifferentDifferentSequenceNumbers() { var firstEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); var secondEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -85,13 +85,13 @@ public void IsEquivalentToDetectsDifferentDifferentPartitionKey() { var firstEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); var secondEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44 }, - offset: 1, + offset: "1", partitionKey: "goodbye", systemProperties: new Dictionary { { "test", new object() } }); @@ -285,8 +285,8 @@ public void IsEquivalentToIgnoresMappedSystemPropertiesByDefault() public void IsEquivalentToDetectsDifferentTypedSystemProperties() { var body = new byte[] { 0x22, 0x44, 0x88 }; - var firstEvent = new MockEventData((byte[])body.Clone(), offset: 1); - var secondEvent = new MockEventData((byte[])body.Clone(), offset: 2); + var firstEvent = new MockEventData((byte[])body.Clone(), offset: "1"); + var secondEvent = new MockEventData((byte[])body.Clone(), offset: "2"); Assert.That(firstEvent.IsEquivalentTo(secondEvent, true), Is.False); } @@ -380,13 +380,13 @@ public void IsEquivalentToDetectsEqualEventsWithPartitionMetrics() var firstEvent = new MockEventData( eventBody: (byte[])body.Clone(), - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); var secondEvent = new MockEventData( eventBody: (byte[])body.Clone(), - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -405,13 +405,13 @@ public void IsEquivalentToDetectsEqualEventsWithoutPartitionMetrics() var firstEvent = new MockEventData( eventBody: (byte[])body.Clone(), - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); var secondEvent = new MockEventData( eventBody: (byte[])body.Clone(), - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -428,7 +428,7 @@ public void IsEquivalentToDetectsSameInstance() { var firstEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44, 0x88 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -456,7 +456,7 @@ public void IsEquivalentToDetectsNullInstance() { var firstEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44, 0x88 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -473,7 +473,7 @@ public void IsEquivalentToDetectsNullArgument() { var firstEvent = new MockEventData( eventBody: new byte[] { 0x22, 0x44, 0x88 }, - offset: 1, + offset: "1", partitionKey: "hello", systemProperties: new Dictionary { { "test", new object() } }); @@ -493,9 +493,9 @@ public MockEventData(ReadOnlyMemory eventBody, IDictionary properties = null, IReadOnlyDictionary systemProperties = null, long sequenceNumber = long.MinValue, - long offset = long.MinValue, + string offset = null, DateTimeOffset enqueuedTime = default, - string partitionKey = null) : base(eventBody, properties, systemProperties, sequenceNumber, offset, enqueuedTime, partitionKey) + string partitionKey = null) : base(BinaryData.FromBytes(eventBody), properties, systemProperties, sequenceNumber, offset, enqueuedTime, partitionKey) { } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/InMemoryCheckpointStoreTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/InMemoryCheckpointStoreTests.cs index bbe83a006e17..3181742c2902 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/InMemoryCheckpointStoreTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/Testing/InMemoryCheckpointStoreTests.cs @@ -432,8 +432,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherConsumerGroups() { var storageManager = new InMemoryCheckpointStore(); - await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup1", "partitionId", "Id", new CheckpointPosition(10)); - await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup2", "partitionId", "Id", new CheckpointPosition(10)); + await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup1", "partitionId", "Id", new CheckpointPosition("10")); + await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup2", "partitionId", "Id", new CheckpointPosition("444", 10)); var storedCheckpoint1 = await storageManager.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup1", "partitionId"); var storedCheckpoint2 = await storageManager.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup2", "partitionId"); @@ -452,8 +452,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherEventHubs() { var storageManager = new InMemoryCheckpointStore(); - await storageManager.UpdateCheckpointAsync("namespace", "eventHubName1", "consumerGroup", "partitionId", "Id", new CheckpointPosition(10)); - await storageManager.UpdateCheckpointAsync("namespace", "eventHubName2", "consumerGroup", "partitionId", "Id", new CheckpointPosition(10)); + await storageManager.UpdateCheckpointAsync("namespace", "eventHubName1", "consumerGroup", "partitionId", "Id", new CheckpointPosition("10")); + await storageManager.UpdateCheckpointAsync("namespace", "eventHubName2", "consumerGroup", "partitionId", "Id", new CheckpointPosition("444", 10)); var storedCheckpoint1 = await storageManager.GetCheckpointAsync("namespace", "eventHubName1", "consumerGroup", "partitionId"); var storedCheckpoint2 = await storageManager.GetCheckpointAsync("namespace", "eventHubName2", "consumerGroup", "partitionId"); @@ -472,8 +472,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherNamespaces() { var storageManager = new InMemoryCheckpointStore(); - await storageManager.UpdateCheckpointAsync("namespace1", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition(10)); - await storageManager.UpdateCheckpointAsync("namespace2", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition(10)); + await storageManager.UpdateCheckpointAsync("namespace1", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition("10")); + await storageManager.UpdateCheckpointAsync("namespace2", "eventHubName", "consumerGroup", "partitionId", "Id", new CheckpointPosition("444", 10)); var storedCheckpoint1 = await storageManager.GetCheckpointAsync("namespace1", "eventHubName", "consumerGroup", "partitionId"); var storedCheckpoint2 = await storageManager.GetCheckpointAsync("namespace2", "eventHubName", "consumerGroup", "partitionId"); @@ -492,8 +492,8 @@ public async Task CheckpointUpdateDoesNotInterfereWithOtherPartitions() { var storageManager = new InMemoryCheckpointStore(); - await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId1", "Id", new CheckpointPosition(10)); - await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId2", "Id", new CheckpointPosition(10)); + await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId1", "Id", new CheckpointPosition("111", 10)); + await storageManager.UpdateCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId2", "Id", new CheckpointPosition("9")); var storedCheckpoint1 = await storageManager.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId1"); var storedCheckpoint2 = await storageManager.GetCheckpointAsync("namespace", "eventHubName", "consumerGroup", "partitionId2"); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md index f7b7ce119387..2f8b8e4d1cfb 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/CHANGELOG.md @@ -724,11 +724,11 @@ Thank you to our developer community members who helped to make the Event Hubs c #### Features Added -- The `EventProcessor` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). +- The `EventProcessor` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). - The `EventHubConsumerClient` pipeline for reading events from a single partition was reworked to improve efficiency and make use of the new configuration options for `PrefetchCount` and `CacheEventCount`. -- The `ReadEventOptions` used with the `EventHubConsumerClient` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.readeventoptions?view=azure-dotnet). +- The `ReadEventOptions` used with the `EventHubConsumerClient` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.readeventoptions?view=azure-dotnet). - Logging for the core send and receive operations against the Event Hubs service can now be correlated by an `OperationId` in the logs and detail the number of retries attempted for the operation. @@ -767,15 +767,15 @@ Thank you to our developer community members who helped to make the Event Hubs c #### Consuming events -- The `ReadEventOptions` used with the `EventHubConsumerClient` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.readeventoptions?view=azure-dotnet). +- The `ReadEventOptions` used with the `EventHubConsumerClient` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.readeventoptions?view=azure-dotnet). - The `EventHubConsumerClient` pipeline for reading events from a single partition was reworked to improve efficiency and make use of the new configuration options for `PrefetchCount` and `CacheEventCount`. #### Processing events -- The `EventProcessor` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). +- The `EventProcessor` now supports a configurable strategy for load balancing, allowing control over whether it claims ownership of partitions in a balanced manner _(default)_ or more aggressively. The strategy may be set in the `EventProcessorOptions` when creating the processor. More details about strategies can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.processor.loadbalancingstrategy?view=azure-dotnet). -- The `EventProcessorClientOptions` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions?view=azure-dotnet). +- The `EventProcessorClientOptions` now support setting a `PrefetchCount` and `CacheEventCount` for performance tuning. More details about each can be found in the associated [documentation](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclientoptions?view=azure-dotnet). #### Diagnostics diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md b/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md index ab5b7698c179..749bc1e0d662 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md @@ -33,11 +33,11 @@ Tests in the Event Hubs client library are split into two categories: - **Azure Subscription:** To use Azure services, including Azure Event Hubs, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- **.NET SDK:** The Azure Event Hubs requires the [.NET SDK](https://dotnet.microsoft.com/download/dotnet/7.0) 7.0.100. (or a higher version in the 7.0.x band) with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `11.0`. Visual Studio users will need to use Visual Studio 2022 or later. Visual Studio 2022, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). +- **.NET SDK:** The Azure Event Hubs requires the [.NET SDK](https://dotnet.microsoft.com/download/dotnet/7.0) 7.0.100. (or a higher version in the 7.0.x band) with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `11.0`. Visual Studio users will need to use Visual Studio 2022 or later. Visual Studio 2022, including the free Community edition, can be downloaded [here](https://visualstudio.microsoft.com). - **PowerShell:** To use the Azure SDK automation for development tools and setting up your testing environment, PowerShell Core version 7.0 or greater is needed. This version is available cross-platform and can be installed from the [PowerShell Core repository](https://github.com/PowerShell/PowerShell/blob/master/README.md). -- **Azure PowerShell Module:** For PowerShell to interact with Azure, the [Azure Az module](https://docs.microsoft.com/powershell/azure/install-az-ps) is needed. +- **Azure PowerShell Module:** For PowerShell to interact with Azure, the [Azure Az module](https://learn.microsoft.com/powershell/azure/install-az-ps) is needed. ### Creating Azure resources for tests @@ -92,7 +92,7 @@ The full set of options for `New-TestResources.ps1` can be found in the [New-Tes #### Configuring the environment -When the `New-TestResources.ps1` script completes, it will output a set of environment variables needed by the tests when executing. On the Windows platform, the script will also emit an environment file read by the tests so that environment variables do not need to be explicitly set. The environment file is encrypted using the .NET [Data Protection API (DAPI)](https://docs.microsoft.com/dotnet/standard/security/how-to-use-data-protection) and can be read only by the user account that executed the script. +When the `New-TestResources.ps1` script completes, it will output a set of environment variables needed by the tests when executing. On the Windows platform, the script will also emit an environment file read by the tests so that environment variables do not need to be explicitly set. The environment file is encrypted using the .NET [Data Protection API (DAPI)](https://learn.microsoft.com/dotnet/standard/security/how-to-use-data-protection) and can be read only by the user account that executed the script. For non-Windows platforms, these environment variables will need to be available prior to running the tests. For more information on setting environment variables, please see [Azure SDK Live Test Resource Management](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/TestResources/README.md#on-the-desktop). @@ -125,7 +125,7 @@ The Event Hubs Live tests read information from the following environment variab - `AZURE_AUTHORITY_HOST` The URL of the Azure Authority to use for authenticating resource management operations. For the Azure public cloud, this should be: https://login.microsoftonline.com/. - When testing in other cloud instances, the appropriate host will be needed. See [National Clouds](https://docs.microsoft.com/azure/active-directory/develop/authentication-national-cloud) for more information. + When testing in other cloud instances, the appropriate host will be needed. See [National Clouds](https://learn.microsoft.com/azure/active-directory/develop/authentication-national-cloud) for more information. - `SERVICE_MANAGEMENT_URL` _**(optional)**_ The URL of the endpoint responsible for service management operations in Azure. The default for this is appropriate for use with the Azure public cloud; when testing in other cloud instances, specifying this value may be needed. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md b/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md index deae35e89f4f..7bcbc381d8f5 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide_WindowsAzureServiceBus.md @@ -57,25 +57,25 @@ The mainstream set of clients provides an approachable onboarding experience for In order to allow for a single focus and clear responsibility, the core functionality for publishing and reading events belongs to distinct clients, rather than the single `EventHubClient` used by previous versions. The producer and consumer clients operate in the context of a specific Event Hub and offer operations for all partitions. Clients in the `Azure.Messaging.EventHubs` family are not bound to a specific partition, instead offering specific partitions to be provided at the method-level, where needed. -- The [EventHubProducerClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer?view=azure-dotnet) is responsible for publishing events and supports multiple approaches for selecting the partition to which the event is associated, including automatic routing by the Event Hubs service and specifying an explicit partition. +- The [EventHubProducerClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer?view=azure-dotnet) is responsible for publishing events and supports multiple approaches for selecting the partition to which the event is associated, including automatic routing by the Event Hubs service and specifying an explicit partition. -- The [EventHubBufferedProducerClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer?view=azure-dotnet) publishes events using a deferred model where events are collected into a buffer and the producer has responsibility for implicitly batching and sending them. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hub-buffered-producer.md). +- The [EventHubBufferedProducerClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.producer?view=azure-dotnet) publishes events using a deferred model where events are collected into a buffer and the producer has responsibility for implicitly batching and sending them. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hub-buffered-producer.md). -- The [EventHubConsumerClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.eventhubconsumerclient?view=azure-dotnet) supports reading events from a single partition and also offers an easy way to familiarize yourself with Event Hubs by reading from all partitions without the rigor and complexity that you would need in a production application. For reading events from all partitions in a production scenario, we strongly recommend using the [EventProcessorClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient?view=azure-dotnet) over the `EventHubConsumerClient`. +- The [EventHubConsumerClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.consumer.eventhubconsumerclient?view=azure-dotnet) supports reading events from a single partition and also offers an easy way to familiarize yourself with Event Hubs by reading from all partitions without the rigor and complexity that you would need in a production application. For reading events from all partitions in a production scenario, we strongly recommend using the [EventProcessorClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient?view=azure-dotnet) over the `EventHubConsumerClient`. -- The [EventProcessorClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient?view=azure-dotnet) is responsible for reading and processing events for all partitions of an Event Hub. It will collaborate with other instances for the same Event Hub and consumer group pairing to balance work between them. A high degree of fault tolerance is built-in, allowing the processor to be resilient in the face of errors. The `EventProcessorClient` can be found in the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor/) package. +- The [EventProcessorClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient?view=azure-dotnet) is responsible for reading and processing events for all partitions of an Event Hub. It will collaborate with other instances for the same Event Hub and consumer group pairing to balance work between them. A high degree of fault tolerance is built-in, allowing the processor to be resilient in the face of errors. The `EventProcessorClient` can be found in the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor/) package. - One of the key features of the `EventProcessorClient` is enabling tracking of which events have been processed by interacting with a durable storage provider. This process is commonly referred to as [checkpointing](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#checkpointing) and the persisted state as a checkpoint. This version of the `EventProcessorClient` supports only Azure Storage Blobs as a backing store. + One of the key features of the `EventProcessorClient` is enabling tracking of which events have been processed by interacting with a durable storage provider. This process is commonly referred to as [checkpointing](https://learn.microsoft.com/azure/event-hubs/event-hubs-features#checkpointing) and the persisted state as a checkpoint. This version of the `EventProcessorClient` supports only Azure Storage Blobs as a backing store. - **_Important note on checkpoints:_** The [EventProcessorClient](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient?view=azure-dotnet) does not support legacy checkpoint data created using the `EventProcessorHost` from the `Microsoft.Azure.ServiceBus.EventProcessorHost` package. In order to allow for a unified format for checkpoint data across languages, a more efficient approach to data storage, and improvements to the algorithm used for managing partition ownership, breaking changes were necessary. + **_Important note on checkpoints:_** The [EventProcessorClient](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.eventprocessorclient?view=azure-dotnet) does not support legacy checkpoint data created using the `EventProcessorHost` from the `Microsoft.Azure.ServiceBus.EventProcessorHost` package. In order to allow for a unified format for checkpoint data across languages, a more efficient approach to data storage, and improvements to the algorithm used for managing partition ownership, breaking changes were necessary. #### Specialized -- The [PartitionReceiver](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.partitionreceiver?view=azure-dotnet) is responsible for reading events from a specific partition of an Event Hub, with a greater level of control over communication with the Event Hubs service than is offered by other event consumers. More detail on the design and philosophy for the `PartitionReceiver` can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-partition-receiver.md). +- The [PartitionReceiver](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.partitionreceiver?view=azure-dotnet) is responsible for reading events from a specific partition of an Event Hub, with a greater level of control over communication with the Event Hubs service than is offered by other event consumers. More detail on the design and philosophy for the `PartitionReceiver` can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-partition-receiver.md). -- The [PluggableCheckpointStoreEventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet) provides a base for creating a custom processor for reading and processing events from all partitions of an Event Hub, using the provided checkpoint store for state persistence. It fills a role similar to the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package, with cooperative load balancing and resiliency as its core features. However, `PluggableCheckpointStoreEventProcessor` also offers native batch processing, a greater level of control over communication with the Event Hubs service, and a less opinionated API. The caveat is that this comes with additional complexity and exists as an abstract base, which needs to be extended. +- The [PluggableCheckpointStoreEventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet) provides a base for creating a custom processor for reading and processing events from all partitions of an Event Hub, using the provided checkpoint store for state persistence. It fills a role similar to the [EventProcessorClient](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) from the [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) package, with cooperative load balancing and resiliency as its core features. However, `PluggableCheckpointStoreEventProcessor` also offers native batch processing, a greater level of control over communication with the Event Hubs service, and a less opinionated API. The caveat is that this comes with additional complexity and exists as an abstract base, which needs to be extended. -- The [EventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) is our lowest-level base for creating a custom processor allowing the greatest degree of customizability. It fills a role similar to the [PluggableCheckpointStoreEventProcessor<TPartition>](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet), with cooperative load balancing, resiliency, and batch processing as its core features. However, `EventProcessor` also provides the ability to customize checkpoint storage, including using different stores for ownership and checkpoint data. `EventProcessor` exists as an abstract base, which needs to be extended. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-processor%7BT%7D.md). +- The [EventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.eventprocessor-1?view=azure-dotnet) is our lowest-level base for creating a custom processor allowing the greatest degree of customizability. It fills a role similar to the [PluggableCheckpointStoreEventProcessor<TPartition>](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs.primitives.PluggableCheckpointStoreEventProcessor-1?view=azure-dotnet), with cooperative load balancing, resiliency, and batch processing as its core features. However, `EventProcessor` also provides the ability to customize checkpoint storage, including using different stores for ownership and checkpoint data. `EventProcessor` exists as an abstract base, which needs to be extended. More on the design and philosophy behind this type can be found in its [design document](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-processor%7BT%7D.md). ### Client constructors diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs b/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs index 12662ec7eec2..091f1b9a6203 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.net8.0.cs @@ -6,9 +6,13 @@ public EventData() { } public EventData(Azure.Core.Amqp.AmqpAnnotatedMessage amqpMessage) { } public EventData(System.BinaryData eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] protected EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, long sequenceNumber = (long)-9223372036854775808, long offset = (long)-9223372036854775808, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset), string partitionKey = null) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, long sequenceNumber = (long)-9223372036854775808, string offsetString = null, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset), string partitionKey = null) { } public EventData(System.ReadOnlyMemory eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.")] protected EventData(System.ReadOnlyMemory eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, long sequenceNumber = (long)-9223372036854775808, long offset = (long)-9223372036854775808, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset), string partitionKey = null) { } public EventData(string eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -26,7 +30,10 @@ public EventData(string eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool IsReadOnly { get { throw null; } } public string MessageId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead.", false)] public long Offset { get { throw null; } } + public string OffsetString { get { throw null; } } public string PartitionKey { get { throw null; } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } public long SequenceNumber { get { throw null; } } @@ -80,8 +87,11 @@ public EventHubConnectionOptions() { } } public partial class EventHubProperties { - protected internal EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds) { } + protected internal EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds, bool isGeoReplicationEnabled) { } public System.DateTimeOffset CreatedOn { get { throw null; } } + public bool IsGeoReplicationEnabled { get { throw null; } } public string Name { get { throw null; } } public string[] PartitionIds { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -139,14 +149,26 @@ public enum FailureReason } public static partial class EventHubsModelFactory { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public static Azure.Messaging.EventHubs.EventData EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, string partitionKey = null, long sequenceNumber = (long)-9223372036854775808, long offset = (long)-9223372036854775808, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventHubs.EventData EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, string partitionKey = null, long sequenceNumber = (long)-9223372036854775808, string offsetString = null, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset)) { throw null; } public static Azure.Messaging.EventHubs.Producer.EventDataBatch EventDataBatch(long batchSizeBytes, System.Collections.Generic.IList batchEventStore, Azure.Messaging.EventHubs.Producer.CreateBatchOptions batchOptions = null, System.Func tryAddCallback = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventHubs.EventHubProperties EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Messaging.EventHubs.EventHubProperties EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds, bool isGeoReplicationEnabled) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public static Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties LastEnqueuedEventProperties(long? lastSequenceNumber, long? lastOffset, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } + public static Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties LastEnqueuedEventProperties(long? lastSequenceNumber, string lastOffsetString, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventHubs.Consumer.PartitionContext PartitionContext(string partitionId, Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties lastEnqueuedEventProperties = default(Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties)) { throw null; } public static Azure.Messaging.EventHubs.Consumer.PartitionContext PartitionContext(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties lastEnqueuedEventProperties = default(Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public static Azure.Messaging.EventHubs.PartitionProperties PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, long lastOffset, System.DateTimeOffset lastEnqueuedTime) { throw null; } + public static Azure.Messaging.EventHubs.PartitionProperties PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, string lastOffsetString, System.DateTimeOffset lastEnqueuedTime) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventHubs.Producer.PartitionPublishingProperties PartitionPublishingProperties(bool isIdempotentPublishingEnabled, long? producerGroupId, short? ownerLevel, int? lastPublishedSequenceNumber) { throw null; } } @@ -184,12 +206,18 @@ public enum EventHubsTransportType } public partial class PartitionProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] protected internal PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, long lastOffset, System.DateTimeOffset lastEnqueuedTime) { } + protected internal PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, string lastOffsetString, System.DateTimeOffset lastEnqueuedTime) { } public long BeginningSequenceNumber { get { throw null; } } public string EventHubName { get { throw null; } } public string Id { get { throw null; } } public bool IsEmpty { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'LastEnqueuedOffsetString' instead.", false)] public long LastEnqueuedOffset { get { throw null; } } + public string LastEnqueuedOffsetString { get { throw null; } } public long LastEnqueuedSequenceNumber { get { throw null; } } public System.DateTimeOffset LastEnqueuedTime { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -260,7 +288,10 @@ public partial struct EventPosition : System.IEquatable { + private object _dummy; private int _dummyPrimitive; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] + public LastEnqueuedEventProperties(long? lastSequenceNumber, long lastOffset, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public LastEnqueuedEventProperties(long? lastSequenceNumber, long? lastOffset, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } + public LastEnqueuedEventProperties(long? lastSequenceNumber, string lastOffsetString, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } public System.DateTimeOffset? EnqueuedTime { get { throw null; } } public System.DateTimeOffset? LastReceivedTime { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead.", false)] public long? Offset { get { throw null; } } + public string OffsetString { get { throw null; } } public long? SequenceNumber { get { throw null; } } public bool Equals(Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -332,6 +373,8 @@ protected CheckpointStore() { } public abstract System.Threading.Tasks.Task> ClaimOwnershipAsync(System.Collections.Generic.IEnumerable desiredOwnership, System.Threading.CancellationToken cancellationToken); public abstract System.Threading.Tasks.Task GetCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, System.Threading.CancellationToken cancellationToken); public abstract System.Threading.Tasks.Task> ListOwnershipAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] public virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -394,6 +437,7 @@ protected EventProcessor(int eventBatchMaximumCount, string consumerGroup, strin public string ConsumerGroup { get { throw null; } } protected bool EnableBatchTracing { get { throw null; } set { } } public string EventHubName { get { throw null; } } + protected Azure.Messaging.EventHubs.EventHubProperties EventHubProperties { get { throw null; } } public string FullyQualifiedNamespace { get { throw null; } } public string Identifier { get { throw null; } } public bool IsRunning { get { throw null; } protected set { } } @@ -421,6 +465,8 @@ protected EventProcessor(int eventBatchMaximumCount, string consumerGroup, strin [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } protected virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] protected virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal virtual System.Threading.Tasks.Task ValidateProcessingPreconditions(System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -483,6 +529,8 @@ protected PluggableCheckpointStoreEventProcessor(Azure.Messaging.EventHubs.Primi protected override System.Threading.Tasks.Task GetCheckpointAsync(string partitionId, System.Threading.CancellationToken cancellationToken) { throw null; } protected override System.Threading.Tasks.Task> ListOwnershipAsync(System.Threading.CancellationToken cancellationToken) { throw null; } protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } } } @@ -491,8 +539,19 @@ namespace Azure.Messaging.EventHubs.Processor [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct CheckpointPosition : System.IEquatable { + private object _dummy; private int _dummyPrimitive; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee that a sequence number-only checkpoint can access the event stream for all resource configurations. Reading events may not work in all cases going forward. Please provide a string-based offset.", false)] public CheckpointPosition(long sequenceNumber) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset instead.", false)] + public CheckpointPosition(long offset, long sequenceNumber = (long)-9223372036854775808) { throw null; } + public CheckpointPosition(string offsetString, long sequenceNumber = (long)-9223372036854775808) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead.", false)] + public long Offset { get { throw null; } } + public string OffsetString { get { throw null; } } public long SequenceNumber { get { throw null; } } public bool Equals(Azure.Messaging.EventHubs.Processor.CheckpointPosition other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.netstandard2.0.cs b/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.netstandard2.0.cs index 7d23614281bc..3a9e0a4fa2cd 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.netstandard2.0.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/api/Azure.Messaging.EventHubs.netstandard2.0.cs @@ -6,9 +6,13 @@ public EventData() { } public EventData(Azure.Core.Amqp.AmqpAnnotatedMessage amqpMessage) { } public EventData(System.BinaryData eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] protected EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, long sequenceNumber = (long)-9223372036854775808, long offset = (long)-9223372036854775808, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset), string partitionKey = null) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, long sequenceNumber = (long)-9223372036854775808, string offsetString = null, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset), string partitionKey = null) { } public EventData(System.ReadOnlyMemory eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.")] protected EventData(System.ReadOnlyMemory eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, long sequenceNumber = (long)-9223372036854775808, long offset = (long)-9223372036854775808, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset), string partitionKey = null) { } public EventData(string eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -26,7 +30,10 @@ public EventData(string eventBody) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool IsReadOnly { get { throw null; } } public string MessageId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead.", false)] public long Offset { get { throw null; } } + public string OffsetString { get { throw null; } } public string PartitionKey { get { throw null; } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } public long SequenceNumber { get { throw null; } } @@ -80,8 +87,11 @@ public EventHubConnectionOptions() { } } public partial class EventHubProperties { - protected internal EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds) { } + protected internal EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds, bool isGeoReplicationEnabled) { } public System.DateTimeOffset CreatedOn { get { throw null; } } + public bool IsGeoReplicationEnabled { get { throw null; } } public string Name { get { throw null; } } public string[] PartitionIds { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -139,14 +149,26 @@ public enum FailureReason } public static partial class EventHubsModelFactory { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public static Azure.Messaging.EventHubs.EventData EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, string partitionKey = null, long sequenceNumber = (long)-9223372036854775808, long offset = (long)-9223372036854775808, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventHubs.EventData EventData(System.BinaryData eventBody, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary systemProperties = null, string partitionKey = null, long sequenceNumber = (long)-9223372036854775808, string offsetString = null, System.DateTimeOffset enqueuedTime = default(System.DateTimeOffset)) { throw null; } public static Azure.Messaging.EventHubs.Producer.EventDataBatch EventDataBatch(long batchSizeBytes, System.Collections.Generic.IList batchEventStore, Azure.Messaging.EventHubs.Producer.CreateBatchOptions batchOptions = null, System.Func tryAddCallback = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventHubs.EventHubProperties EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Messaging.EventHubs.EventHubProperties EventHubProperties(string name, System.DateTimeOffset createdOn, string[] partitionIds, bool isGeoReplicationEnabled) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public static Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties LastEnqueuedEventProperties(long? lastSequenceNumber, long? lastOffset, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } + public static Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties LastEnqueuedEventProperties(long? lastSequenceNumber, string lastOffsetString, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventHubs.Consumer.PartitionContext PartitionContext(string partitionId, Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties lastEnqueuedEventProperties = default(Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties)) { throw null; } public static Azure.Messaging.EventHubs.Consumer.PartitionContext PartitionContext(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties lastEnqueuedEventProperties = default(Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public static Azure.Messaging.EventHubs.PartitionProperties PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, long lastOffset, System.DateTimeOffset lastEnqueuedTime) { throw null; } + public static Azure.Messaging.EventHubs.PartitionProperties PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, string lastOffsetString, System.DateTimeOffset lastEnqueuedTime) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventHubs.Producer.PartitionPublishingProperties PartitionPublishingProperties(bool isIdempotentPublishingEnabled, long? producerGroupId, short? ownerLevel, int? lastPublishedSequenceNumber) { throw null; } } @@ -184,12 +206,18 @@ public enum EventHubsTransportType } public partial class PartitionProperties { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] protected internal PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, long lastOffset, System.DateTimeOffset lastEnqueuedTime) { } + protected internal PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, string lastOffsetString, System.DateTimeOffset lastEnqueuedTime) { } public long BeginningSequenceNumber { get { throw null; } } public string EventHubName { get { throw null; } } public string Id { get { throw null; } } public bool IsEmpty { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'LastEnqueuedOffsetString' instead.", false)] public long LastEnqueuedOffset { get { throw null; } } + public string LastEnqueuedOffsetString { get { throw null; } } public long LastEnqueuedSequenceNumber { get { throw null; } } public System.DateTimeOffset LastEnqueuedTime { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -260,7 +288,10 @@ public partial struct EventPosition : System.IEquatable { + private object _dummy; + private int _dummyPrimitive; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] + public LastEnqueuedEventProperties(long? lastSequenceNumber, long lastOffset, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use the overload with a string-based offset instead.", false)] public LastEnqueuedEventProperties(long? lastSequenceNumber, long? lastOffset, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } + public LastEnqueuedEventProperties(long? lastSequenceNumber, string lastOffsetString, System.DateTimeOffset? lastEnqueuedTime, System.DateTimeOffset? lastReceivedTime) { throw null; } public System.DateTimeOffset? EnqueuedTime { get { throw null; } } public System.DateTimeOffset? LastReceivedTime { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead.", false)] public long? Offset { get { throw null; } } + public string OffsetString { get { throw null; } } public long? SequenceNumber { get { throw null; } } public bool Equals(Azure.Messaging.EventHubs.Consumer.LastEnqueuedEventProperties other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -331,6 +373,8 @@ protected CheckpointStore() { } public abstract System.Threading.Tasks.Task> ClaimOwnershipAsync(System.Collections.Generic.IEnumerable desiredOwnership, System.Threading.CancellationToken cancellationToken); public abstract System.Threading.Tasks.Task GetCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, System.Threading.CancellationToken cancellationToken); public abstract System.Threading.Tasks.Task> ListOwnershipAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, System.Threading.CancellationToken cancellationToken); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] public virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -393,6 +437,7 @@ protected EventProcessor(int eventBatchMaximumCount, string consumerGroup, strin public string ConsumerGroup { get { throw null; } } protected bool EnableBatchTracing { get { throw null; } set { } } public string EventHubName { get { throw null; } } + protected Azure.Messaging.EventHubs.EventHubProperties EventHubProperties { get { throw null; } } public string FullyQualifiedNamespace { get { throw null; } } public string Identifier { get { throw null; } } public bool IsRunning { get { throw null; } protected set { } } @@ -420,6 +465,8 @@ protected EventProcessor(int eventBatchMaximumCount, string consumerGroup, strin [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override string ToString() { throw null; } protected virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] protected virtual System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal virtual System.Threading.Tasks.Task ValidateProcessingPreconditions(System.Threading.CancellationToken cancellationToken) { throw null; } } @@ -482,6 +529,8 @@ protected PluggableCheckpointStoreEventProcessor(Azure.Messaging.EventHubs.Primi protected override System.Threading.Tasks.Task GetCheckpointAsync(string partitionId, System.Threading.CancellationToken cancellationToken) { throw null; } protected override System.Threading.Tasks.Task> ListOwnershipAsync(System.Threading.CancellationToken cancellationToken) { throw null; } protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)] protected override System.Threading.Tasks.Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, System.Threading.CancellationToken cancellationToken) { throw null; } } } @@ -490,8 +539,19 @@ namespace Azure.Messaging.EventHubs.Processor [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct CheckpointPosition : System.IEquatable { + private object _dummy; private int _dummyPrimitive; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee that a sequence number-only checkpoint can access the event stream for all resource configurations. Reading events may not work in all cases going forward. Please provide a string-based offset.", false)] public CheckpointPosition(long sequenceNumber) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset instead.", false)] + public CheckpointPosition(long offset, long sequenceNumber = (long)-9223372036854775808) { throw null; } + public CheckpointPosition(string offsetString, long sequenceNumber = (long)-9223372036854775808) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("The Event Hubs service does not guarantee a numeric offset for all resource configurations. Please use 'OffsetString' instead.", false)] + public long Offset { get { throw null; } } + public string OffsetString { get { throw null; } } public long SequenceNumber { get { throw null; } } public bool Equals(Azure.Messaging.EventHubs.Processor.CheckpointPosition other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-custom-endpoint-address.md b/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-custom-endpoint-address.md index 72e018ada77b..3f8479c1b72a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-custom-endpoint-address.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-custom-endpoint-address.md @@ -22,7 +22,7 @@ While the standard approach works well under normal circumstances, it can be tro ## Why this is needed -Some of our enterprise customers with environments using unconventional proxy configurations or with certain configurations of an Express Route circuit are unable to connect from their on-premises network to the Event Hubs service. The [Event Hubs Private Link](https://docs.microsoft.com/azure/event-hubs/private-link-service) feature will unblock the Express Route scenario. However, Private Link is a premium feature with cost considerations and which carries a set of [limitations](https://docs.microsoft.com/azure/private-link/private-link-service-overview#limitations). It is also not certain that the Private Link feature will resolve all blocking issues, such as those related to local proxying. +Some of our enterprise customers with environments using unconventional proxy configurations or with certain configurations of an Express Route circuit are unable to connect from their on-premises network to the Event Hubs service. The [Event Hubs Private Link](https://learn.microsoft.com/azure/event-hubs/private-link-service) feature will unblock the Express Route scenario. However, Private Link is a premium feature with cost considerations and which carries a set of [limitations](https://learn.microsoft.com/azure/private-link/private-link-service-overview#limitations). It is also not certain that the Private Link feature will resolve all blocking issues, such as those related to local proxying. ## High level scenarios diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hubs-second-preview.md b/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hubs-second-preview.md index d63c26c169c7..d9ef4b609e5c 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hubs-second-preview.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/design/proposal-event-hubs-second-preview.md @@ -1,6 +1,6 @@ # .NET Event Hubs Client: Track Two Proposal (Second Preview) -Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. Once Event Hubs has collected the data, you can retrieve, transform and store it by using any real-time analytics provider or with batching/storage adapters. If you would like to know more about Azure Event Hubs, you may wish to review: [What is Event Hubs](https://docs.microsoft.com/azure/event-hubs/event-hubs-about)? +Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. Once Event Hubs has collected the data, you can retrieve, transform and store it by using any real-time analytics provider or with batching/storage adapters. If you would like to know more about Azure Event Hubs, you may wish to review: [What is Event Hubs](https://learn.microsoft.com/azure/event-hubs/event-hubs-about)? ## Design Overview @@ -12,7 +12,7 @@ This design is focused on the second preview of the track two Event Hubs client - Continue to align the public API surface area to the guidance outlined in the [Azure SDK Design Guidelines for .NET](https://azuresdkspecs.z5.web.core.windows.net/DotNetSpec.html). -- Design an exception hierarchy that follows the overall pattern used by the track one client, limiting changes and allowing the published [exception guidance](https://docs.microsoft.com/azure/event-hubs/event-hubs-messaging-exceptions) to remain as relevant as possible. +- Design an exception hierarchy that follows the overall pattern used by the track one client, limiting changes and allowing the published [exception guidance](https://learn.microsoft.com/azure/event-hubs/event-hubs-messaging-exceptions) to remain as relevant as possible. - Streamline the design around timeouts and retries, making the common scenarios easier while allowing developers with advanced scenarios to customize. @@ -64,11 +64,11 @@ This indicates that the Event Hubs service did not respond to an operation withi #### `MessageSizeExceededException` -Event data, both individual and in batches, have a maximum size allowed. This includes the data of the event, as well as any associated metadata and system overhead. The best approach for resolving this error is to reduce the number of events being sent in a batch or the size of data included in the message. Because size limits are subject to change, please refer to [Azure Event Hubs quotas and limits](https://docs.microsoft.com/azure/event-hubs/event-hubs-quotas) for specifics. +Event data, both individual and in batches, have a maximum size allowed. This includes the data of the event, as well as any associated metadata and system overhead. The best approach for resolving this error is to reduce the number of events being sent in a batch or the size of data included in the message. Because size limits are subject to change, please refer to [Azure Event Hubs quotas and limits](https://learn.microsoft.com/azure/event-hubs/event-hubs-quotas) for specifics. #### `QuotaExceededException` -The messaging entity has reached its maximum allowable size. This exception can happen if the maximum number of consumers have already been created for a given partition and consumer group. Because limits are subject to change, please refer to [Azure Event Hubs quotas and limits](https://docs.microsoft.com/azure/event-hubs/event-hubs-quotas) for specifics. +The messaging entity has reached its maximum allowable size. This exception can happen if the maximum number of consumers have already been created for a given partition and consumer group. Because limits are subject to change, please refer to [Azure Event Hubs quotas and limits](https://learn.microsoft.com/azure/event-hubs/event-hubs-quotas) for specifics. #### `DateTimeOffset` diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md index 150f71450953..c732e7376efa 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample01_HelloWorld.md @@ -86,7 +86,7 @@ An Event Hub consumer is associated with a specific Event Hub and [consumer grou Each consumer has a unique view of the events in a partition that it reads from, which means that events are available to all consumers and are not removed from the partition when read. This allows consumers to read and process events from the Event Hub at different speeds without interfering with one another. -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com/azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). Once removed, the events are no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ```C# Snippet:EventHubs_Sample01_ReadEvents try diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md index 85759f4524b0..c2c6b7fbd3d5 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample03_EventHubMetadata.md @@ -100,7 +100,7 @@ try Debug.WriteLine($"\tThe partition contains no events: { partitionProperties.IsEmpty }"); Debug.WriteLine($"\tThe first sequence number is: { partitionProperties.BeginningSequenceNumber }"); Debug.WriteLine($"\tThe last sequence number is: { partitionProperties.LastEnqueuedSequenceNumber }"); - Debug.WriteLine($"\tThe last offset is: { partitionProperties.LastEnqueuedOffset }"); + Debug.WriteLine($"\tThe last offset is: { partitionProperties.LastEnqueuedOffsetString }"); Debug.WriteLine($"\tThe last enqueued time is: { partitionProperties.LastEnqueuedTime }, in UTC."); } finally diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md index 94ca65f79971..8e36b63fa7a9 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample04_PublishingEvents.md @@ -33,7 +33,7 @@ The `EventHubBufferedProducerClient` aims to reduce complexity by owning the res ## Event lifetime -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com/azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ## Publishing size constraints diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md index 7350b783ebd0..a3621094492d 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample05_ReadingEvents.md @@ -27,7 +27,7 @@ Each of the event consumer client types are safe to cache and use for the lifeti ## Event lifetime -When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com//azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. +When events are published, they will continue to exist in the Event Hub and be available for consuming until they reach an age where they are older than the [retention period](https://learn.microsoft.com/azure/event-hubs/event-hubs-faq#what-is-the-maximum-retention-period-for-events). After that point in time, the Event Hubs service may chose to remove them from the partition. Once removed, an event is no longer available to be read and cannot be recovered. Though the Event Hubs service is free to remove events older than the retention period, it does not do so deterministically; there is no guarantee of when events will be removed. ## Reading and consumer groups @@ -386,7 +386,7 @@ try string firstPartition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); PartitionProperties properties = await consumer.GetPartitionPropertiesAsync(firstPartition, cancellationSource.Token); - EventPosition startingPosition = EventPosition.FromOffset(properties.LastEnqueuedOffset); + EventPosition startingPosition = EventPosition.FromOffset(properties.LastEnqueuedOffsetString); await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync( firstPartition, @@ -503,7 +503,7 @@ try Debug.WriteLine($"Partition: { partitionEvent.Partition.PartitionId }"); Debug.WriteLine($"\tThe last sequence number is: { properties.SequenceNumber }"); - Debug.WriteLine($"\tThe last offset is: { properties.Offset }"); + Debug.WriteLine($"\tThe last offset is: { properties.OffsetString }"); Debug.WriteLine($"\tThe last enqueued time is: { properties.EnqueuedTime }, in UTC."); Debug.WriteLine($"\tThe information was updated at: { properties.LastReceivedTime }, in UTC."); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md index e148dd792149..29a1e5cf9656 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/samples/Sample11_MockingClientTypes.md @@ -220,7 +220,7 @@ Mock mockConsumer = new(); LastEnqueuedEventProperties lastEnqueueEventProperties = EventHubsModelFactory.LastEnqueuedEventProperties( lastSequenceNumber : 1234, - lastOffset : 234, + lastOffsetString : "234:1:954-2", lastEnqueuedTime : DateTimeOffset.Parse("1:24 AM"), lastReceivedTime : DateTimeOffset.Parse("1:26 AM")); @@ -246,7 +246,7 @@ async IAsyncEnumerable mockReturn() systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:44:59492", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); EventData eventData2 = EventHubsModelFactory.EventData( @@ -254,7 +254,7 @@ async IAsyncEnumerable mockReturn() systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:2:1111", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); // This creates a mock PartitionEvent to return from the consumer client. @@ -341,7 +341,7 @@ for (int index = 0; index < 10; index++) systemProperties: new Dictionary(), //arbitrary value partitionKey: $"sample-key-{index}", sequenceNumber: 1234, - offset: 234, + offsetString: "234:5:93928381.1", enqueuedTime: DateTimeOffset.Parse("9:25 AM")); receivedEvents.Add(eventData); @@ -431,7 +431,7 @@ Dictionary partitionProperties = new() isEmpty : true, beginningSequenceNumber: 1000, lastSequenceNumber : 1100, - lastOffset : 500, + lastOffsetString : "500:1:7863", lastEnqueuedTime : DateTime.UtcNow) }, // Empty partition @@ -441,7 +441,7 @@ Dictionary partitionProperties = new() isEmpty : false, beginningSequenceNumber : 2000, lastSequenceNumber : 2000, - lastOffset : 760, + lastOffsetString : "760:1:8800", lastEnqueuedTime : DateTime.UtcNow) } }; diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotatedMessageExtensions.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotatedMessageExtensions.cs index c42a363462a8..cd64f1480e62 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotatedMessageExtensions.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotatedMessageExtensions.cs @@ -33,11 +33,11 @@ internal static class AmqpAnnotatedMessageExtensions public static void PopulateFromEventProperties(this AmqpAnnotatedMessage instance, IDictionary properties = null, long? sequenceNumber = null, - long? offset = null, + string offset = null, DateTimeOffset? enqueuedTime = null, string partitionKey = null, long? lastPartitionSequenceNumber = null, - long? lastPartitionOffset = null, + string lastPartitionOffset = null, DateTimeOffset? lastPartitionEnqueuedTime = null, DateTimeOffset? lastPartitionPropertiesRetrievalTime = null) { @@ -51,9 +51,9 @@ public static void PopulateFromEventProperties(this AmqpAnnotatedMessage instanc instance.MessageAnnotations[AmqpProperty.SequenceNumber.ToString()] = sequenceNumber.Value; } - if (offset.HasValue) + if (!string.IsNullOrEmpty(offset)) { - instance.MessageAnnotations[AmqpProperty.Offset.ToString()] = offset.Value; + instance.MessageAnnotations[AmqpProperty.Offset.ToString()] = offset; } if (enqueuedTime.HasValue) @@ -71,9 +71,9 @@ public static void PopulateFromEventProperties(this AmqpAnnotatedMessage instanc instance.DeliveryAnnotations[AmqpProperty.PartitionLastEnqueuedSequenceNumber.ToString()] = lastPartitionSequenceNumber.Value; } - if (lastPartitionOffset.HasValue) + if (!string.IsNullOrEmpty(lastPartitionOffset)) { - instance.DeliveryAnnotations[AmqpProperty.PartitionLastEnqueuedOffset.ToString()] = lastPartitionOffset.Value; + instance.DeliveryAnnotations[AmqpProperty.PartitionLastEnqueuedOffset.ToString()] = lastPartitionOffset; } if (lastPartitionEnqueuedTime.HasValue) @@ -188,13 +188,13 @@ public static long GetSequenceNumber(this AmqpAnnotatedMessage instance, /// /// The offset, if represented in the ; otherwise, . /// - public static long GetOffset(this AmqpAnnotatedMessage instance, - long defaultValue = long.MinValue) + public static string GetOffset(this AmqpAnnotatedMessage instance, + string defaultValue = default) { if ((instance.HasSection(AmqpMessageSection.MessageAnnotations)) && (instance.MessageAnnotations.TryGetValue(AmqpProperty.Offset.ToString(), out var value))) { - return (long)value; + return (string)value; } return defaultValue; @@ -298,13 +298,13 @@ public static void SetPartitionKey(this AmqpAnnotatedMessage instance, /// /// The offset of the last event published to the partition, if represented in the ; otherwise, . /// - public static long? GetLastPartitionOffset(this AmqpAnnotatedMessage instance, - long? defaultValue = default) + public static string GetLastPartitionOffset(this AmqpAnnotatedMessage instance, + string defaultValue = default) { if ((instance.HasSection(AmqpMessageSection.DeliveryAnnotations)) && (instance.DeliveryAnnotations.TryGetValue(AmqpProperty.PartitionLastEnqueuedOffset.ToString(), out var value))) { - return (long)value; + return (string)value; } return defaultValue; diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs index 57ac47bd7a8b..eb7025327ba5 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs @@ -702,6 +702,9 @@ protected virtual async Task CreateReceivingLinkAsync(AmqpCon linkSettings.AddProperty(AmqpProperty.ConsumerIdentifier, linkIdentifier); } + linkSettings.DesiredCapabilities ??= new Multiple(); + linkSettings.DesiredCapabilities.Add(AmqpProperty.GeoReplication); + if (trackLastEnqueuedEventProperties) { linkSettings.DesiredCapabilities ??= new Multiple(); @@ -807,6 +810,9 @@ protected virtual async Task CreateSendingLinkAsync(AmqpConnect linkSettings.AddProperty(AmqpProperty.Timeout, (uint)linkTimeout.CalculateRemaining(stopWatch.GetElapsedTime()).TotalMilliseconds); linkSettings.AddProperty(AmqpProperty.EntityType, (int)AmqpProperty.Entity.EventHub); + linkSettings.DesiredCapabilities ??= new Multiple(); + linkSettings.DesiredCapabilities.Add(AmqpProperty.GeoReplication); + if ((features & TransportProducerFeatures.IdempotentPublishing) != 0) { linkSettings.DesiredCapabilities ??= new Multiple(); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConsumer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConsumer.cs index 82bfb0b0bd1e..828d100860a1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConsumer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConsumer.cs @@ -297,9 +297,9 @@ public override async Task> ReceiveAsync(int maximumEve firstReceivedEvent = receivedEvents[0]; lastReceivedEvent = receivedEvents[receivedEventCount - 1]; - if (lastReceivedEvent.Offset > long.MinValue) + if (!string.IsNullOrEmpty(lastReceivedEvent.OffsetString)) { - CurrentEventPosition = EventPosition.FromOffset(lastReceivedEvent.Offset, false); + CurrentEventPosition = EventPosition.FromOffset(lastReceivedEvent.OffsetString, false); } if (TrackLastEnqueuedEventProperties) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpFilter.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpFilter.cs index a9fb19fd33c6..09b70af4c2b5 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpFilter.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpFilter.cs @@ -57,9 +57,9 @@ public static string BuildFilterExpression(EventPosition eventPosition) { // Build the filter expression, in the order of significance. - if (!string.IsNullOrEmpty(eventPosition.Offset)) + if (!string.IsNullOrEmpty(eventPosition.OffsetString)) { - return $"{ OffsetName } { (eventPosition.IsInclusive ? ">=" : ">") } { eventPosition.Offset }"; + return $"{ OffsetName } { (eventPosition.IsInclusive ? ">=" : ">") } { eventPosition.OffsetString }"; } if (!string.IsNullOrEmpty(eventPosition.SequenceNumber)) @@ -72,7 +72,7 @@ public static string BuildFilterExpression(EventPosition eventPosition) return $"{ EnqueuedTimeName } > { eventPosition.EnqueuedTime.Value.ToUnixTimeMilliseconds() }"; } - // If no filter was built, than the event position is not valid for filtering. + // If no filter was built, then the event position is not valid for filtering. throw new ArgumentException(Resources.InvalidEventPositionForFilter, nameof(eventPosition)); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpManagement.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpManagement.cs index 682fa3be3b39..7d8c65603d34 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpManagement.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpManagement.cs @@ -74,6 +74,12 @@ public static class ResponseMap /// public static MapKey PartitionIdentifiers { get; } = new MapKey("partition_ids"); + /// + /// The message property that identifies whether this Event Hub has geo-replication enabled. + /// + /// + public static MapKey GeoReplicationFactor { get; } = new MapKey("georeplication_factor"); + /// /// The message property that identifies the beginning sequence number in a partition. /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs index c24eb1364334..d6c879b296a1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs @@ -39,9 +39,7 @@ internal class AmqpMessageConverter private static readonly HashSet SystemPropertyLongKeys = new() { AmqpProperty.SequenceNumber.ToString(), - AmqpProperty.Offset.ToString(), AmqpProperty.PartitionLastEnqueuedSequenceNumber.ToString(), - AmqpProperty.PartitionLastEnqueuedOffset.ToString() }; /// @@ -181,10 +179,17 @@ public virtual EventHubProperties CreateEventHubPropertiesFromResponse(AmqpMessa throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidMessageBody, typeof(AmqpMap).Name)); } + var geoReplicationEnabled = responseData[AmqpManagement.ResponseMap.GeoReplicationFactor] switch + { + int count when count > 1 => true, + _ => false + }; + return new EventHubProperties( (string)responseData[AmqpManagement.ResponseMap.Name], new DateTimeOffset((DateTime)responseData[AmqpManagement.ResponseMap.CreatedAt], TimeSpan.Zero), - (string[])responseData[AmqpManagement.ResponseMap.PartitionIdentifiers]); + (string[])responseData[AmqpManagement.ResponseMap.PartitionIdentifiers], + geoReplicationEnabled); } /// @@ -250,7 +255,7 @@ public virtual PartitionProperties CreatePartitionPropertiesFromResponse(AmqpMes (bool)responseData[AmqpManagement.ResponseMap.PartitionRuntimeInfoPartitionIsEmpty], (long)responseData[AmqpManagement.ResponseMap.PartitionBeginSequenceNumber], (long)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedSequenceNumber], - long.Parse((string)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset], NumberStyles.Integer, CultureInfo.InvariantCulture), + (string)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset], new DateTimeOffset((DateTime)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedTimeUtc], TimeSpan.Zero)); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs index 5ac1bb58d36c..6906dd509084 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs @@ -43,6 +43,12 @@ internal static class AmqpProperty /// public static AmqpSymbol TrackLastEnqueuedEventProperties { get; } = AmqpConstants.Vendor + ":enable-receiver-runtime-metric"; + /// + /// The capability for geo replication in a namespace, to associate with a link. + /// + /// + public static AmqpSymbol GeoReplication { get; } = AmqpConstants.Vendor + ":georeplication"; + /// /// The capability for opting-into idempotent publishing. /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj index 6c36318bcf20..3886bff09ec5 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Azure.Messaging.EventHubs.csproj @@ -2,7 +2,7 @@ Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This client library allows for both publishing and consuming events using Azure Event Hubs. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/ 5.12.0-beta.2 - + 5.11.4 Azure;Event Hubs;EventHubs;.NET;AMQP;IoT;$(PackageCommonTags) $(RequiredTargetFrameworks) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/EventPosition.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/EventPosition.cs index fe0d8731e57a..75bdbc21510f 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/EventPosition.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/EventPosition.cs @@ -5,6 +5,7 @@ using System.ComponentModel; using System.Globalization; using Azure.Core; +using Azure.Messaging.EventHubs.Core; namespace Azure.Messaging.EventHubs.Consumer { @@ -27,7 +28,7 @@ public struct EventPosition : IEquatable /// which has not expired due to the retention policy. /// /// - public static EventPosition Earliest { get; } = new EventPosition { Offset = StartOfStream, IsInclusive = false }; + public static EventPosition Earliest { get; } = new EventPosition { OffsetString = StartOfStream, IsInclusive = false }; /// /// Corresponds to the end of the partition, where no more events are currently enqueued. Use this @@ -35,7 +36,7 @@ public struct EventPosition : IEquatable /// consumer begins reading with this position. /// /// - public static EventPosition Latest { get; } = new EventPosition { Offset = EndOfStream, IsInclusive = false }; + public static EventPosition Latest { get; } = new EventPosition { OffsetString = EndOfStream, IsInclusive = false }; /// /// The offset of the event identified by this position. @@ -43,7 +44,7 @@ public struct EventPosition : IEquatable /// /// Expected to be null if the event position represents a sequence number or enqueue time. /// - internal string Offset { get; set; } + internal string OffsetString { get; set; } /// /// Indicates if the specified offset is inclusive of the event which it identifies. This @@ -71,6 +72,8 @@ public struct EventPosition : IEquatable internal string SequenceNumber { get; set; } /// + /// Obsolete. + /// /// Corresponds to a specific offset in the partition event stream. By default, if an event is located /// at that offset, it will be read. Setting to false will skip the /// event at that offset and begin reading at the next available event. @@ -81,12 +84,41 @@ public struct EventPosition : IEquatable /// /// The specified position of an event in the partition. /// + /// + /// This method is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetEventPositionObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public static EventPosition FromOffset(long offset, bool isInclusive = true) { return new EventPosition { - Offset = offset.ToString(CultureInfo.InvariantCulture), + OffsetString = (offset != long.MinValue) ? offset.ToString(CultureInfo.InvariantCulture) : StartOfStream, + IsInclusive = isInclusive + }; + } + + /// + /// Corresponds to a specific offset in the partition event stream. By default, if an event is located + /// at that offset, it will be read. Setting to false will skip the + /// event at that offset and begin reading at the next available event. + /// + /// + /// The offset of an event with respect to its relative position in the partition. + /// When true, the event with the is included; otherwise the next event in sequence will be read. + /// + /// The specified position of an event in the partition. + /// + public static EventPosition FromOffset(string offsetString, + bool isInclusive = true) + { + Argument.AssertNotNullOrEmpty(offsetString, nameof(offsetString)); + + return new EventPosition + { + OffsetString = offsetString, IsInclusive = isInclusive }; } @@ -139,7 +171,7 @@ public static EventPosition FromEnqueuedTime(DateTimeOffset enqueuedTime) /// public bool Equals(EventPosition other) { - return (Offset == other.Offset) + return (OffsetString == other.OffsetString) && (SequenceNumber == other.SequenceNumber) && (EnqueuedTime == other.EnqueuedTime) && (IsInclusive == other.IsInclusive); @@ -171,7 +203,7 @@ public override bool Equals(object obj) => public override int GetHashCode() { var hashCode = new HashCodeBuilder(); - hashCode.Add(Offset); + hashCode.Add(OffsetString); hashCode.Add(SequenceNumber); hashCode.Add(EnqueuedTime); hashCode.Add(IsInclusive); @@ -188,9 +220,9 @@ public override int GetHashCode() public override string ToString() => this switch { - _ when (Offset == StartOfStream) => nameof(Earliest), - _ when (Offset == EndOfStream) => nameof(Latest), - _ when (!string.IsNullOrEmpty(Offset)) => $"Offset: [{ Offset }] | Inclusive: [{ IsInclusive }]", + _ when (OffsetString == StartOfStream) => nameof(Earliest), + _ when (OffsetString == EndOfStream) => nameof(Latest), + _ when (!string.IsNullOrEmpty(OffsetString)) => $"Offset: [{ OffsetString }] | Inclusive: [{ IsInclusive }]", _ when (!string.IsNullOrEmpty(SequenceNumber)) => $"Sequence Number: [{ SequenceNumber }] | Inclusive: [{ IsInclusive }]", _ when (EnqueuedTime.HasValue) => $"Enqueued: [{ EnqueuedTime }]", _ => base.ToString() diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/LastEnqueuedEventProperties.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/LastEnqueuedEventProperties.cs index 8736b79f1761..3cd80c40f403 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/LastEnqueuedEventProperties.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Consumer/LastEnqueuedEventProperties.cs @@ -3,7 +3,9 @@ using System; using System.ComponentModel; +using System.Globalization; using Azure.Core; +using Azure.Messaging.EventHubs.Core; namespace Azure.Messaging.EventHubs.Consumer { @@ -19,11 +21,40 @@ public struct LastEnqueuedEventProperties : IEquatable + /// Obsolete. + /// A numeric representation of the offset of the last observed event to be enqueued in the partition. + /// + /// + /// + /// This value is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetPropertyObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public long? Offset + { + get + { + if (string.IsNullOrEmpty(OffsetString)) + { + return null; + } + + if (long.TryParse(OffsetString, out var value)) + { + return value; + } + + throw new NotSupportedException(Resources.LongOffsetOffsetUnsupported); + } + } + /// /// The offset of the last observed event to be enqueued in the partition. /// /// - public long? Offset { get; } + public string OffsetString { get; } /// /// The date and time, in UTC, that the last observed event was enqueued in the partition. @@ -38,6 +69,35 @@ public struct LastEnqueuedEventProperties : IEquatable + /// Obsolete. + /// + /// Initializes a new instance of the class. + /// + /// + /// The sequence number observed the last event to be enqueued in the partition. + /// The offset of the last event to be enqueued in the partition. + /// The date and time, in UTC, that the last event was enqueued in the partition. + /// The date and time, in UTC, that the information was last received. + /// + /// + /// This constructor is obsolete and should no longer be used. Please use the string-based offset overload instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public LastEnqueuedEventProperties(long? lastSequenceNumber, + long lastOffset, + DateTimeOffset? lastEnqueuedTime, + DateTimeOffset? lastReceivedTime) : this(lastSequenceNumber, + (lastOffset > long.MinValue) ? lastOffset.ToString(CultureInfo.InvariantCulture) : null, + lastEnqueuedTime, + lastReceivedTime) + { + } + + /// + /// Obsolete. + /// /// Initializes a new instance of the class. /// /// @@ -46,13 +106,38 @@ public struct LastEnqueuedEventProperties : IEquatableThe date and time, in UTC, that the last event was enqueued in the partition. /// The date and time, in UTC, that the information was last received. /// + /// + /// This constructor is obsolete and should no longer be used. Please use the string-based offset overload instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public LastEnqueuedEventProperties(long? lastSequenceNumber, long? lastOffset, DateTimeOffset? lastEnqueuedTime, + DateTimeOffset? lastReceivedTime) : this(lastSequenceNumber, + lastOffset?.ToString(CultureInfo.InvariantCulture), + lastEnqueuedTime, + lastReceivedTime) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The sequence number observed the last event to be enqueued in the partition. + /// The offset of the last event to be enqueued in the partition. + /// The date and time, in UTC, that the last event was enqueued in the partition. + /// The date and time, in UTC, that the information was last received. + /// + public LastEnqueuedEventProperties(long? lastSequenceNumber, + string lastOffsetString, + DateTimeOffset? lastEnqueuedTime, DateTimeOffset? lastReceivedTime) { SequenceNumber = lastSequenceNumber; - Offset = lastOffset; + OffsetString = lastOffsetString; EnqueuedTime = lastEnqueuedTime; LastReceivedTime = lastReceivedTime; } @@ -81,7 +166,7 @@ internal LastEnqueuedEventProperties(EventData sourceEvent) : /// public bool Equals(LastEnqueuedEventProperties other) { - return (Offset == other.Offset) + return (OffsetString == other.OffsetString) && (SequenceNumber == other.SequenceNumber) && (EnqueuedTime == other.EnqueuedTime) && (LastReceivedTime == other.LastReceivedTime); @@ -113,7 +198,7 @@ public override bool Equals(object obj) => public override int GetHashCode() { var hashCode = new HashCodeBuilder(); - hashCode.Add(Offset); + hashCode.Add(OffsetString); hashCode.Add(SequenceNumber); hashCode.Add(EnqueuedTime); hashCode.Add(LastReceivedTime); @@ -128,7 +213,7 @@ public override int GetHashCode() /// A that represents this instance. /// [EditorBrowsable(EditorBrowsableState.Never)] - public override string ToString() => $"Sequence: [{ SequenceNumber }] | Offset: [{ Offset }] | Enqueued: [{ EnqueuedTime }] | Last Received: [{ LastReceivedTime }]"; + public override string ToString() => $"Sequence: [{ SequenceNumber }] | Offset: [{ OffsetString }] | Enqueued: [{ EnqueuedTime }] | Last Received: [{ LastReceivedTime }]"; /// /// Determines whether the specified instances are equal to each other. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs index 69bf941fca6c..1c2509f5ae57 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Globalization; using System.IO; using System.Text; using Azure.Core; @@ -11,6 +12,7 @@ using Azure.Core.Serialization; using Azure.Messaging.EventHubs.Amqp; using Azure.Messaging.EventHubs.Consumer; +using Azure.Messaging.EventHubs.Core; using Azure.Messaging.EventHubs.Producer; namespace Azure.Messaging.EventHubs @@ -283,16 +285,45 @@ public string CorrelationId /// public long SequenceNumber => _amqpMessage.GetSequenceNumber(long.MinValue); + /// + /// Obsolete. + /// A numeric representation of the offset of an event when it was received from the associated Event Hub partition. + /// + /// + /// + /// This value is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetPropertyObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public long Offset + { + get + { + if (string.IsNullOrEmpty(OffsetString)) + { + return long.MinValue; + } + + if (long.TryParse(OffsetString, out var value)) + { + return value; + } + + throw new NotSupportedException(Resources.LongOffsetOffsetUnsupported); + } + } + /// /// The offset of the event when it was received from the associated Event Hub partition. /// /// /// /// This value is read-only and will only be populated for events that have been read from Event Hubs. The default value - /// when not populated is . + /// when not populated is null. /// /// - public long Offset => _amqpMessage.GetOffset(long.MinValue); + public string OffsetString => _amqpMessage.GetOffset(null); /// /// The date and time, in UTC, of when the event was enqueued in the Event Hub partition. @@ -383,7 +414,7 @@ public string CorrelationId /// populated is null. /// /// - internal long? LastPartitionOffset => _amqpMessage.GetLastPartitionOffset(); + internal string LastPartitionOffset => _amqpMessage.GetLastPartitionOffset(); /// /// The date and time, in UTC, that the last event was enqueued into the Event Hub partition from @@ -553,11 +584,11 @@ internal EventData(BinaryData eventBody, IDictionary properties = null, IReadOnlyDictionary systemProperties = null, long? sequenceNumber = null, - long? offset = null, + string offset = null, DateTimeOffset? enqueuedTime = null, string partitionKey = null, long? lastPartitionSequenceNumber = null, - long? lastPartitionOffset = null, + string lastPartitionOffset = null, DateTimeOffset? lastPartitionEnqueuedTime = null, DateTimeOffset? lastPartitionPropertiesRetrievalTime = null, int? publishedSequenceNumber = null, @@ -603,19 +634,54 @@ internal EventData(BinaryData eventBody, /// The set of free-form event properties to send with the event. /// The set of system properties received from the Event Hubs service. /// The sequence number assigned to the event when it was enqueued in the associated Event Hub partition. + /// The offset of the event when it was received from the associated Event Hub partition. + /// The date and time, in UTC, of when the event was enqueued in the Event Hub partition. + /// The partition hashing key associated with the event when it was published. + /// + /// + /// This constructor exists only for backwards compatibility and has been replaced by . + /// It should no longer be called. + /// + /// This overload was previously intended for mocking in support of testing efforts. It is recommended that + /// it not be used in production scenarios, as it allows setting of data that is broker-owned and is only + /// meaningful on events that have been read from the Event Hubs service.SSS + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected EventData(BinaryData eventBody, + IDictionary properties = null, + IReadOnlyDictionary systemProperties = null, + long sequenceNumber = long.MinValue, + string offsetString = default, + DateTimeOffset enqueuedTime = default, + string partitionKey = null) : this(eventBody, properties, systemProperties, sequenceNumber, offsetString, enqueuedTime, partitionKey, lastPartitionSequenceNumber: null) + { + } + + /// + /// Obsolete. + /// + /// Initializes a new instance of the class. + /// + /// + /// The raw data to use as the body of the event. + /// The set of free-form event properties to send with the event. + /// The set of system properties received from the Event Hubs service. + /// The sequence number assigned to the event when it was enqueued in the associated Event Hub partition. /// The offset of the event when it was received from the associated Event Hub partition. /// The date and time, in UTC, of when the event was enqueued in the Event Hub partition. /// The partition hashing key associated with the event when it was published. /// /// - /// This constructor has been superseded by the factory method. - /// It is strongly recommended that the model factory be preferred over use of this constructor. + /// This constructor is obsolete and has been replaced by . + /// It should no longer be called. /// /// This overload was previously intended for mocking in support of testing efforts. It is recommended that /// it not be used in production scenarios, as it allows setting of data that is broker-owned and is only - /// meaningful on events that have been read from the Event Hubs service. + /// meaningful on events that have been read from the Event Hubs service.SSS /// /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] [EditorBrowsable(EditorBrowsableState.Never)] protected EventData(BinaryData eventBody, IDictionary properties = null, @@ -623,11 +689,13 @@ protected EventData(BinaryData eventBody, long sequenceNumber = long.MinValue, long offset = long.MinValue, DateTimeOffset enqueuedTime = default, - string partitionKey = null) : this(eventBody, properties, systemProperties, sequenceNumber, offset, enqueuedTime, partitionKey, lastPartitionSequenceNumber: null) + string partitionKey = null) : this(eventBody, properties, systemProperties, sequenceNumber, (offset > long.MinValue) ? offset.ToString(CultureInfo.InvariantCulture) : null, enqueuedTime, partitionKey, lastPartitionSequenceNumber: null) { } /// + /// Obsolete. + /// /// Initializes a new instance of the class. /// /// @@ -640,14 +708,15 @@ protected EventData(BinaryData eventBody, /// The partition hashing key associated with the event when it was published. /// /// - /// This constructor has been superseded by the factory method. - /// It is strongly recommended that the model factory be preferred over use of this constructor. + /// This constructor is obsolete and has been replaced by . + /// It should no longer be called. /// /// This overload was previously intended for mocking in support of testing efforts. It is recommended that /// it not be used in production scenarios, as it allows setting of data that is broker-owned and is only /// meaningful on events that have been read from the Event Hubs service. /// /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete)] [EditorBrowsable(EditorBrowsableState.Never)] protected EventData(ReadOnlyMemory eventBody, IDictionary properties = null, @@ -655,7 +724,7 @@ protected EventData(ReadOnlyMemory eventBody, long sequenceNumber = long.MinValue, long offset = long.MinValue, DateTimeOffset enqueuedTime = default, - string partitionKey = null) : this(new BinaryData(eventBody), properties, systemProperties, sequenceNumber, offset, enqueuedTime, partitionKey, lastPartitionSequenceNumber: null) + string partitionKey = null) : this(new BinaryData(eventBody), properties, systemProperties, sequenceNumber, (offset > long.MinValue) ? offset.ToString(CultureInfo.InvariantCulture) : null, enqueuedTime, partitionKey, lastPartitionSequenceNumber: null) { } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProperties.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProperties.cs index 14a132c29a27..08ff4a205372 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProperties.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProperties.cs @@ -31,6 +31,12 @@ public class EventHubProperties /// public string[] PartitionIds { get; } + /// + /// A flag indicating whether or not the Event Hubs namespace has geo-replication enabled. + /// + /// + public bool IsGeoReplicationEnabled { get; } + /// /// Initializes a new instance of the class. /// @@ -38,14 +44,32 @@ public class EventHubProperties /// The name of the Event Hub. /// The date and time at which the Event Hub was created. /// The set of unique identifiers for each partition. + /// A flag indicating whether or not the Event Hubs namespace has geo-replication enabled. /// protected internal EventHubProperties(string name, DateTimeOffset createdOn, - string[] partitionIds) + string[] partitionIds, + bool isGeoReplicationEnabled) { Name = name; CreatedOn = createdOn; PartitionIds = partitionIds; + IsGeoReplicationEnabled = isGeoReplicationEnabled; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the Event Hub. + /// The date and time at which the Event Hub was created. + /// The set of unique identifiers for each partition. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected EventHubProperties(string name, + DateTimeOffset createdOn, + string[] partitionIds) : this(name, createdOn, partitionIds, false) + { } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubsModelFactory.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubsModelFactory.cs index b4abe69e6b1f..22b79d4ba452 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubsModelFactory.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubsModelFactory.cs @@ -22,20 +22,39 @@ namespace Azure.Messaging.EventHubs public static class EventHubsModelFactory { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The name of the Event Hub. /// The date and time at which the Event Hub was created. /// The set of unique identifiers for each partition. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static EventHubProperties EventHubProperties(string name, DateTimeOffset createdOn, string[] partitionIds) => - new EventHubProperties(name, createdOn, partitionIds); + new EventHubProperties(name, createdOn, partitionIds, false); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the Event Hub. + /// The date and time at which the Event Hub was created. + /// The set of unique identifiers for each partition. + /// A flag indicating whether or not the Event Hubs namespace has geo-replication enabled. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static EventHubProperties EventHubProperties(string name, + DateTimeOffset createdOn, + string[] partitionIds, + bool isGeoReplicationEnabled) => + new EventHubProperties(name, createdOn, partitionIds, isGeoReplicationEnabled); /// - /// Initializes a new instance of the class. + /// Obsolete. + /// + /// Initializes a new instance of the class. /// /// /// The name of the Event Hub that contains the partitions. @@ -46,6 +65,12 @@ public static EventHubProperties EventHubProperties(string name, /// The offset of the last event to be enqueued in the partition. /// The date and time, in UTC, that the last event was enqueued in the partition. /// + /// + /// This method is obsolete and should no longer be used. Please use the overload with a string-based offset instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public static PartitionProperties PartitionProperties(string eventHubName, string partitionId, bool isEmpty, @@ -53,10 +78,31 @@ public static PartitionProperties PartitionProperties(string eventHubName, long lastSequenceNumber, long lastOffset, DateTimeOffset lastEnqueuedTime) => - new PartitionProperties(eventHubName, partitionId, isEmpty, beginningSequenceNumber, lastSequenceNumber, lastOffset, lastEnqueuedTime); + new PartitionProperties(eventHubName, partitionId, isEmpty, beginningSequenceNumber, lastSequenceNumber, (lastOffset > long.MinValue) ? lastOffset.ToString(CultureInfo.InvariantCulture) : null, lastEnqueuedTime); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. + /// + /// + /// The name of the Event Hub that contains the partitions. + /// The identifier of the partition. + /// Indicates whether or not the partition is currently empty. + /// The first sequence number available for events in the partition. + /// The sequence number observed the last event to be enqueued in the partition. + /// The offset of the last event to be enqueued in the partition. + /// The date and time, in UTC, that the last event was enqueued in the partition. + /// + public static PartitionProperties PartitionProperties(string eventHubName, + string partitionId, + bool isEmpty, + long beginningSequenceNumber, + long lastSequenceNumber, + string lastOffsetString, + DateTimeOffset lastEnqueuedTime) => + new PartitionProperties(eventHubName, partitionId, isEmpty, beginningSequenceNumber, lastSequenceNumber, lastOffsetString, lastEnqueuedTime); + + /// + /// Initializes a new instance of the class. /// /// /// Indicates whether idempotent publishing is enabled. @@ -71,8 +117,8 @@ public static PartitionPublishingProperties PartitionPublishingProperties(bool i int? lastPublishedSequenceNumber) => new PartitionPublishingProperties(isIdempotentPublishingEnabled, producerGroupId, ownerLevel, lastPublishedSequenceNumber); - /// - /// Initializes a new instance of the class. + /// + /// Initializes a new instance of the class. /// /// /// The sequence number observed the last event to be enqueued in the partition. @@ -80,11 +126,28 @@ public static PartitionPublishingProperties PartitionPublishingProperties(bool i /// The date and time, in UTC, that the last event was enqueued in the partition. /// The date and time, in UTC, that the information was last received. /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public static LastEnqueuedEventProperties LastEnqueuedEventProperties(long? lastSequenceNumber, long? lastOffset, DateTimeOffset? lastEnqueuedTime, DateTimeOffset? lastReceivedTime) => - new LastEnqueuedEventProperties(lastSequenceNumber, lastOffset, lastEnqueuedTime, lastReceivedTime); + new LastEnqueuedEventProperties(lastSequenceNumber, lastOffset?.ToString(CultureInfo.InvariantCulture), lastEnqueuedTime, lastReceivedTime); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The sequence number observed the last event to be enqueued in the partition. + /// The offset of the last event to be enqueued in the partition. + /// The date and time, in UTC, that the last event was enqueued in the partition. + /// The date and time, in UTC, that the information was last received. + /// + public static LastEnqueuedEventProperties LastEnqueuedEventProperties(long? lastSequenceNumber, + string lastOffsetString, + DateTimeOffset? lastEnqueuedTime, + DateTimeOffset? lastReceivedTime) => + new LastEnqueuedEventProperties(lastSequenceNumber, lastOffsetString, lastEnqueuedTime, lastReceivedTime); /// /// Initializes a new instance of the class. @@ -116,7 +179,9 @@ public static PartitionContext PartitionContext(string partitionId, new FactoryPartitionContext("<< NULL >>", "<< NULL >>", "<< NULL >>", partitionId, lastEnqueuedEventProperties); /// - /// Initializes a new instance of the class. + /// Obsolete. + /// + /// Initializes a new instance of the class. /// /// /// The data to use as the body of the event. @@ -127,6 +192,12 @@ public static PartitionContext PartitionContext(string partitionId, /// The offset of the event when it was received from the associated Event Hub partition. /// The date and time, in UTC, of when the event was enqueued in the Event Hub partition. /// + /// + /// This method is obsolete and should no longer be used. Please use the overload with a string-based offset instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public static EventData EventData(BinaryData eventBody, IDictionary properties = null, IReadOnlyDictionary systemProperties = null, @@ -134,7 +205,28 @@ public static EventData EventData(BinaryData eventBody, long sequenceNumber = long.MinValue, long offset = long.MinValue, DateTimeOffset enqueuedTime = default) => - new EventData(eventBody, properties, systemProperties, sequenceNumber, offset, enqueuedTime, partitionKey); + EventData(eventBody, properties, systemProperties, partitionKey, sequenceNumber, (offset > long.MinValue) ? offset.ToString(CultureInfo.InvariantCulture) : null, enqueuedTime); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The data to use as the body of the event. + /// The set of free-form event properties to send with the event. + /// The set of system properties that accompany events read from the Event Hubs service. + /// The partition hashing key associated with the event when it was published. + /// The sequence number assigned to the event when it was enqueued in the associated Event Hub partition. + /// The offset of the event when it was received from the associated Event Hub partition. + /// The date and time, in UTC, of when the event was enqueued in the Event Hub partition. + /// + public static EventData EventData(BinaryData eventBody, + IDictionary properties = null, + IReadOnlyDictionary systemProperties = null, + string partitionKey = null, + long sequenceNumber = long.MinValue, + string offsetString = default, + DateTimeOffset enqueuedTime = default) => + new EventData(eventBody, properties, systemProperties, sequenceNumber, offsetString, enqueuedTime, partitionKey); /// /// Initializes a new instance of the class. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/PartitionProperties.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/PartitionProperties.cs index 122cd4d023dd..6643be32592a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/PartitionProperties.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/PartitionProperties.cs @@ -3,6 +3,8 @@ using System; using System.ComponentModel; +using System.Globalization; +using Azure.Messaging.EventHubs.Core; namespace Azure.Messaging.EventHubs { @@ -41,7 +43,26 @@ public class PartitionProperties /// The offset of the last observed event to be enqueued in the partition. /// /// - public long LastEnqueuedOffset { get; } + [Obsolete(AttributeMessageText.LongLastEnqueuedOffsetOffsetObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public long LastEnqueuedOffset + { + get + { + if (long.TryParse(LastEnqueuedOffsetString, out var value)) + { + return value; + } + + throw new NotSupportedException(Resources.LongLastEnqueuedOffsetOffsetUnsupported); + } + } + + /// + /// The offset of the last observed event to be enqueued in the partition. + /// + /// + public string LastEnqueuedOffsetString { get; } /// /// The date and time, in UTC, that the last observed event was enqueued in the partition. @@ -58,6 +79,8 @@ public class PartitionProperties public bool IsEmpty { get; } /// + /// Obsolete. + /// /// Initializes a new instance of the class. /// /// @@ -69,19 +92,53 @@ public class PartitionProperties /// The offset of the last event to be enqueued in the partition. /// The date and time, in UTC, that the last event was enqueued in the partition. /// + /// + /// This constructor is obsolete and should no longer be used. Please use the string-based offset overload instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetParameterObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] protected internal PartitionProperties(string eventHubName, string partitionId, bool isEmpty, long beginningSequenceNumber, long lastSequenceNumber, long lastOffset, + DateTimeOffset lastEnqueuedTime) : this(eventHubName, + partitionId, + isEmpty, + beginningSequenceNumber, + lastSequenceNumber, + (lastOffset > long.MinValue) ? lastOffset.ToString(CultureInfo.InvariantCulture) : null, + lastEnqueuedTime) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the Event Hub that contains the partitions. + /// The identifier of the partition. + /// Indicates whether or not the partition is currently empty. + /// The first sequence number available for events in the partition. + /// The sequence number observed the last event to be enqueued in the partition. + /// The offset of the last event to be enqueued in the partition. + /// The date and time, in UTC, that the last event was enqueued in the partition. + /// + protected internal PartitionProperties(string eventHubName, + string partitionId, + bool isEmpty, + long beginningSequenceNumber, + long lastSequenceNumber, + string lastOffsetString, DateTimeOffset lastEnqueuedTime) { EventHubName = eventHubName; Id = partitionId; BeginningSequenceNumber = beginningSequenceNumber; LastEnqueuedSequenceNumber = lastSequenceNumber; - LastEnqueuedOffset = lastOffset; + LastEnqueuedOffsetString = lastOffsetString; LastEnqueuedTime = lastEnqueuedTime; IsEmpty = isEmpty; } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/CheckpointStore.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/CheckpointStore.cs index bdfb33b061e6..aba12ce74d8e 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/CheckpointStore.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/CheckpointStore.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure.Messaging.EventHubs.Core; using Azure.Messaging.EventHubs.Processor; namespace Azure.Messaging.EventHubs.Primitives @@ -70,6 +70,8 @@ public abstract Task GetCheckpointAsync(string fullyQu CancellationToken cancellationToken); /// + /// Obsolete. + /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream /// that an event processor should begin reading from. /// @@ -82,6 +84,12 @@ public abstract Task GetCheckpointAsync(string fullyQu /// The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream. /// A instance to signal a request to cancel the operation. /// + /// + /// This method is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetUpdateCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Task UpdateCheckpointAsync(string fullyQualifiedNamespace, string eventHubName, string consumerGroup, diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs index 80cfd4a2d43b..d0d2e8650bd1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/EventProcessor.cs @@ -206,6 +206,12 @@ internal EventProcessorStatus Status /// protected EventHubsRetryPolicy RetryPolicy { get; } + /// + /// The properties associated with the Event Hub being read from. This value is updated in each load balancing cycle. + /// + /// + protected EventHubProperties EventHubProperties { get; private set; } + /// /// Indicates whether or not this event processor should instrument batch event processing calls with distributed tracing. /// Implementations that instrument event processing themselves should set this to false. @@ -829,9 +835,9 @@ async Task performProcessing() lastEvent = (eventBatch != null && eventBatch.Count > 0) ? eventBatch[eventBatch.Count - 1] : null; - if ((lastEvent != null) && (lastEvent.Offset != long.MinValue)) + if (!string.IsNullOrEmpty(lastEvent?.OffsetString)) { - startingPosition = EventPosition.FromOffset(lastEvent.Offset, false); + startingPosition = EventPosition.FromOffset(lastEvent.OffsetString, false); } // If event batches are successfully processed, then the need for forward progress is @@ -1088,6 +1094,8 @@ protected virtual async Task GetCheckpointAsync(string } /// + /// Obsolete. + /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream /// that an event processor should begin reading from. /// @@ -1098,22 +1106,17 @@ protected virtual async Task GetCheckpointAsync(string /// A instance to signal a request to cancel the operation. /// /// - /// This overload exists to preserve backwards compatibility; it is highly recommended that - /// be called instead. + /// This method is obsolete and should no longer be used. Please use + /// instead. /// /// + [Obsolete(AttributeMessageText.LongOffsetUpdateCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] protected virtual Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, - CancellationToken cancellationToken) - { - if (sequenceNumber.HasValue) - { - return UpdateCheckpointAsync(partitionId, new CheckpointPosition(sequenceNumber.Value), cancellationToken); - } - - throw new NotImplementedException(); - } + CancellationToken cancellationToken) => + UpdateCheckpointAsync(partitionId, new CheckpointPosition((offset != long.MinValue) ? offset.ToString(CultureInfo.InvariantCulture) : null, sequenceNumber.Value), cancellationToken); /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream @@ -1309,9 +1312,11 @@ protected virtual LastEnqueuedEventProperties ReadLastEnqueuedEventProperties(st /// /// The set of identifiers for the Event Hub partitions. /// - protected virtual async Task ListPartitionIdsAsync(EventHubConnection connection, - CancellationToken cancellationToken) => - await connection.GetPartitionIdsAsync(RetryPolicy, cancellationToken).ConfigureAwait(false); + protected virtual Task ListPartitionIdsAsync(EventHubConnection connection, + CancellationToken cancellationToken) + { + return Task.FromResult(EventHubProperties.PartitionIds); + } /// /// Allows reporting that a partition was stolen by another event consumer causing ownership @@ -1648,6 +1653,7 @@ private async Task RunProcessingAsync(CancellationToken cancellationToken) try { + EventHubProperties = await connection.GetPropertiesAsync(RetryPolicy, cancellationToken).ConfigureAwait(false); partitionIds = await ListPartitionIdsAsync(connection, cancellationToken).ConfigureAwait(false); } catch (Exception ex) when (ex.IsNotType()) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/PluggableCheckpointStoreEventProcessor.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/PluggableCheckpointStoreEventProcessor.cs index a99f56b4d82c..571289924cf3 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/PluggableCheckpointStoreEventProcessor.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Primitives/PluggableCheckpointStoreEventProcessor.cs @@ -220,6 +220,8 @@ protected override Task GetCheckpointAsync(string part _checkpointStore.GetCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, partitionId, cancellationToken); /// + /// Obsolete. + /// /// Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream /// that an event processor should begin reading from. /// @@ -229,6 +231,13 @@ protected override Task GetCheckpointAsync(string part /// The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream. /// A instance to signal a request to cancel the operation. /// + /// + /// This method is obsolete and should no longer be used. Please use + /// instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetUpdateCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] protected override Task UpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs index 43dbfe0b4a27..1db828bc6b07 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Processor/CheckpointPosition.cs @@ -4,8 +4,10 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Globalization; using System.Text; using Azure.Core; +using Azure.Messaging.EventHubs.Core; namespace Azure.Messaging.EventHubs.Processor { @@ -16,33 +18,107 @@ namespace Azure.Messaging.EventHubs.Processor public struct CheckpointPosition : IEquatable { /// - /// The sequence number to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream. + /// The sequence number to associate with the checkpoint. The sequence number is intended to be informational, and will only be used for + /// positioning if no is set. /// /// public long SequenceNumber { get; } + /// + /// Obsolete. + /// A numeric representation of the offset to associate with the checkpoint. This indicates that a processor + /// should begin reading from the next event in the stream. + /// + /// + /// + /// This value is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetOffsetPropertyObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public long Offset + { + get + { + if (long.TryParse(OffsetString, out var value)) + { + return value; + } + + throw new NotSupportedException(Resources.LongOffsetOffsetUnsupported); + } + } + + /// + /// The offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream. + /// + /// + public string OffsetString { get; } + /// /// Initializes a new instance of the struct. /// /// /// The sequence number to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream. /// + /// + /// This constructor is not compatible when processing a geo-replicated Event Hub. Use or + /// instead. + /// + /// + [Obsolete(AttributeMessageText.SequenceNumberOnlyCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] public CheckpointPosition(long sequenceNumber) { SequenceNumber = sequenceNumber; } /// - /// Initializes a new instance of the from an instance. + /// Obsolete. + /// + /// Initializes a new instance of the struct. /// /// - /// The to use to determine the starting point of a checkpoint, indicating that an event processor should begin reading from the next event in the stream. + /// The offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream. + /// The sequence number to associate with the checkpoint. This is used as informational metadata. /// - public static CheckpointPosition FromEvent(EventData eventData) + /// + /// This constructor is obsolete and should no longer be used. Please use instead. + /// + /// + [Obsolete(AttributeMessageText.LongOffsetCheckpointObsolete, false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public CheckpointPosition(long offset, + long sequenceNumber = long.MinValue) { - return new CheckpointPosition(eventData.SequenceNumber); + SequenceNumber = sequenceNumber; + OffsetString = (offset != long.MinValue) ? offset.ToString(CultureInfo.InvariantCulture) : null; } + /// + /// Initializes a new instance of the struct. + /// + /// The offset to associate with the checkpoint. This indicates that a processor should begin reading from the next event in the stream. + /// The sequence number to associate with the checkpoint. This is used as informational metadata. + /// + public CheckpointPosition(string offsetString, + long sequenceNumber = long.MinValue) + { + Argument.AssertNotNullOrEmpty(offsetString, nameof(offsetString)); + + SequenceNumber = sequenceNumber; + OffsetString = offsetString; + } + + /// + /// Initializes a new instance of the from an instance. + /// + /// + /// The to use to determine the starting point of a checkpoint, indicating that an event processor should begin reading from the next event in the stream. + /// + public static CheckpointPosition FromEvent(EventData eventData) => + new CheckpointPosition(eventData.OffsetString, eventData.SequenceNumber); + /// /// Determines whether the specified is equal to this instance. /// @@ -53,7 +129,8 @@ public static CheckpointPosition FromEvent(EventData eventData) /// public bool Equals(CheckpointPosition other) { - return (SequenceNumber == other.SequenceNumber); + return ((SequenceNumber == other.SequenceNumber) + && (OffsetString == other.OffsetString)); } /// @@ -83,6 +160,7 @@ public override int GetHashCode() { var hashCode = new HashCodeBuilder(); hashCode.Add(SequenceNumber); + hashCode.Add(OffsetString); return hashCode.ToHashCode(); } @@ -95,7 +173,7 @@ public override int GetHashCode() /// public override string ToString() { - return $"Sequence Number: [{SequenceNumber}]"; + return $"Offset: [{OffsetString}] Sequence Number: [{SequenceNumber}]"; } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md b/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md index 4250d095ed49..cef1fef14217 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md +++ b/sdk/eventhub/Azure.Messaging.EventHubs/stress/README.md @@ -21,7 +21,7 @@ Or, you can run all tests with the "--all" flag. ### Prerequisites -When tests are run locally, Azure resources need to be created prior to running the test. This can be done through the Azure CLI, an ARM pr bicep file, or the Azure Portal. The bicep file included in this directory can be used to [deploy all resources](https://docs.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-resource-group?tabs=azure-cli) aside from the application insights portal. +When tests are run locally, Azure resources need to be created prior to running the test. This can be done through the Azure CLI, an ARM pr bicep file, or the Azure Portal. The bicep file included in this directory can be used to [deploy all resources](https://learn.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-resource-group?tabs=azure-cli) aside from the application insights portal. To run the compiled .dll file, navigate to the `/artifacts/bin/Azure.Messaging.EventHubs.Stress/Release/net6.0` directory. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpAnnotatedMessageExtensionsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpAnnotatedMessageExtensionsTests.cs index 9c64cadd26b8..8dc0d83bd445 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpAnnotatedMessageExtensionsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpAnnotatedMessageExtensionsTests.cs @@ -295,11 +295,11 @@ public void GetEventBodyDoesNotAllowNonDataBodyTypes(AmqpMessageBodyType bodyTyp public void SystemPropertiesCanBeRead() { var sequenceNumber = 123L; - var offset = 456L; + var offset = "456L"; var enqueueTime = new DateTimeOffset(2015, 10, 27, 00, 00, 00, TimeSpan.Zero); var partitionKey = "fake-key"; var lastSequence = 321L; - var lastOffset = 654L; + var lastOffset = "654L"; var lastEnqueue = new DateTimeOffset(2012, 03, 04, 08, 00, 00, TimeSpan.Zero); var lastRetrieve = new DateTimeOffset(2020, 01, 01, 05, 15, 37, TimeSpan.Zero); var message = CreateDataBodyMessageWithSystemProperties(sequenceNumber, lastSequence, offset, lastOffset, partitionKey, enqueueTime, lastEnqueue, lastRetrieve); @@ -330,11 +330,11 @@ public void MessageIsPopulatedFromEventHubProperties() }; var sequenceNumber = 123L; - var offset = 456L; + var offset = "456L"; var enqueueTime = new DateTimeOffset(2015, 10, 27, 00, 00, 00, TimeSpan.Zero); var partitionKey = "fake-key"; var lastSequence = 321L; - var lastOffset = 654L; + var lastOffset = "654L"; var lastEnqueue = new DateTimeOffset(2012, 03, 04, 08, 00, 00, TimeSpan.Zero); var lastRetrieve = new DateTimeOffset(2020, 01, 01, 05, 15, 37, TimeSpan.Zero); @@ -361,11 +361,11 @@ public void MessageIsPopulatedFromEventHubProperties() public void SystemPropertiesReturnCustomDefaultValuesWhenNotInTheMessage() { var sequenceNumber = 123L; - var offset = 456L; + var offset = "456L"; var enqueueTime = new DateTimeOffset(2015, 10, 27, 00, 00, 00, TimeSpan.Zero); var partitionKey = "fake-key"; var lastSequence = 321L; - var lastOffset = 654L; + var lastOffset = "654L"; var lastEnqueue = new DateTimeOffset(2012, 03, 04, 08, 00, 00, TimeSpan.Zero); var lastRetrieve = new DateTimeOffset(2020, 01, 01, 05, 15, 37, TimeSpan.Zero); var message = CreateDataBodyMessageWithSystemProperties(default, default, default, default, default, default, default, default); @@ -391,7 +391,7 @@ public void SystemPropertiesReturnExpectedDefaultValuesWhenNotInTheMessageAndNoC var message = CreateDataBodyMessageWithSystemProperties(default, default, default, default, default, default, default, default); Assert.That(message.GetSequenceNumber(), Is.EqualTo(long.MinValue), "The sequence number should match."); - Assert.That(message.GetOffset(), Is.EqualTo(long.MinValue), "The offset should match."); + Assert.That(message.GetOffset(), Is.EqualTo(null), "The offset should match."); Assert.That(message.GetEnqueuedTime(), Is.EqualTo(default(DateTimeOffset)), "The enqueue time should match."); Assert.That(message.GetPartitionKey(), Is.EqualTo(null), "The partition key should match."); Assert.That(message.GetLastPartitionSequenceNumber(), Is.EqualTo(null), "The last sequence number should match."); @@ -510,8 +510,8 @@ private static AmqpAnnotatedMessage CreateFullyPopulatedDataBodyMessage() /// private static AmqpAnnotatedMessage CreateDataBodyMessageWithSystemProperties(long? sequenceNumber, long? lastSequenceNumber, - long? offset, - long? lastOffset, + string offset, + string lastOffset, string partitionKey, DateTimeOffset? enqueueTime, DateTimeOffset? lastEnqueueTime, @@ -526,9 +526,9 @@ private static AmqpAnnotatedMessage CreateDataBodyMessageWithSystemProperties(lo message.MessageAnnotations.Add(AmqpProperty.SequenceNumber.ToString(), sequenceNumber.Value); } - if (offset.HasValue) + if (!string.IsNullOrEmpty(offset)) { - message.MessageAnnotations.Add(AmqpProperty.Offset.ToString(), offset.Value); + message.MessageAnnotations.Add(AmqpProperty.Offset.ToString(), offset); } if (enqueueTime.HasValue) @@ -550,9 +550,9 @@ private static AmqpAnnotatedMessage CreateDataBodyMessageWithSystemProperties(lo message.DeliveryAnnotations.Add(AmqpProperty.PartitionLastEnqueuedSequenceNumber.ToString(), lastSequenceNumber.Value); } - if (lastOffset.HasValue) + if (!string.IsNullOrEmpty(lastOffset)) { - message.DeliveryAnnotations.Add(AmqpProperty.PartitionLastEnqueuedOffset.ToString(), lastOffset.Value); + message.DeliveryAnnotations.Add(AmqpProperty.PartitionLastEnqueuedOffset.ToString(), lastOffset); } if (lastEnqueueTime.HasValue) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs index 7dcc2d355987..b2c90be18137 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs @@ -778,7 +778,7 @@ public async Task OpenConsumerLinkAsyncRespectsTheTrackLastEventOption() var link = await mockScope.Object.OpenConsumerLinkAsync(consumerGroup, partitionId, position, TimeSpan.FromDays(1), TimeSpan.FromDays(1), prefetchCount, prefetchSizeInBytes, ownerLevel, trackLastEvent, identifier, cancellationSource.Token); Assert.That(link, Is.Not.Null, "The link produced was null"); - Assert.That(link.Settings.DesiredCapabilities, Is.Null, "There should have not have been a set of desired capabilities created, as we're not tracking the last event."); + Assert.That(link.Settings.DesiredCapabilities.Contains(AmqpProperty.GeoReplication), Is.True, "Geo replication should always be requested."); } /// @@ -1292,6 +1292,7 @@ public async Task OpenProducerLinkAsyncConfiguresTheLink() Assert.That(link.Settings.Properties.Any(item => item.Key.Key.ToString() == AmqpProperty.EntityType.ToString()), Is.True, "There should be an entity type specified."); Assert.That(link.Settings.Properties[AmqpProperty.ProducerGroupId], Is.EqualTo(options.ProducerGroupId), "The producer group should have been set."); Assert.That(link.Settings.Properties[AmqpProperty.ProducerOwnerLevel], Is.EqualTo(options.OwnerLevel), "The owner level should have been set."); + Assert.That(link.Settings.DesiredCapabilities.Contains(AmqpProperty.GeoReplication), Is.True, "Geo replication should always be requested."); Assert.That(link.Settings.Properties[AmqpProperty.ProducerSequenceNumber], Is.EqualTo(options.StartingSequenceNumber), "The published sequence number should have been set."); } @@ -1435,6 +1436,7 @@ public async Task OpenProducerLinkAsyncConfiguresTheLinkWhenOptionsAreEmpty(obje var linkTarget = (Target)link.Settings.Target; Assert.That(linkTarget.Address.ToString(), Contains.Substring($"/{ partitionId }"), "The partition identifier should have been part of the link address."); Assert.That(link.Settings.DesiredCapabilities.Contains(AmqpProperty.EnableIdempotentPublishing), Is.True, "The idempotent publishing capability should have been set."); + Assert.That(link.Settings.DesiredCapabilities.Contains(AmqpProperty.GeoReplication), Is.True, "Geo replication should always be requested."); Assert.That(link.Settings.Properties.Any(item => item.Key.Key.ToString() == AmqpProperty.EntityType.ToString()), Is.True, "There should be an entity type specified."); Assert.That(link.Settings.Properties.Any(item => item.Key.Key.ToString() == AmqpProperty.ProducerGroupId.ToString()), Is.True, "The producer group should have been set."); Assert.That(link.Settings.Properties.Any(item => item.Key.Key.ToString() == AmqpProperty.ProducerOwnerLevel.ToString()), Is.True, "The owner level should have been set."); @@ -1513,7 +1515,7 @@ public async Task OpenProducerLinkAsyncConfiguresTheLinkWhenNoFeaturesAreActive( var linkTarget = (Target)link.Settings.Target; Assert.That(linkTarget.Address.ToString(), Contains.Substring($"/{ partitionId }"), "The partition identifier should have been part of the link address."); - Assert.That(link.Settings.DesiredCapabilities, Is.Null, "The idempotent publishing capability should not have been set."); + Assert.That(link.Settings.DesiredCapabilities.Contains(AmqpProperty.GeoReplication), Is.True, "Geo replication should always be requested."); Assert.That(link.Settings.Properties.Any(item => item.Key.Key.ToString() == AmqpProperty.EntityType.ToString()), Is.True, "There should be an entity type specified."); Assert.That(link.Settings.Properties[AmqpProperty.ProducerGroupId], Is.EqualTo(options.ProducerGroupId), "The producer group should have been set."); Assert.That(link.Settings.Properties[AmqpProperty.ProducerOwnerLevel], Is.EqualTo(options.OwnerLevel), "The owner level should have been set."); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConsumerTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConsumerTests.cs index c32237bdfdcb..8128f95cbe33 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConsumerTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConsumerTests.cs @@ -162,7 +162,7 @@ public void ReceiveAsyncValidatesTheMaximumMessageCount(int count) var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var retryPolicy = new BasicRetryPolicy(new EventHubsRetryOptions()); var retriableException = new EventHubsException(true, "Test"); var mockConverter = new Mock(); @@ -187,7 +187,7 @@ public void ReceiveAsyncRespectsTheCancellationTokenIfSetWhenCalled() var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var retryPolicy = new BasicRetryPolicy(new EventHubsRetryOptions()); var retriableException = new EventHubsException(true, "Test"); var mockConverter = new Mock(); @@ -215,7 +215,7 @@ public void ReceiveAsyncAppliesTheRetryPolicy(EventHubsRetryOptions retryOptions var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var trackLastEnqueued = false; var invalidateOnSteal = true; var ownerLevel = 123L; @@ -279,7 +279,7 @@ public void ReceiveAsyncConsidersOperationCanceledExceptionAsRetriable(EventHubs var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var trackLastEnqueued = false; var invalidateOnSteal = true; var ownerLevel = 123L; @@ -344,7 +344,7 @@ public void ReceiveAsyncAppliesTheRetryPolicyForAmqpErrors(EventHubsRetryOptions var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var trackLastEnqueued = false; var invalidateOnSteal = true; var ownerLevel = 123L; @@ -407,7 +407,7 @@ public void ReceiveAsyncDetectsAnEmbeddedErrorForOperationCanceled() var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var trackLastEnqueued = false; var invalidateOnSteal = true; var ownerLevel = 123L; @@ -470,7 +470,7 @@ public void ReceiveAsyncDetectsAnEmbeddedAmqpErrorForOperationCanceled() var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var trackLastEnqueued = false; var invalidateOnSteal = true; var ownerLevel = 123L; @@ -533,7 +533,7 @@ public async Task ReceiveAsyncValidatesClosed() var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var options = new EventHubConsumerClientOptions(); var retryPolicy = new BasicRetryPolicy(new EventHubsRetryOptions()); var retriableException = new EventHubsException(true, "Test"); @@ -562,7 +562,7 @@ public void ReceiveAsyncValidatesConnectionClosed() var consumerGroup = "$DEFAULT"; var partition = "3"; var identifier = "cusTOM-1D"; - var eventPosition = EventPosition.FromOffset(123); + var eventPosition = EventPosition.FromOffset("123"); var options = new EventHubConsumerClientOptions(); var retryPolicy = new BasicRetryPolicy(new EventHubsRetryOptions()); var mockCredential = new EventHubTokenCredential(Mock.Of()); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpFilterTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpFilterTests.cs index 1d7223e9aaf2..91f5147d7627 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpFilterTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpFilterTests.cs @@ -26,8 +26,8 @@ public void BuildFilterExpressionEnsuresAnEventPositionIsFilterable() { // Unset all properties for the event position. - var position = EventPosition.FromOffset(1); - position.Offset = null; + var position = EventPosition.FromOffset("1"); + position.OffsetString = null; Assert.That(() => AmqpFilter.BuildFilterExpression(position), Throws.ArgumentException); } @@ -42,7 +42,7 @@ public void BuildFilterExpressionPrefersOffset() { // Set all properties for the event position. - var offset = 1; + var offset = "1"; var position = EventPosition.FromOffset(offset); position.SequenceNumber = "222"; position.EnqueuedTime = DateTimeOffset.Parse("2015-10-27T12:00:00Z"); @@ -122,7 +122,7 @@ public void BuildFilterExpressionAllowsLatest() public void BuildFilterExpressionHonorsInclusiveFlagForOffset(bool inclusive) { var comparison = (inclusive) ? ">=" : ">"; - var position = EventPosition.FromOffset(1); + var position = EventPosition.FromOffset("1"); position.IsInclusive = inclusive; var filter = AmqpFilter.BuildFilterExpression(position); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs index 6acfccfec21f..4883d4a9b1c7 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Ignore Spelling: Accessor + using System; using System.Collections.Generic; using System.IO; @@ -1214,7 +1216,7 @@ public void CreateEventFromMessageDoesNotIncludeUnknownApplicationPropertyType() [Test] public void CreateEventFromMessagePopulatesTypedSystemProperties() { - var offset = 123; + var offset = "123"; var sequenceNumber = (long.MaxValue - 10); var enqueuedTime = DateTimeOffset.Parse("2015-10-27T12:00:00Z"); var partitionKey = "OMG! partition!"; @@ -1225,7 +1227,7 @@ public void CreateEventFromMessagePopulatesTypedSystemProperties() message.ApplicationProperties.Map.Add("First", 1); message.ApplicationProperties.Map.Add("Second", "2"); - message.MessageAnnotations.Map.Add(AmqpProperty.Offset, offset.ToString()); + message.MessageAnnotations.Map.Add(AmqpProperty.Offset, offset); message.MessageAnnotations.Map.Add(AmqpProperty.SequenceNumber, sequenceNumber); message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, enqueuedTime.Ticks); message.MessageAnnotations.Map.Add(AmqpProperty.PartitionKey, partitionKey); @@ -1236,11 +1238,11 @@ public void CreateEventFromMessagePopulatesTypedSystemProperties() Assert.That(eventData, Is.Not.Null, "The event should have been created."); Assert.That(eventData.EventBody, Is.Not.Null, "The event should have a body."); Assert.That(eventData.Properties.Count, Is.EqualTo(message.ApplicationProperties.Map.Count()), "The event should have a set of properties."); - Assert.That(eventData.Offset, Is.EqualTo(offset), "The offset should match."); + Assert.That(eventData.OffsetString, Is.EqualTo(offset), "The offset should match."); Assert.That(eventData.SequenceNumber, Is.EqualTo(sequenceNumber), "The sequence number should match."); Assert.That(eventData.EnqueuedTime, Is.EqualTo(enqueuedTime), "The enqueue time should match."); Assert.That(eventData.PartitionKey, Is.EqualTo(partitionKey), "The partition key should match."); - Assert.That(eventData.LastPartitionOffset.HasValue, Is.False, "The last offset should not be set."); + Assert.That(eventData.LastPartitionOffset, Is.Null, "The last offset should not be set."); Assert.That(eventData.LastPartitionSequenceNumber.HasValue, Is.False, "The last sequence number should not be set."); Assert.That(eventData.LastPartitionEnqueuedTime.HasValue, Is.False, "The last enqueued time should not be set."); Assert.That(eventData.LastPartitionPropertiesRetrievalTime.HasValue, Is.False, "The last retrieval time should not be set."); @@ -1291,8 +1293,8 @@ public void CreateEventFromMessagePopulatesMappedSystemProperties() [Test] public void CreateEventFromMessagePopulatesTypedSystemPropertiesAndMetrics() { - var offset = 123; - var lastOffset = 987; + string offset = "123"; + var lastOffset = "987"; var sequenceNumber = (long.MaxValue - 10); var lastSequenceNumber = (long.MaxValue - 100); var enqueuedTime = DateTimeOffset.Parse("2015-10-27T12:00:00Z"); @@ -1322,7 +1324,7 @@ public void CreateEventFromMessagePopulatesTypedSystemPropertiesAndMetrics() Assert.That(eventData, Is.Not.Null, "The event should have been created."); Assert.That(eventData.EventBody, Is.Not.Null, "The event should have a body."); Assert.That(eventData.Properties.Count, Is.EqualTo(message.ApplicationProperties.Map.Count()), "The event should have a set of properties."); - Assert.That(eventData.Offset, Is.EqualTo(offset), "The offset should match."); + Assert.That(eventData.OffsetString, Is.EqualTo(offset), "The offset should match."); Assert.That(eventData.SequenceNumber, Is.EqualTo(sequenceNumber), "The sequence number should match."); Assert.That(eventData.EnqueuedTime, Is.EqualTo(enqueuedTime), "The enqueue time should match."); Assert.That(eventData.PartitionKey, Is.EqualTo(partitionKey), "The partition key should match."); @@ -1564,17 +1566,17 @@ void validateMap(AmqpMap expected, IDictionary dictionary, strin [Test] public void CreateEventFromMessageAllowsAnEmptyMessageWithProperties() { - var propertyValue = 1; + var propertyValue = "1"; using var message = AmqpMessage.Create(); message.ApplicationProperties.Map.Add("Test", propertyValue); - message.MessageAnnotations.Map.Add(AmqpProperty.Offset, propertyValue.ToString()); + message.MessageAnnotations.Map.Add(AmqpProperty.Offset, propertyValue); var eventData = new AmqpMessageConverter().CreateEventFromMessage(message); Assert.That(eventData, Is.Not.Null, "The event should have been created."); Assert.That(eventData.Properties.Count, Is.EqualTo(message.ApplicationProperties.Map.Count()), "There should have been properties present."); Assert.That(eventData.Properties.First().Value, Is.EqualTo(propertyValue), "The application property should have been populated."); - Assert.That(eventData.Offset, Is.EqualTo(propertyValue), "The offset should have been populated."); + Assert.That(eventData.OffsetString, Is.EqualTo(propertyValue), "The offset should have been populated."); } /// @@ -2046,7 +2048,7 @@ public void CreatePartitionPropertiesFromResponseCreatesTheProperties() var partition = "55"; var beginSequenceNumber = 555L; var lastSequenceNumber = 666L; - var lastOffset = 777L; + var lastOffset = "777L"; var lastEnqueueTime = DateTimeOffset.Parse("2015-10-27T00:00:00z"); var isEmpty = false; var converter = new AmqpMessageConverter(); @@ -2056,7 +2058,7 @@ public void CreatePartitionPropertiesFromResponseCreatesTheProperties() { AmqpManagement.ResponseMap.PartitionIdentifier, partition }, { AmqpManagement.ResponseMap.PartitionBeginSequenceNumber, beginSequenceNumber }, { AmqpManagement.ResponseMap.PartitionLastEnqueuedSequenceNumber, lastSequenceNumber }, - { AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset, lastOffset.ToString() }, + { AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset, lastOffset }, { AmqpManagement.ResponseMap.PartitionLastEnqueuedTimeUtc, lastEnqueueTime.UtcDateTime }, { AmqpManagement.ResponseMap.PartitionRuntimeInfoPartitionIsEmpty, isEmpty } }; @@ -2069,7 +2071,7 @@ public void CreatePartitionPropertiesFromResponseCreatesTheProperties() Assert.That(properties.Id, Is.EqualTo(partition), "The partition should match"); Assert.That(properties.BeginningSequenceNumber, Is.EqualTo(beginSequenceNumber), "The beginning sequence number should match"); Assert.That(properties.LastEnqueuedSequenceNumber, Is.EqualTo(lastSequenceNumber), "The last sequence number should match"); - Assert.That(properties.LastEnqueuedOffset, Is.EqualTo(lastOffset), "The offset should match"); + Assert.That(properties.LastEnqueuedOffsetString, Is.EqualTo(lastOffset), "The offset should match"); Assert.That(properties.LastEnqueuedTime, Is.EqualTo(lastEnqueueTime), "The last enqueued time should match"); Assert.That(properties.IsEmpty, Is.EqualTo(isEmpty), "The empty flag should match"); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs index bd9bb804f922..16f87c1bb537 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionLiveTests.cs @@ -246,7 +246,7 @@ public async Task ConnectionTransportCanRetrievePartitionProperties(EventHubsTra Assert.That(partitionProperties.EventHubName, Is.EqualTo(scope.EventHubName).Using((IEqualityComparer)StringComparer.InvariantCultureIgnoreCase), "The Event Hub path should match."); Assert.That(partitionProperties.BeginningSequenceNumber, Is.Not.EqualTo(default(long)), "The beginning sequence number should have been populated."); Assert.That(partitionProperties.LastEnqueuedSequenceNumber, Is.Not.EqualTo(default(long)), "The last sequence number should have been populated."); - Assert.That(partitionProperties.LastEnqueuedOffset, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); + Assert.That(partitionProperties.LastEnqueuedOffsetString, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionTests.cs index c8560b0aa7e6..c401886436d5 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Connection/EventHubConnectionTests.cs @@ -746,7 +746,7 @@ public async Task GetPartitionIdsAsyncDelegatesToGetProperties() { var date = DateTimeOffset.Parse("2015-10-27T12:00:00Z"); var partitionIds = new[] { "first", "second", "third" }; - var properties = new EventHubProperties("dummy", date, partitionIds); + var properties = new EventHubProperties("dummy", date, partitionIds, false); var mockConnection = new Mock { CallBase = true }; mockConnection @@ -835,7 +835,7 @@ public void CreateConsumerInvokesTheTransportClient() { var transportClient = new ObservableTransportClientMock(); var connection = new InjectableTransportClientMock(transportClient, "Endpoint=sb://not-real.servicebus.windows.net/;SharedAccessKeyName=DummyKey;SharedAccessKey=[not_real];EntityPath=fake"); - var expectedPosition = EventPosition.FromOffset(65); + var expectedPosition = EventPosition.FromOffset("65"); var expectedPartition = "2123"; var expectedIdentifier = "OMG-ID"; var expectedConsumerGroup = EventHubConsumerClient.DefaultConsumerGroupName; @@ -851,7 +851,7 @@ public void CreateConsumerInvokesTheTransportClient() Assert.That(actualPartition, Is.EqualTo(expectedPartition), "The partition should have been passed."); Assert.That(actualConsumerGroup, Is.EqualTo(expectedConsumerGroup), "The consumer group should match."); Assert.That(actualIdentifier, Is.EqualTo(expectedIdentifier), "The identifier should match."); - Assert.That(actualPosition.Offset, Is.EqualTo(expectedPosition.Offset), "The event position to receive should match."); + Assert.That(actualPosition.OffsetString, Is.EqualTo(expectedPosition.OffsetString), "The event position to receive should match."); Assert.That(actualRetry, Is.SameAs(expectedRetryPolicy), "The retryPolicy should match."); Assert.That(actualOwnerLevel, Is.EqualTo(expectedOwnerLevel), "The owner levels should match."); Assert.That(actualPrefetch, Is.EqualTo(expectedPrefetch), "The prefetch counts should match."); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs index b322cbc6777d..b3ed9df576ed 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientLiveTests.cs @@ -856,7 +856,7 @@ public async Task ConsumerCanReadFromOffset(bool isInclusive) // Query the partition and determine the offset of the last enqueued event, then send the new set // of events that should appear after the starting position. - var lastOffset = (await consumer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedOffset; + var lastOffset = (await consumer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedOffsetString; var startingPosition = EventPosition.FromOffset(lastOffset, isInclusive); await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); @@ -876,7 +876,7 @@ public async Task ConsumerCanReadFromOffset(bool isInclusive) Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); Assert.That(readState.Events.Count, Is.EqualTo(expectedCount), "The wrong number of events was read for the value of the inclusive flag."); - Assert.That(readState.Events.Values.Any(readEvent => readEvent.Data.Offset == lastOffset), Is.EqualTo(isInclusive), $"The event with offset [{ lastOffset }] was { ((isInclusive) ? "not" : "") } in the set of read events, which is inconsistent with the inclusive flag."); + Assert.That(readState.Events.Values.Any(readEvent => readEvent.Data.OffsetString == lastOffset), Is.EqualTo(isInclusive), $"The event with offset [{ lastOffset }] was { ((isInclusive) ? "not" : "") } in the set of read events, which is inconsistent with the inclusive flag."); foreach (var sourceEvent in sourceEvents) { @@ -2099,7 +2099,7 @@ public async Task ConsumerCanQueryPartitionProperties(EventHubsTransportType tra Assert.That(partitionProperties.EventHubName, Is.EqualTo(scope.EventHubName).Using((IEqualityComparer)StringComparer.InvariantCultureIgnoreCase), "The Event Hub path should match."); Assert.That(partitionProperties.BeginningSequenceNumber, Is.Not.EqualTo(default(long)), "The beginning sequence number should have been populated."); Assert.That(partitionProperties.LastEnqueuedSequenceNumber, Is.Not.EqualTo(default(long)), "The last sequence number should have been populated."); - Assert.That(partitionProperties.LastEnqueuedOffset, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); + Assert.That(partitionProperties.LastEnqueuedOffsetString, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientTests.cs index d9600187c2e8..a1d5b8c13452 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventHubConsumerClientTests.cs @@ -684,7 +684,7 @@ public async Task ReadEventsFromPartitionAsyncWithNoOptionsReturnsAnEnumerable() var mockConnection = new MockConnection(() => transportConsumer); var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, mockConnection); - IAsyncEnumerable enumerable = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12)); + IAsyncEnumerable enumerable = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12")); Assert.That(enumerable, Is.Not.Null, "An enumerable should have been returned."); Assert.That(enumerable, Is.InstanceOf>(), "The enumerable should be of the correct type."); @@ -709,7 +709,7 @@ public async Task ReadEventsFromPartitionAsyncWithOptionsReturnsAnEnumerable() var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, mockConnection); var options = new ReadEventOptions { MaximumWaitTime = TimeSpan.FromMilliseconds(25) }; - var enumerable = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), options); + var enumerable = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), options); Assert.That(enumerable, Is.Not.Null, "An enumerable should have been returned."); Assert.That(enumerable, Is.InstanceOf>(), "The enumerable should be of the correct type."); @@ -734,7 +734,7 @@ public async Task ReadEventsFromPartitionAsyncRespectsTheCacheEventCount() var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, mockConnection); var options = new ReadEventOptions { MaximumWaitTime = TimeSpan.FromMilliseconds(25), CacheEventCount = 999 }; - await using var enumerator = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), options).GetAsyncEnumerator(); + await using var enumerator = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), options).GetAsyncEnumerator(); for (var index = 0; index < 5; ++index) { @@ -776,7 +776,7 @@ public async Task ReadEventsFromPartitionAsyncRespectsThePrefetchCount() It.IsAny())) .Returns(transportConsumer); - await using var enumerator = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), options).GetAsyncEnumerator(); + await using var enumerator = consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), options).GetAsyncEnumerator(); await enumerator.MoveNextAsync(); mockConnection @@ -824,7 +824,7 @@ public void ReadEventsFromPartitionAsyncThrowsIfConsumerClosedBeforeRead() { await consumer.CloseAsync(cancellationSource.Token); - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellationSource.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellationSource.Token)) { receivedEvents = true; break; @@ -862,7 +862,7 @@ public void ReadEventsFromPartitionAsyncThrowsIfCanceledBeforeRead() Assert.That(async () => { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { if (partitionEvent.Data == null) { @@ -905,7 +905,7 @@ public void ReadEventsFromPartitionAsyncThrowsIfCanceledDuringRead() Assert.That(async () => { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { if (++receivedEvents >= expectedEvents) { @@ -946,7 +946,7 @@ public void ReadEventsFromPartitionAsyncDoesNotThrowIfNotCanceled() Assert.That(async () => { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { if (++receivedEvents >= expectedEvents) { @@ -983,7 +983,7 @@ public async Task ReadEventsFromPartitionAsyncStopsReceivingWhenCanceled() try { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { if (++receivedEvents >= expectedEvents) { @@ -1024,7 +1024,7 @@ public async Task ReadEventsFromPartitionAsyncStopsReceivingWhenIterationStops() try { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { if (++receivedEvents >= expectedEvents) { @@ -1075,7 +1075,7 @@ public async Task ReadEventsFromPartitionAsyncStopsReceivingOnException() try { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { ++receivedEvents; } @@ -1114,7 +1114,7 @@ public async Task ReadEventsFromPartitionAsyncEmitsEventsToOneIteratorIteratorAn using var cancellation = new CancellationTokenSource(); cancellation.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), cancellation.Token)) { receivedEvents.Add(partitionEvent.Data); @@ -1147,7 +1147,7 @@ public async Task ReadEventsFromPartitionAsyncEmitsEventsWithMultipleIteratorsAn var options = new ReadEventOptions { MaximumWaitTime = TimeSpan.FromMilliseconds(5) }; var partition = "0"; - var position = EventPosition.FromOffset(22); + var position = EventPosition.FromOffset("22"); var mockConnection = new MockConnection(() => new PublishingTransportConsumerMock(events)); var consumer = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, mockConnection); var firstSubscriberEvents = new List(); @@ -1337,7 +1337,7 @@ public async Task ReadEventsFromPartitionAsyncRespectsWaitTimeWhenEmittingEvents using var cancellation = new CancellationTokenSource(); cancellation.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(12), options, cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("12"), options, cancellation.Token)) { receivedEvents.Add(partitionEvent.Data); consecutiveEmptyCount = (partitionEvent.Data == null) ? consecutiveEmptyCount + 1 : 0; @@ -1377,7 +1377,7 @@ public void ReadEventsFromPartitionAsyncPropagatesExceptions(Type exceptionType) Assert.That(async () => { - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset(2), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync("0", EventPosition.FromOffset("2"), cancellation.Token)) { ++receivedEvents; break; @@ -1445,7 +1445,7 @@ public async Task ReadEventsFromPartitionAsyncSetsThePartitionContext() using var cancellation = new CancellationTokenSource(); cancellation.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); - await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync(expectedPartition, EventPosition.FromOffset(12), cancellation.Token)) + await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync(expectedPartition, EventPosition.FromOffset("12"), cancellation.Token)) { Assert.That(partitionEvent.Partition.PartitionId, Is.EqualTo(expectedPartition), $"The event in position: { actualCount } was not associated with the expected partition."); Assert.That(partitionEvent.Partition.FullyQualifiedNamespace, Is.EqualTo(mockConnection.FullyQualifiedNamespace), $"The event in position: { actualCount } was not associated with the expected namespace."); @@ -2774,7 +2774,7 @@ internal override Task GetPropertiesAsync(EventHubsRetryPoli CancellationToken cancellationToken = default) { GetPropertiesInvokedWith = retryPolicy; - return Task.FromResult(new EventHubProperties(EventHubName, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), new string[] { "0", "1" })); + return Task.FromResult(new EventHubProperties(EventHubName, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), new string[] { "0", "1" }, false)); } internal override async Task GetPartitionIdsAsync(EventHubsRetryPolicy retryPolicy, diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventPositionTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventPositionTests.cs index 0eb31ffdd8cc..830cebb61a1a 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventPositionTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/EventPositionTests.cs @@ -40,8 +40,8 @@ public void EarliestAndLatestAreNotEqual() [Test] public void TheSameOffsetAreEqual() { - var first = EventPosition.FromOffset(12); - var second = EventPosition.FromOffset(12); + var first = EventPosition.FromOffset("12"); + var second = EventPosition.FromOffset("12"); Assert.That(first.Equals((object)second), Is.True, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.True, "The IEquatable comparison is incorrect."); @@ -57,8 +57,8 @@ public void TheSameOffsetAreEqual() [Test] public void DifferentOffsetsAreNotEqual() { - var first = EventPosition.FromOffset(12); - var second = EventPosition.FromOffset(34); + var first = EventPosition.FromOffset("12"); + var second = EventPosition.FromOffset("34"); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -179,7 +179,7 @@ public void DifferentInclusiveFlagsAreNotEqual() public void DifferentMembersAreNotEqual() { var first = EventPosition.FromSequenceNumber(234234); - var second = EventPosition.FromOffset(12); + var second = EventPosition.FromOffset("12"); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -195,7 +195,7 @@ public void DifferentMembersAreNotEqual() [Test] public void GetHashCodeReturnsDifferentValuesForDifferentMembers() { - var first = EventPosition.FromOffset(12); + var first = EventPosition.FromOffset("12"); var second = EventPosition.FromSequenceNumber(123); Assert.That(first.GetHashCode(), Is.Not.EqualTo(second.GetHashCode())); @@ -210,7 +210,7 @@ public void GetHashCodeReturnsDifferentValuesForDifferentMembers() public void ToStringReflectsTheState() { var inclusive = true; - var offset = 123; + var offset = "123"; var sequence = 778; var enqueued = DateTimeOffset.Now.AddHours(1); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/LastEnqueuedEventPropertiesTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/LastEnqueuedEventPropertiesTests.cs index 8a3b638b46c8..3d57b18d0e52 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/LastEnqueuedEventPropertiesTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/LastEnqueuedEventPropertiesTests.cs @@ -24,8 +24,8 @@ public class LastEnqueuedEventPropertiesTests public void TheSameValuesAreEqual() { var now = DateTimeOffset.UtcNow; - var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); - var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); Assert.That(first.Equals((object)second), Is.True, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.True, "The IEquatable comparison is incorrect."); @@ -42,8 +42,8 @@ public void TheSameValuesAreEqual() public void DifferentOffsetsAreNotEqual() { var now = DateTimeOffset.UtcNow; - var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 999, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); - var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 888, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "999", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "888", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -60,8 +60,8 @@ public void DifferentOffsetsAreNotEqual() public void DifferentEnqueueTimesAreNotEqual() { var now = DateTimeOffset.UtcNow; - var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); - var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("1974-12-09T21:30:00Z"), lastReceivedTime: now); + var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("1974-12-09T21:30:00Z"), lastReceivedTime: now); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -78,8 +78,8 @@ public void DifferentEnqueueTimesAreNotEqual() public void DifferentSequenceNumbersAreNotEqual() { var now = DateTimeOffset.UtcNow; - var first = new LastEnqueuedEventProperties(lastSequenceNumber: 333, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); - var second = new LastEnqueuedEventProperties(lastSequenceNumber: 444, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var first = new LastEnqueuedEventProperties(lastSequenceNumber: 333, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var second = new LastEnqueuedEventProperties(lastSequenceNumber: 444, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -96,8 +96,8 @@ public void DifferentSequenceNumbersAreNotEqual() public void DifferentLastReceiveTimesAreNotEqual() { var now = DateTimeOffset.UtcNow; - var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); - var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffset: 887, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now.AddHours(1)); + var first = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var second = new LastEnqueuedEventProperties(lastSequenceNumber: 123, lastOffsetString: "887", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now.AddHours(1)); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -114,8 +114,8 @@ public void DifferentLastReceiveTimesAreNotEqual() public void GetHashCodeReturnsDifferentValuesForDifferentMembers() { var now = DateTimeOffset.UtcNow; - var first = new LastEnqueuedEventProperties(lastSequenceNumber: 333, lastOffset: 888, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); - var second = new LastEnqueuedEventProperties(lastSequenceNumber: 555, lastOffset: 777, lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var first = new LastEnqueuedEventProperties(lastSequenceNumber: 333, lastOffsetString: "888", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); + var second = new LastEnqueuedEventProperties(lastSequenceNumber: 555, lastOffsetString: "777", lastEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastReceivedTime: now); Assert.That(first.GetHashCode(), Is.Not.EqualTo(second.GetHashCode())); } @@ -128,7 +128,7 @@ public void GetHashCodeReturnsDifferentValuesForDifferentMembers() [Test] public void ToStringReflectsTheState() { - var offset = 123; + var offset = "123"; var sequence = 778; var enqueued = DateTimeOffset.Now.AddHours(1); var received = DateTimeOffset.Now.AddHours(7); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/PartitionContextTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/PartitionContextTests.cs index dd54b8c35fa9..4d38cd9a7eee 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/PartitionContextTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Consumer/PartitionContextTests.cs @@ -89,7 +89,7 @@ public void ReadLastEnqueuedEventPropertiesDelegatesToTheConsumer() ( eventBody: new BinaryData(Array.Empty()), lastPartitionSequenceNumber: 1234, - lastPartitionOffset: 42, + lastPartitionOffset: "42", lastPartitionEnqueuedTime: DateTimeOffset.Parse("2015-10-27T00:00:00Z"), lastPartitionPropertiesRetrievalTime: DateTimeOffset.Parse("2012-03-04T08:42Z") ); @@ -99,7 +99,7 @@ public void ReadLastEnqueuedEventPropertiesDelegatesToTheConsumer() var information = context.ReadLastEnqueuedEventProperties(); Assert.That(information.SequenceNumber, Is.EqualTo(lastEvent.LastPartitionSequenceNumber), "The sequence number should match."); - Assert.That(information.Offset, Is.EqualTo(lastEvent.LastPartitionOffset), "The offset should match."); + Assert.That(information.OffsetString, Is.EqualTo(lastEvent.LastPartitionOffset), "The offset should match."); Assert.That(information.EnqueuedTime, Is.EqualTo(lastEvent.LastPartitionEnqueuedTime), "The last enqueue time should match."); Assert.That(information.LastReceivedTime, Is.EqualTo(lastEvent.LastPartitionPropertiesRetrievalTime), "The retrieval time should match."); Assert.That(mockConsumer.IsClosed, Is.False, "The consumer should not have been closed or disposed of."); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventDataTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventDataTests.cs index f2265ad863b7..be7d09080b4d 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventDataTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventDataTests.cs @@ -142,14 +142,14 @@ public void MutablePropertySettersPopulateTheAmqpMessage() /// /// [Test] - public void NonIdempotentStatePropertyAcessorsDeferToTheAmqpMessage() + public void NonIdempotentStatePropertyAccessorsDeferToTheAmqpMessage() { var sequenceNumber = 123L; - var offset = 456L; + var offset = "456L"; var enqueueTime = new DateTimeOffset(2015, 10, 27, 00, 00, 00, TimeSpan.Zero); var partitionKey = "fake-key"; var lastSequence = 321L; - var lastOffset = 654L; + var lastOffset = "654L"; var lastEnqueue = new DateTimeOffset(2012, 03, 04, 08, 00, 00, TimeSpan.Zero); var lastRetrieve = new DateTimeOffset(2020, 01, 01, 05, 15, 37, TimeSpan.Zero); var message = CreateFullyPopulatedAmqpMessage(sequenceNumber, lastSequence, offset, lastOffset, partitionKey, enqueueTime, lastEnqueue, lastRetrieve); @@ -158,7 +158,7 @@ public void NonIdempotentStatePropertyAcessorsDeferToTheAmqpMessage() Assert.That(message.Body.TryGetData(out var messageBody), Is.True, "The message body should have been read."); Assert.That(eventData.EventBody.ToArray(), Is.EquivalentTo(messageBody.First().ToArray()), "The message body should match."); Assert.That(eventData.Properties, Is.EquivalentTo(message.ApplicationProperties), "The application properties should match."); - Assert.That(eventData.Offset, Is.EqualTo(offset), "The offset should match."); + Assert.That(eventData.OffsetString, Is.EqualTo(offset), "The offset should match."); Assert.That(eventData.SequenceNumber, Is.EqualTo(sequenceNumber), "The sequence number should match."); Assert.That(eventData.EnqueuedTime, Is.EqualTo(enqueueTime), "The enqueued time should match."); Assert.That(eventData.PartitionKey, Is.EqualTo(partitionKey), "The partition key should match."); @@ -245,11 +245,11 @@ public void CloneProducesACopyWhenPropertyDictionariesAreSet() new Dictionary { { "Test", 123 } }, new Dictionary { { "System", "Hello" } }, 33334444, - 666777, + "666777", DateTimeOffset.Parse("2015-10-27T00:00:00Z"), "TestKey", 111222, - 999888, + "999888", DateTimeOffset.Parse("2012-03-04T09:00:00Z"), DateTimeOffset.Parse("2003-09-27T15:00:00Z"), 787878, @@ -275,11 +275,11 @@ public void CloneProducesACopyWhenPropertyDictionariesAreNotSet() null, null, 33334444, - 666777, + "666777", DateTimeOffset.Parse("2015-10-27T00:00:00Z"), "TestKey", 111222, - 999888, + "999888", DateTimeOffset.Parse("2012-03-04T09:00:00Z"), DateTimeOffset.Parse("2003-09-27T15:00:00Z"), 787878, @@ -304,11 +304,11 @@ public void CloneIsolatesPropertyChanges() new Dictionary { { "Test", 123 } }, new Dictionary { { "System", "Hello" } }, 33334444, - 666777, + "666777", DateTimeOffset.Parse("2015-10-27T00:00:00Z"), "TestKey", 111222, - 999888, + "999888", DateTimeOffset.Parse("2012-03-04T09:00:00Z"), DateTimeOffset.Parse("2003-09-27T15:00:00Z"), 787878, @@ -341,8 +341,8 @@ public void CloneIsolatesPropertyChanges() /// private static AmqpAnnotatedMessage CreateFullyPopulatedAmqpMessage(long sequenceNumber, long lastSequenceNumber, - long offset, - long lastOffset, + string offset, + string lastOffset, string partitionKey, DateTimeOffset enqueueTime, DateTimeOffset lastEnqueueTime, diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventHubsModelFactoryTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventHubsModelFactoryTests.cs index 737cf9b0c682..9fe753126fa8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventHubsModelFactoryTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/EventHubsModelFactoryTests.cs @@ -52,7 +52,7 @@ public void PartitionPropertiesInitializesProperties() var isEmpty = false; var beginningSequenceNumber = 123; var lastSequenceNumber = 9999; - var lastOffset = 767; + var lastOffset = "767"; var lastEnqueuedTime = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero); var properties = EventHubsModelFactory.PartitionProperties(eventHubName, partitionId, isEmpty, beginningSequenceNumber, lastSequenceNumber, lastOffset, lastEnqueuedTime); @@ -62,7 +62,7 @@ public void PartitionPropertiesInitializesProperties() Assert.That(properties.IsEmpty, Is.EqualTo(isEmpty), "The `is empty` flag should have been set."); Assert.That(properties.BeginningSequenceNumber, Is.EqualTo(beginningSequenceNumber), "The beginning sequence number should have been set."); Assert.That(properties.LastEnqueuedSequenceNumber, Is.EqualTo(lastSequenceNumber), "The last sequence number should have been set."); - Assert.That(properties.LastEnqueuedOffset, Is.EqualTo(lastOffset), "The last offset should have been set."); + Assert.That(properties.LastEnqueuedOffsetString, Is.EqualTo(lastOffset), "The last offset should have been set."); Assert.That(properties.LastEnqueuedTime, Is.EqualTo(lastEnqueuedTime), "The last enqueue date/time should have been set."); } @@ -96,14 +96,14 @@ public void PartitionPublishingPropertiesInitializesProperties() public void LastEnqueuedEventPropertiesInitializesProperties() { var lastSequence = long.MaxValue - 100; - var lastOffset = long.MaxValue - 10; + var lastOffset = (long.MaxValue - 10).ToString(); var lastEnqueued = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero); var lastReceived = new DateTimeOffset(2012, 03, 04, 08, 0, 0, TimeSpan.Zero); var properties = EventHubsModelFactory.LastEnqueuedEventProperties(lastSequence, lastOffset, lastEnqueued, lastReceived); Assert.That(properties, Is.Not.Null, "The properties should have been created."); Assert.That(properties.SequenceNumber, Is.EqualTo(lastSequence), "The sequence number should have been set."); - Assert.That(properties.Offset, Is.EqualTo(lastOffset), "The offset should have been set."); + Assert.That(properties.OffsetString, Is.EqualTo(lastOffset), "The offset should have been set."); Assert.That(properties.EnqueuedTime, Is.EqualTo(lastEnqueued), "The enqueued date/time should have been set."); Assert.That(properties.LastReceivedTime, Is.EqualTo(lastReceived), "The last received date/time should have been set."); } @@ -121,7 +121,7 @@ public void PartitionContextInitializesProperties() var eventHubName = "fakeHub"; var consumerGroup = "fakeConsumerGroup"; var partition = "0"; - var properties = EventHubsModelFactory.LastEnqueuedEventProperties(465, 988, fakeDate, fakeDate); + var properties = EventHubsModelFactory.LastEnqueuedEventProperties(465, "988", fakeDate, fakeDate); var context = EventHubsModelFactory.PartitionContext(fullyQualifiedNamespace, eventHubName, consumerGroup, partition, properties); Assert.That(context, Is.Not.Null, "The context should have been created."); @@ -166,7 +166,7 @@ public void EventDataInitializesProperties() var properties = new Dictionary { { "id", 12 } }; var systemProperties = new Dictionary { { "custom", "sys-value" } }; var sequenceNumber = long.MaxValue - 512; - var offset = long.MaxValue - 1024; + string offset = (long.MaxValue - 1024).ToString(); var enqueueTime = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero); var partitionKey = "omghai!"; var eventData = EventHubsModelFactory.EventData(body, properties, systemProperties, partitionKey, sequenceNumber, offset, enqueueTime); @@ -177,7 +177,7 @@ public void EventDataInitializesProperties() Assert.That(eventData.SystemProperties, Is.EquivalentTo(systemProperties), "The system properties should have been set."); Assert.That(eventData.PartitionKey, Is.EqualTo(partitionKey), "The partition key should have been set."); Assert.That(eventData.SequenceNumber, Is.EqualTo(sequenceNumber), "The sequence number should have been set."); - Assert.That(eventData.Offset, Is.EqualTo(offset), "The offset should have been set."); + Assert.That(eventData.OffsetString, Is.EqualTo(offset), "The offset should have been set."); Assert.That(eventData.EnqueuedTime, Is.EqualTo(enqueueTime), "The sequence number should have been set."); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Diagnostics/DiagnosticsActivitySourceTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Diagnostics/DiagnosticsActivitySourceTests.cs index 1b45b52614a2..4ef49a4cbbab 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Diagnostics/DiagnosticsActivitySourceTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Diagnostics/DiagnosticsActivitySourceTests.cs @@ -620,11 +620,11 @@ public async Task UpdateCheckpointAsyncCreatesScope(bool useOldOverload) if (useOldOverload) { - await mockProcessor.InvokeOldUpdateCheckpointAsync("65", 12345, 67890, cancellationSource.Token); + await mockProcessor.InvokeOldUpdateCheckpointAsync("65", "12345", 67890, cancellationSource.Token); } else { - await mockProcessor.InvokeUpdateCheckpointAsync("65", new CheckpointPosition(12345), cancellationSource.Token); + await mockProcessor.InvokeUpdateCheckpointAsync("65", new CheckpointPosition("12345"), cancellationSource.Token); } Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); @@ -783,7 +783,7 @@ public MockCheckpointStoreProcessor(CheckpointStore checkpointStore, protected override Task OnProcessingErrorAsync(Exception exception, EventProcessorPartition partition, string operationDescription, CancellationToken cancellationToken) => throw new NotImplementedException(); public Task InvokeGetCheckpointAsync(string partitionId, CancellationToken cancellationToken) => GetCheckpointAsync(partitionId, cancellationToken); - public Task InvokeOldUpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, CancellationToken cancellationToken) => UpdateCheckpointAsync(partitionId, offset, sequenceNumber, cancellationToken); + public Task InvokeOldUpdateCheckpointAsync(string partitionId, string offset, long? sequenceNumber, CancellationToken cancellationToken) => UpdateCheckpointAsync(partitionId, new CheckpointPosition(offset, sequenceNumber ?? long.MinValue), cancellationToken); public Task InvokeUpdateCheckpointAsync(string partitionId, CheckpointPosition checkpointPosition, CancellationToken cancellationToken) => UpdateCheckpointAsync(partitionId, checkpointPosition, cancellationToken); public Task> InvokeListOwnershipAsync(CancellationToken cancellationToken) => ListOwnershipAsync(cancellationToken); public Task> InvokeClaimOwnershipAsync(IEnumerable desiredOwnership, CancellationToken cancellationToken) => ClaimOwnershipAsync(desiredOwnership, cancellationToken); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorOptionsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorOptionsTests.cs index 01734cdf07e8..4859885cac3e 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorOptionsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorOptionsTests.cs @@ -35,7 +35,7 @@ public void CloneProducesACopy() PartitionOwnershipExpirationInterval = TimeSpan.FromHours(16), Identifier = "Rick Springfield is a bad friend", TrackLastEnqueuedEventProperties = false, - DefaultStartingPosition = EventPosition.FromOffset(555) + DefaultStartingPosition = EventPosition.FromOffset("555") }; EventProcessorOptions clone = options.Clone(); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.Infrastructure.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.Infrastructure.cs index 9516f4e8d437..e7bc8d93abcb 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.Infrastructure.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.Infrastructure.cs @@ -42,7 +42,7 @@ public async Task ReadLastEnqueuedEventPropertiesReadsPropertiesWhenThePartition var partitionId = "27"; var partitionIds = new[] { "0", partitionId }; var ownedPartitions = new List(); - var lastEventProperties = new LastEnqueuedEventProperties(1234, 9876, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), DateTimeOffset.Parse("2012-03-04T08:30:00Z")); + var lastEventProperties = new LastEnqueuedEventProperties(1234, "9876", DateTimeOffset.Parse("2015-10-27T00:00:00Z"), DateTimeOffset.Parse("2012-03-04T08:30:00Z")); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMinutes(5), TrackLastEnqueuedEventProperties = true }; var mockLoadBalancer = new Mock(); @@ -72,8 +72,8 @@ public async Task ReadLastEnqueuedEventPropertiesReadsPropertiesWhenThePartition .Returns(() => default); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockProcessor .Setup(processor => processor.CreateConnection()) @@ -112,7 +112,7 @@ public async Task ReadLastEnqueuedEventPropertiesThrowsWhenThePartitionIsNotOwne var partitionId = "27"; var partitionIds = new[] { "0", partitionId }; - var lastEventProperties = new LastEnqueuedEventProperties(1234, 9876, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), DateTimeOffset.Parse("2012-03-04T08:30:00Z")); + var lastEventProperties = new LastEnqueuedEventProperties(1234, "9876", DateTimeOffset.Parse("2015-10-27T00:00:00Z"), DateTimeOffset.Parse("2012-03-04T08:30:00Z")); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMinutes(5), TrackLastEnqueuedEventProperties = true }; var mockLoadBalancer = new Mock(); @@ -129,8 +129,8 @@ public async Task ReadLastEnqueuedEventPropertiesThrowsWhenThePartitionIsNotOwne .Callback(() => completionSource.TrySetResult(true)); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockProcessor .Setup(processor => processor.CreateConnection()) @@ -231,7 +231,7 @@ public void ProcessorCheckpointStoreDoesNotAllowCheckpointUpdate() var checkpointStore = EventProcessor.CreateCheckpointStore(mockProcessor.Object); Assert.That(checkpointStore, Is.Not.Null, "The storage manager should have been created."); - Assert.That(() => checkpointStore.UpdateCheckpointAsync(fqNamespace, eventHub, consumerGroup, partitionId, "Id", new CheckpointPosition(0), CancellationToken.None), Throws.InstanceOf(), "Calling to update checkpoints should not be implemented."); + Assert.That(() => checkpointStore.UpdateCheckpointAsync(fqNamespace, eventHub, consumerGroup, partitionId, "Id", new CheckpointPosition("0"), CancellationToken.None), Throws.InstanceOf(), "Calling to update checkpoints should not be implemented."); } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.MainProcessingLoop.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.MainProcessingLoop.cs index 4bcfd5f5acf5..8ad26f0f6b60 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.MainProcessingLoop.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.MainProcessingLoop.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -142,11 +143,16 @@ public async Task BackgroundProcessingToleratesPartitionIdQueryFailure() var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = new Mock(); var mockProcessor = new Mock(65, "consumerGroup", "namespace", "eventHub", Mock.Of(), default(EventProcessorOptions)) { CallBase = true }; + var partitionIds = new[] { "0", "1" }; mockConnection - .SetupSequence(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) + .SetupSequence(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) .Throws(expectedException) - .ReturnsAsync(new[] { "0", "1" }); + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); + + mockConnection + .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(partitionIds); mockProcessor .Setup(processor => processor.CreateConnection()) @@ -217,6 +223,10 @@ public async Task BackgroundProcessingToleratesALoadBalancingRunFailure() .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); + mockProcessor.Object.Logger = mockLogger.Object; mockProcessor @@ -301,8 +311,8 @@ public async Task BackgroundProcessingToleratesAnOwnershipClaimFailureWhenThePar .Throws(expectedException); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockProcessor.Object.Logger = mockLogger.Object; @@ -387,8 +397,8 @@ public async Task BackgroundProcessingToleratesAnOwnershipClaimFailureWhenThePar .Throws(expectedException); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockProcessor.Object.Logger = mockLogger.Object; @@ -486,8 +496,8 @@ public async Task BackgroundProcessingToleratesAnOwnershipClaimFailureWhenThePar .Returns(Mock.Of()); mockConnection - .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -604,8 +614,8 @@ public async Task BackgroundProcessingStartsProcessingForClaimedPartitions() .Returns(mockConsumer.Object); mockConnection - .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -744,7 +754,7 @@ public async Task BackgroundProcessingStopsProcessingAllPartitionsWhenShutdown() mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -875,7 +885,7 @@ public async Task BackgroundProcessingLogsHandlerErrorWhenPartitionProcessingSto mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1000,7 +1010,7 @@ public async Task BackgroundProcessingStopsProcessingForPartitionsWithLostOwners mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1090,6 +1100,10 @@ public async Task BackgroundProcessingRestartsProcessingForFaultedPartitions() .Returns(new ValueTask(new EventProcessorPartitionOwnership { PartitionId = partitionId })) .Returns(() => default); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -1149,7 +1163,7 @@ public async Task BackgroundProcessingUsesCheckpointsWhenProcessingPartitions() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var createConsumerCalls = 0; - var expectedStartingPosition = EventPosition.FromOffset(775, true); + var expectedStartingPosition = EventPosition.FromOffset("775", true); var partitionId = "27"; var partitionIds = new[] { "0", partitionId, "11" }; var ownedPartitions = new List { partitionId }; @@ -1174,7 +1188,7 @@ public async Task BackgroundProcessingUsesCheckpointsWhenProcessingPartitions() mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1253,7 +1267,7 @@ public async Task BackgroundProcessingDelegatesInitializationWhenProcessingClaim mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1372,7 +1386,7 @@ public async Task BackgroundProcessingLogsWhenStartingToProcessClaimedPartitions mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1484,6 +1498,10 @@ public async Task BackgroundProcessingLogsWhenStartingToProcessClaimedPartitions .Returns(new ValueTask(new EventProcessorPartitionOwnership { PartitionId = partitionId })) .Returns(() => default); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -1582,6 +1600,10 @@ public async Task BackgroundProcessingDispatchesExceptionsWhenStartingToProcessC .Returns(new ValueTask(new EventProcessorPartitionOwnership { PartitionId = partitionId })) .Returns(() => default); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -1701,7 +1723,7 @@ public async Task BackgroundProcessingLogsWhenSurrenderingClaimedPartitions() mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1814,7 +1836,7 @@ public async Task BackgroundProcessingDelegatesStopNotificationWhenSurrenderingC mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -1877,7 +1899,7 @@ public async Task BackgroundProcessingLogsWhenLoadBalancingIsSlow() var partitionId = "27"; var partitionIds = new[] { "0", partitionId, "111" }; var ownedPartitions = new List { partitionId }; - var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250), PartitionOwnershipExpirationInterval = TimeSpan.FromMilliseconds(750), LoadBalancingStrategy = LoadBalancingStrategy.Balanced }; + var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250), PartitionOwnershipExpirationInterval = TimeSpan.FromMilliseconds(750), LoadBalancingStrategy = LoadBalancingStrategy.Balanced }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockLogger = new Mock(); var mockLoadBalancer = new Mock(); @@ -1902,6 +1924,10 @@ public async Task BackgroundProcessingLogsWhenLoadBalancingIsSlow() return default; }); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -1959,7 +1985,7 @@ public async Task BackgroundProcessingEmitsAnErrorWhenLoadBalancingIsSlow() var partitionId = "27"; var partitionIds = new[] { "0", partitionId, "111" }; var ownedPartitions = new List { partitionId }; - var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250), PartitionOwnershipExpirationInterval = TimeSpan.FromMilliseconds(750), LoadBalancingStrategy = LoadBalancingStrategy.Balanced }; + var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250), PartitionOwnershipExpirationInterval = TimeSpan.FromMilliseconds(750), LoadBalancingStrategy = LoadBalancingStrategy.Balanced }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockLogger = new Mock(); var mockLoadBalancer = new Mock(); @@ -2000,7 +2026,7 @@ public async Task BackgroundProcessingEmitsAnErrorWhenLoadBalancingIsSlow() mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -2100,8 +2126,8 @@ public async Task BackgroundProcessingLogsWhenLargeNumberOfOwnedPartitions() .Returns(new ValueTask(default(EventProcessorPartitionOwnership))); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) @@ -2187,6 +2213,10 @@ public async Task BackgroundProcessingDoesNotLogWarningWhenOwnedCountIsStable() } }); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -2282,11 +2312,11 @@ public async Task LoadBalancingAppliesTheGreedyStrategy() }); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) .Returns(async () => { await Task.Yield(); - return partitionIds; + return new EventHubProperties("", DateTime.Now, partitionIds, false); }); mockConsumer @@ -2377,8 +2407,8 @@ public async Task LoadBalancingWhenGreedyAppliesTheTimeoutAfterBalance() }); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) @@ -2475,8 +2505,8 @@ public async Task LoadBalancingAppliesTheBalancedStrategy() }); mockConnection - .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(partitionIds); + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("", DateTime.Now, partitionIds, false)); mockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) @@ -2584,7 +2614,7 @@ public async Task LoadBalancingIsNotBlockedByLostPartitionOwnership() mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds)); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), partitionIds, false)); mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) @@ -2617,7 +2647,7 @@ public async Task LoadBalancingIsNotBlockedByLostPartitionOwnership() ItExpr.IsAny>(), ItExpr.Is(part => part.PartitionId == firstPartiton), ItExpr.IsAny()) - .Callback (() => + .Callback(() => { if (loadBalancingCountAtDelay == 0) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs index 2ece62a997a5..fe44aeacab83 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.PartitionProcessing.cs @@ -132,8 +132,8 @@ public async Task ProcessEventBatchAsyncLogsWhenBatchesAreDispatched() var eventBatch = new[] { - EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), sequenceNumber: 12345), - EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), sequenceNumber: 67890), + EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), sequenceNumber: 12345, offsetString: default), + EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), sequenceNumber: 67890, offsetString: default), }; var partition = new EventProcessorPartition { PartitionId = "123" }; @@ -364,7 +364,7 @@ public async Task CreatePartitionProcessorCanReadLastEventProperties() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = true }; - var lastEvent = new EventData(new BinaryData(Array.Empty()), lastPartitionSequenceNumber: 123, lastPartitionOffset: 887, lastPartitionEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastPartitionPropertiesRetrievalTime: DateTimeOffset.Parse("2021-03-04T08:30:00Z")); + var lastEvent = new EventData(new BinaryData(Array.Empty()), lastPartitionSequenceNumber: 123, lastPartitionOffset: "887", lastPartitionEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastPartitionPropertiesRetrievalTime: DateTimeOffset.Parse("2021-03-04T08:30:00Z")); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = Mock.Of(); var mockConsumer = new Mock(); @@ -413,7 +413,7 @@ public async Task CreatePartitionProcessorCanReadLastEventPropertiesWhenTheConsu var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = true, RetryOptions = retryOptions }; - var lastEvent = new EventData(new BinaryData(Array.Empty()), lastPartitionSequenceNumber: 123, lastPartitionOffset: 887, lastPartitionEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastPartitionPropertiesRetrievalTime: DateTimeOffset.Parse("2021-03-04T08:30:00Z")); + var lastEvent = new EventData(new BinaryData(Array.Empty()), lastPartitionSequenceNumber: 123, lastPartitionOffset: "887", lastPartitionEnqueuedTime: DateTimeOffset.Parse("2015-10-27T12:00:00Z"), lastPartitionPropertiesRetrievalTime: DateTimeOffset.Parse("2021-03-04T08:30:00Z")); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = Mock.Of(); var mockConsumer = new Mock(); @@ -482,7 +482,7 @@ public async Task CreatePartitionProcessorCreatesTheTransportConsumer() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var options = new EventProcessorOptions { Identifier = "fake", TrackLastEnqueuedEventProperties = false, PrefetchCount = 37, PrefetchSizeInBytes = 44, LoadBalancingUpdateInterval = TimeSpan.FromMinutes(1) }; var expectedOwnerLevel = 0; var expectedInvalidationOnSteal = true; @@ -542,7 +542,7 @@ public async Task CreatePartitionProcessorStartsTheProcessingTask() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = Mock.Of(); @@ -596,7 +596,7 @@ public async Task CreatePartitionProcessorProcessingTaskRespectsCancellation() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = Mock.Of(); @@ -644,7 +644,7 @@ public async Task CreatePartitionProcessorProcessingTaskClosesTheConsumerOnCance cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false }; var receiveCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var closeCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -754,7 +754,7 @@ public async Task CreatePartitionProcessorProcessingTaskDoesNotInvokeTheErrorHan cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false }; var receiveCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var closeCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -846,7 +846,7 @@ public async Task CreatePartitionProcessorProcessingTaskDispatchesEvents() cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -903,7 +903,7 @@ public async Task CreatePartitionProcessorProcessingLogsEachCycle() var startSequenceNumber = "4444"; var endSequenceNumber = "8888"; var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -914,8 +914,8 @@ public async Task CreatePartitionProcessorProcessingLogsEachCycle() var eventBatch = new List { - EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), offset: 0, sequenceNumber: long.Parse(startSequenceNumber)), - EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), offset: 1, sequenceNumber: long.Parse(endSequenceNumber)) + EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), offsetString: "0", sequenceNumber: long.Parse(startSequenceNumber)), + EventHubsModelFactory.EventData(new BinaryData(Array.Empty()), offsetString: "1", sequenceNumber: long.Parse(endSequenceNumber)) }; mockConsumer @@ -994,7 +994,7 @@ public async Task CreatePartitionProcessorProcessingTaskDispatchesExceptionsWhen var expectedException = new DivideByZeroException(); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1048,7 +1048,7 @@ public async Task CreatePartitionProcessorProcessingTaskDispatchesExceptions() var expectedException = new DivideByZeroException(); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var receiveCompletion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1111,7 +1111,7 @@ public async Task CreatePartitionProcessorProcessingTaskLogsExceptions() var expectedException = new DivideByZeroException("OMG FAIL!"); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var receiveCompletion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1176,7 +1176,7 @@ public async Task CreatePartitionProcessorProcessingTaskSurfacesExceptions() var expectedException = new DivideByZeroException("I'm special!"); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var receiveCompletion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1232,7 +1232,7 @@ public async Task CreatePartitionProcessorProcessingTaskWarnsForDeveloperCodeExc var expectedException = new DeveloperCodeException(new DivideByZeroException()); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 1, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1293,7 +1293,7 @@ public async Task CreatePartitionProcessorProcessingTaskLogsDeveloperCodeExcepti var expectedException = new DeveloperCodeException(new DivideByZeroException("Yay, I'm on the inside!")); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 1, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1356,7 +1356,7 @@ public async Task CreatePartitionProcessorProcessingTaskSurfacesDeveloperCodeExc var expectedException = new InvalidOperationException("BOOM!"); var developerException = new DeveloperCodeException(expectedException); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 1, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1403,7 +1403,7 @@ public async Task CreatePartitionProcessorProcessingTaskHonorsTheRetryPolicy() var expectedException = new EventHubsException(true, "frank", "BOOM!", EventHubsException.FailureReason.GeneralError); var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var retryOptions = new EventHubsRetryOptions { MaximumRetries = 2, MaximumDelay = TimeSpan.FromMilliseconds(15) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); @@ -1658,7 +1658,7 @@ public async Task CreatePartitionProcessorProcessingTaskStartsTheConsumerAtTheCo var retryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) }; var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = retryOptions }; var partition = new EventProcessorPartition { PartitionId = "4" }; - var lastEventBatch = new List { new EventData(new BinaryData(Array.Empty())), new EventData(new BinaryData(Array.Empty()), offset: 9987) }; + var lastEventBatch = new List { new EventData(new BinaryData(Array.Empty())), new EventData(new BinaryData(Array.Empty()), offset: "9987") }; var initialStartingPosition = EventPosition.FromSequenceNumber(332); var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockConnection = Mock.Of(); @@ -1711,7 +1711,7 @@ public async Task CreatePartitionProcessorProcessingTaskStartsTheConsumerAtTheCo mockProcessor.Object.ConsumerGroup, partition.PartitionId, It.IsAny(), - EventPosition.FromOffset(lastEventBatch.Last().Offset, false), + EventPosition.FromOffset(lastEventBatch.Last().OffsetString, false), mockConnection, It.IsAny(), It.IsAny()), diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.StartStop.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.StartStop.cs index a22005b0c94c..def35104ea18 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.StartStop.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/EventProcessorTests.StartStop.cs @@ -132,6 +132,10 @@ public async Task StartProcessingStartsTheLoadBalancer(bool async) .Callback(() => completionSource.TrySetResult(true)) .ReturnsAsync(default(EventProcessorPartitionOwnership)); + mockConnection + .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitions, false)); + mockConnection .Setup(connection => connection.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitions); @@ -362,7 +366,7 @@ public async Task StartProcessingValidatesCheckpointsCanBeQueried(bool async) mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), new[] { "0" })); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), new[] { "0" }, false)); mockProcessor .Setup(processor => processor.CreateConnection()) @@ -429,9 +433,9 @@ public async Task StartProcessingSurfacesMultipleValidationFailures(bool async) var mockConnection = new Mock(); var mockProcessor = new Mock>(4, "consumerGroup", "namespace", "eventHub", Mock.Of(), default(EventProcessorOptions)) { CallBase = true }; - mockProcessor - .Setup(processor => processor.CreateConnection()) - .Returns(mockConnection.Object); + mockProcessor + .Setup(processor => processor.CreateConnection()) + .Returns(mockConnection.Object); mockProcessor .Protected() @@ -629,6 +633,10 @@ public async Task StartProcessingWarnsWhenConfiguredIntervalsAreTooClose() .Setup(lb => lb.RunLoadBalancingAsync(partitionIds, It.IsAny())) .Returns(new ValueTask(default(EventProcessorPartitionOwnership))); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -730,6 +738,10 @@ public async Task StartProcessingDoesNotWarnForAppropriateIntervals(double owner .Setup(lb => lb.RunLoadBalancingAsync(partitionIds, It.IsAny())) .Returns(new ValueTask(default(EventProcessorPartitionOwnership))); + mockConnection + .Setup(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, partitionIds, false)); + mockConnection .Setup(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(partitionIds); @@ -923,6 +935,10 @@ public async Task StopProcessingStopsTheLoadBalancer(bool async) .Returns(Task.CompletedTask) .Callback(() => stopCompletionSource.TrySetResult(true)); + mockConnection + .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, Array.Empty(), false)); + mockConnection .Setup(connection => connection.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync(Array.Empty()); @@ -1268,9 +1284,9 @@ public async Task StopProcessingIsSafeToCallInTheErrorHandler(bool async) .Callback(() => stopCompletionSource.TrySetResult(true)); mockConnection - .SetupSequence(conn => conn.GetPartitionIdsAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(Array.Empty()) - .ReturnsAsync(Array.Empty()) + .SetupSequence(conn => conn.GetPropertiesAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, Array.Empty(), false)) + .ReturnsAsync(new EventHubProperties("eventHub", DateTimeOffset.Now, Array.Empty(), false)) .Returns(async () => { await startCompletionSource.Task; @@ -1364,7 +1380,7 @@ public async Task StopProcessingLogsWarningForTokenCancellationErrors(bool async var firstCall = true; var partition = new EventProcessorPartition { PartitionId = "99" }; - var position = EventPosition.FromOffset(12); + var position = EventPosition.FromOffset("12"); var options = new EventProcessorOptions { TrackLastEnqueuedEventProperties = false, RetryOptions = new EventHubsRetryOptions { MaximumRetries = 0, MaximumDelay = TimeSpan.FromMilliseconds(5) } }; var handlerCompletion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var mockEventSource = new Mock(); @@ -1374,7 +1390,7 @@ public async Task StopProcessingLogsWarningForTokenCancellationErrors(bool async mockConnection .Setup(connection => connection.GetPropertiesAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), new[] { "0" })); + .ReturnsAsync(new EventHubProperties(mockProcessor.Object.EventHubName, new DateTimeOffset(2015, 10, 27, 12, 0, 0, 0, TimeSpan.Zero), new[] { "0" }, false)); mockConsumer .Setup(consumer => consumer.ReceiveAsync(It.IsAny(), It.IsAny(), It.IsAny())) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs index ef02b92dff63..3a5665f9b4b8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverLiveTests.cs @@ -647,7 +647,7 @@ public async Task ReceiverCanReadFromOffset(bool isInclusive) // Once sent, query the partition and determine the offset of the last enqueued event, then send the new set // of events that should appear after the starting position. - long lastOffset; + string lastOffset; EventPosition startingPosition; await using (var producer = new EventHubProducerClient( @@ -658,7 +658,7 @@ public async Task ReceiverCanReadFromOffset(bool isInclusive) await SendEventsAsync(scope.EventHubName, seedEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); await Task.Delay(250); - lastOffset = (await producer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedOffset; + lastOffset = (await producer.GetPartitionPropertiesAsync(partition, cancellationSource.Token)).LastEnqueuedOffsetString; startingPosition = EventPosition.FromOffset(lastOffset, isInclusive); await SendEventsAsync(scope.EventHubName, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token); @@ -687,7 +687,7 @@ public async Task ReceiverCanReadFromOffset(bool isInclusive) Assert.That(cancellationSource.IsCancellationRequested, Is.False, "The cancellation token should not have been signaled."); Assert.That(readState.Events.Count, Is.EqualTo(expectedCount), "The wrong number of events was read for the value of the inclusive flag."); - Assert.That(readState.Events.Values.Any(readEvent => readEvent.Offset == lastOffset), Is.EqualTo(isInclusive), $"The event with offset [{ lastOffset }] was { ((isInclusive) ? "not" : "") } in the set of read events, which is inconsistent with the inclusive flag."); + Assert.That(readState.Events.Values.Any(readEvent => readEvent.OffsetString == lastOffset), Is.EqualTo(isInclusive), $"The event with offset [{ lastOffset }] was { ((isInclusive) ? "not" : "") } in the set of read events, which is inconsistent with the inclusive flag."); foreach (var sourceEvent in sourceEvents) { @@ -1527,7 +1527,7 @@ public async Task ReceiverCanReadFromMultipleConsumerGroupsWithDifferentActiveOw /// /// [Test] - public async Task ExclusiveReceiverSupercedesNonExclusiveActiveReader() + public async Task ExclusiveReceiverSupersedesNonExclusiveActiveReader() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { @@ -1598,7 +1598,7 @@ public async Task ExclusiveReceiverSupercedesNonExclusiveActiveReader() /// /// [Test] - public async Task ReceiverWithHigherOwnerLevelSupercedesActiveReader() + public async Task ReceiverWithHigherOwnerLevelSupersedesActiveReader() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) { @@ -1818,7 +1818,7 @@ public async Task ExclusiveReceiverDoesNotSupersedeNonExclusiveActiveReaderOnAno /// /// [Test] - public async Task ReceiverIsNotCompromisedByBeingSupercededByAnotherReaderWithHigherLevel() + public async Task ReceiverIsNotCompromisedByBeingSupersededByAnotherReaderWithHigherLevel() { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) { @@ -2436,7 +2436,7 @@ public async Task ReceiverCanRetrievePartitionProperties(EventHubsTransportType Assert.That(partitionProperties.EventHubName, Is.EqualTo(scope.EventHubName).Using((IEqualityComparer)StringComparer.InvariantCultureIgnoreCase), "The Event Hub path should match."); Assert.That(partitionProperties.BeginningSequenceNumber, Is.Not.EqualTo(default(long)), "The beginning sequence number should have been populated."); Assert.That(partitionProperties.LastEnqueuedSequenceNumber, Is.Not.EqualTo(default(long)), "The last sequence number should have been populated."); - Assert.That(partitionProperties.LastEnqueuedOffset, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); + Assert.That(partitionProperties.LastEnqueuedOffsetString, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverTests.cs index e6edb55d0405..4f3808ba636a 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PartitionReceiverTests.cs @@ -582,7 +582,7 @@ public void ConnectionConstructorSetsThePartitionId() [Test] public void ConnectionStringConstructorSetsTheInitialPosition() { - var expectedPosition = EventPosition.FromOffset(999); + var expectedPosition = EventPosition.FromOffset("999"); var connectionString = "Endpoint=sb://somehost.com;SharedAccessKeyName=ABC;SharedAccessKey=123;EntityPath=somehub"; var receiver = new PartitionReceiver("cg", "pid", expectedPosition, connectionString); @@ -596,7 +596,7 @@ public void ConnectionStringConstructorSetsTheInitialPosition() [Test] public void TokenCredentialConstructorSetsTheInitialPosition() { - var expectedPosition = EventPosition.FromOffset(999); + var expectedPosition = EventPosition.FromOffset("999"); var receiver = new PartitionReceiver("cg", "pid", expectedPosition, "fqns", "eh", Mock.Of()); Assert.That(receiver.InitialPosition, Is.EqualTo(expectedPosition)); @@ -609,7 +609,7 @@ public void TokenCredentialConstructorSetsTheInitialPosition() [Test] public void SharedKeyCredentialConstructorSetsTheInitialPosition() { - var expectedPosition = EventPosition.FromOffset(999); + var expectedPosition = EventPosition.FromOffset("999"); var receiver = new PartitionReceiver("cg", "pid", expectedPosition, "fqns", "eh", new AzureNamedKeyCredential("key", "value")); Assert.That(receiver.InitialPosition, Is.EqualTo(expectedPosition)); @@ -622,7 +622,7 @@ public void SharedKeyCredentialConstructorSetsTheInitialPosition() [Test] public void SasCredentialConstructorSetsTheInitialPosition() { - var expectedPosition = EventPosition.FromOffset(999); + var expectedPosition = EventPosition.FromOffset("999"); var receiver = new PartitionReceiver("cg", "pid", expectedPosition, "fqns", "eh", new AzureSasCredential(new SharedAccessSignature("sb://this.is.Fake/blah", "key", "value").Value)); Assert.That(receiver.InitialPosition, Is.EqualTo(expectedPosition)); @@ -635,7 +635,7 @@ public void SasCredentialConstructorSetsTheInitialPosition() [Test] public void ConnectionConstructorSetsTheInitialPosition() { - var expectedPosition = EventPosition.FromOffset(999); + var expectedPosition = EventPosition.FromOffset("999"); var receiver = new PartitionReceiver("cg", "pid", expectedPosition, Mock.Of()); Assert.That(receiver.InitialPosition, Is.EqualTo(expectedPosition)); @@ -730,7 +730,7 @@ public void CreateTransportConsumerDelegatesToTheConnection() var expectedConsumerGroup = "consumerGroup"; var expectedPartitionId = "partitionId"; var expectedIdentifier = "customIdent!fi3r!"; - var expectedPosition = EventPosition.FromOffset(55); + var expectedPosition = EventPosition.FromOffset("55"); var expectedInvalidateOnSteal = false; var expectedOptions = new PartitionReceiverOptions @@ -771,7 +771,7 @@ public void ReadLastEnqueuedEventPropertiesDelegatesToTheTransportConsumer() ( eventBody: new BinaryData(Array.Empty()), lastPartitionSequenceNumber: 1234, - lastPartitionOffset: 42, + lastPartitionOffset: "42", lastPartitionEnqueuedTime: DateTimeOffset.Parse("2015-10-27T00:00:00Z"), lastPartitionPropertiesRetrievalTime: DateTimeOffset.Parse("2012-03-04T08:42Z") ); @@ -798,7 +798,7 @@ public void ReadLastEnqueuedEventPropertiesDelegatesToTheTransportConsumer() var information = receiver.ReadLastEnqueuedEventProperties(); Assert.That(information.SequenceNumber, Is.EqualTo(lastEvent.LastPartitionSequenceNumber), "The sequence number should match."); - Assert.That(information.Offset, Is.EqualTo(lastEvent.LastPartitionOffset), "The offset should match."); + Assert.That(information.OffsetString, Is.EqualTo(lastEvent.LastPartitionOffset), "The offset should match."); Assert.That(information.EnqueuedTime, Is.EqualTo(lastEvent.LastPartitionEnqueuedTime), "The last enqueue time should match."); Assert.That(information.LastReceivedTime, Is.EqualTo(lastEvent.LastPartitionPropertiesRetrievalTime), "The retrieval time should match."); } @@ -834,7 +834,7 @@ public void ReadLastEnqueuedEventPropertiesAllowsTheOperationWhenTheOptionIsUnse var information = receiver.ReadLastEnqueuedEventProperties(); Assert.That(information.SequenceNumber, Is.EqualTo(defaultProperties.SequenceNumber), "The sequence number should match."); - Assert.That(information.Offset, Is.EqualTo(defaultProperties.Offset), "The offset should match."); + Assert.That(information.OffsetString, Is.EqualTo(defaultProperties.OffsetString), "The offset should match."); Assert.That(information.EnqueuedTime, Is.EqualTo(defaultProperties.EnqueuedTime), "The last enqueue time should match."); Assert.That(information.LastReceivedTime, Is.EqualTo(defaultProperties.LastReceivedTime), "The retrieval time should match."); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PluggableCheckpointStoreEventProcessorTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PluggableCheckpointStoreEventProcessorTests.cs index 5ae1ae7be499..900d604dda88 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PluggableCheckpointStoreEventProcessorTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Primitives/PluggableCheckpointStoreEventProcessorTests.cs @@ -78,7 +78,7 @@ public void CheckpointStoreIsUsedByUpdateCheckpointAsync() var expectedException = new DivideByZeroException(); var expectedExceptionOld = new FormatException(); var partitionId = "fakePart"; - var offset = 12345; + var offset = "12345"; var sequence = 9987; var mockCheckpointStore = new Mock(); var mockProcessor = new MockCheckpointStoreProcessor(mockCheckpointStore.Object, 100, "fakeConsumer", "fakeNamespace", "fakeHub", Mock.Of()); @@ -90,24 +90,11 @@ public void CheckpointStoreIsUsedByUpdateCheckpointAsync() mockProcessor.ConsumerGroup, partitionId, mockProcessor.Identifier, - It.Is(csp => - csp.SequenceNumber == sequence), + It.Is(csp => csp.OffsetString == offset && csp.SequenceNumber == sequence), cancellationSource.Token)) .ThrowsAsync(expectedException); - mockCheckpointStore - .Setup(store => store.UpdateCheckpointAsync( - mockProcessor.FullyQualifiedNamespace, - mockProcessor.EventHubName, - mockProcessor.ConsumerGroup, - partitionId, - offset, - sequence, - cancellationSource.Token)) - .ThrowsAsync(expectedExceptionOld); - - Assert.That(async () => await mockProcessor.InvokeOldUpdateCheckpointAsync(partitionId, offset, sequence, cancellationSource.Token), Throws.Exception.EqualTo(expectedExceptionOld)); - Assert.That(async () => await mockProcessor.InvokeUpdateCheckpointAsync(partitionId, new CheckpointPosition(sequence), cancellationSource.Token), Throws.Exception.EqualTo(expectedException)); + Assert.That(async () => await mockProcessor.InvokeUpdateCheckpointAsync(partitionId, new CheckpointPosition(offset, sequence), cancellationSource.Token), Throws.Exception.EqualTo(expectedException)); } /// @@ -229,7 +216,6 @@ public MockCheckpointStoreProcessor(CheckpointStore checkpointStore, protected override Task OnProcessingErrorAsync(Exception exception, EventProcessorPartition partition, string operationDescription, CancellationToken cancellationToken) => throw new NotImplementedException(); public Task InvokeGetCheckpointAsync(string partitionId, CancellationToken cancellationToken) => GetCheckpointAsync(partitionId, cancellationToken); - public Task InvokeOldUpdateCheckpointAsync(string partitionId, long offset, long? sequenceNumber, CancellationToken cancellationToken) => UpdateCheckpointAsync(partitionId, offset, sequenceNumber, cancellationToken); public Task InvokeUpdateCheckpointAsync(string partitionId, CheckpointPosition checkpointPosition, CancellationToken cancellationToken) => UpdateCheckpointAsync(partitionId, checkpointPosition, cancellationToken); public Task> InvokeListOwnershipAsync(CancellationToken cancellationToken) => ListOwnershipAsync(cancellationToken); public Task> InvokeClaimOwnershipAsync(IEnumerable desiredOwnership, CancellationToken cancellationToken) => ClaimOwnershipAsync(desiredOwnership, cancellationToken); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/CheckpointPositionTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/CheckpointPositionTests.cs index 6eeba1708c4b..164d8a57ac7c 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/CheckpointPositionTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/CheckpointPositionTests.cs @@ -15,6 +15,25 @@ namespace Azure.Messaging.EventHubs.Tests [TestFixture] public class CheckpointPositionTests { + /// + /// Verifies functionality of the constructor. + /// + /// + [Test] + [TestCase(null)] + [TestCase("")] + public void ConstructorValidatesOffset(string offset) + { + if (offset == null) + { + Assert.That(() => new CheckpointPosition(offset), Throws.InstanceOf()); + } + else + { + Assert.That(() => new CheckpointPosition(offset), Throws.InstanceOf()); + } + } + /// /// Verifies functionality of the /// equality. @@ -23,8 +42,24 @@ public class CheckpointPositionTests [Test] public void TheSamePositionAreEqual() { - var first = new CheckpointPosition(121); - var second = new CheckpointPosition(121); + var first = new CheckpointPosition("121"); + var second = new CheckpointPosition("121"); + + Assert.That(first.Equals((object)second), Is.True, "The default Equals comparison is incorrect."); + Assert.That(first.Equals(second), Is.True, "The IEquatable comparison is incorrect."); + Assert.That((first == second), Is.True, "The == operator comparison is incorrect."); + Assert.That((first != second), Is.False, "The != operator comparison is incorrect."); + } + + /// + /// Verifies functionality of the + /// equality. + /// + [Test] + public void TheSamePositionAreEqualWithSequenceNumber() + { + var first = new CheckpointPosition("44", 121); + var second = new CheckpointPosition("44", 121); Assert.That(first.Equals((object)second), Is.True, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.True, "The IEquatable comparison is incorrect."); @@ -40,8 +75,42 @@ public void TheSamePositionAreEqual() [Test] public void DifferentPositionsAreNotEqual() { - var first = new CheckpointPosition(10); - var second = new CheckpointPosition(121); + var first = new CheckpointPosition("10"); + var second = new CheckpointPosition("121"); + + Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); + Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); + Assert.That((first == second), Is.False, "The == operator comparison is incorrect."); + Assert.That((first != second), Is.True, "The != operator comparison is incorrect."); + } + + /// + /// Verifies functionality of the + /// equality. + /// + /// + [Test] + public void DifferentPositionsAreNotEqualWithDifferentMembers() + { + var first = new CheckpointPosition("121"); + var second = new CheckpointPosition("121", 10); + + Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); + Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); + Assert.That((first == second), Is.False, "The == operator comparison is incorrect."); + Assert.That((first != second), Is.True, "The != operator comparison is incorrect."); + } + + /// + /// Verifies functionality of the + /// equality. + /// + /// + [Test] + public void DifferentPositionsAreNotEqualWithOffset() + { + var first = new CheckpointPosition("10"); + var second = new CheckpointPosition("121"); Assert.That(first.Equals((object)second), Is.False, "The default Equals comparison is incorrect."); Assert.That(first.Equals(second), Is.False, "The IEquatable comparison is incorrect."); @@ -57,8 +126,8 @@ public void DifferentPositionsAreNotEqual() [Test] public void GetHashCodeReturnsDifferentValuesForDifferentMembers() { - var first = new CheckpointPosition(10); - var second = new CheckpointPosition(121); + var first = new CheckpointPosition("10", 12); + var second = new CheckpointPosition("121"); Assert.That(first.GetHashCode(), Is.Not.EqualTo(second.GetHashCode())); } @@ -72,7 +141,7 @@ public void GetHashCodeReturnsDifferentValuesForDifferentMembers() public void FromEventSetsProperties() { var sequence = 4566; - var eventData = new EventData(new BinaryData("Hello"), sequenceNumber: sequence, offset: 123); + var eventData = new EventData(new BinaryData("Hello"), sequenceNumber: sequence, offset: "123"); var checkpoint = CheckpointPosition.FromEvent(eventData); @@ -87,11 +156,26 @@ public void FromEventSetsProperties() [Test] public void ToStringReflectsTheState() { - var sequence = 121; + var offset = "121"; + var checkpoint = new CheckpointPosition(offset); - var checkpoint = new CheckpointPosition(sequence); + Assert.That(checkpoint.ToString(), Contains.Substring($"[{offset}]"), "The offset should be represented."); + } - Assert.That(checkpoint.ToString(), Contains.Substring($"[{sequence}]"), "The sequence should be represented."); + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void ToStringReflectsTheStateWithSequenceNumber() + { + var offset = "121"; + var sequence = 10; + var checkpoint = new CheckpointPosition(offset, sequence); + + Assert.That(checkpoint.ToString(), Contains.Substring($"[{offset}]"), "The offset should be represented."); + Assert.That(checkpoint.ToString(), Contains.Substring($"[{sequence}]"), "The sequence number should be represented."); } /// @@ -102,7 +186,7 @@ public void ToStringReflectsTheState() [Test] public void ToStringReflectsTheStateFromEventData() { - var offset = 400; + var offset = "400"; var sequence = 121; var eventData = new EventData(new BinaryData("Hello"), sequenceNumber: sequence, offset: offset); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs index 18882e31e530..e78b5f44c0ce 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientLiveTests.cs @@ -1601,7 +1601,7 @@ public async Task ProducerCanRetrievePartitionProperties(EventHubsTransportType Assert.That(partitionProperties.EventHubName, Is.EqualTo(scope.EventHubName).Using((IEqualityComparer)StringComparer.InvariantCultureIgnoreCase), "The Event Hub path should match."); Assert.That(partitionProperties.BeginningSequenceNumber, Is.Not.EqualTo(default(long)), "The beginning sequence number should have been populated."); Assert.That(partitionProperties.LastEnqueuedSequenceNumber, Is.Not.EqualTo(default(long)), "The last sequence number should have been populated."); - Assert.That(partitionProperties.LastEnqueuedOffset, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); + Assert.That(partitionProperties.LastEnqueuedOffsetString, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs index 2616c9975826..bc78073b0d42 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubBufferedProducerClientTests.cs @@ -412,7 +412,7 @@ public async Task GetPartitionPropertiesAsyncIsDelegated() .Setup(producer => producer.GetPartitionPropertiesAsync( It.IsAny(), It.IsAny())) - .ReturnsAsync(new PartitionProperties("test", "1", true, 12345, 6789, 22, new DateTimeOffset(2015, 10, 27, 0, 0, 0, TimeSpan.Zero))); + .ReturnsAsync(new PartitionProperties("test", "1", true, 12345, 6789, "22", new DateTimeOffset(2015, 10, 27, 0, 0, 0, TimeSpan.Zero))); await bufferedProducer.GetPartitionPropertiesAsync(expectedPartition, cancellationSource.Token); mockProducer.Verify(producer => producer.GetPartitionPropertiesAsync(expectedPartition, cancellationSource.Token), Times.Once); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs index 38bb0890967f..70d643635bd1 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientLiveTests.cs @@ -869,7 +869,7 @@ public async Task SendSetUpdatesPartitionProperties() // The following properties should have been updated. Assert.That(newPartitionProperties.LastEnqueuedSequenceNumber, Is.GreaterThan(oldPartitionProperties.LastEnqueuedSequenceNumber)); - Assert.That(newPartitionProperties.LastEnqueuedOffset, Is.GreaterThan(oldPartitionProperties.LastEnqueuedOffset)); + Assert.That(newPartitionProperties.LastEnqueuedOffsetString, Is.GreaterThan(oldPartitionProperties.LastEnqueuedOffsetString)); } } } @@ -920,7 +920,8 @@ public async Task SendBatchUpdatesPartitionProperties() // The following properties should have been updated. Assert.That(newPartitionProperties.LastEnqueuedSequenceNumber, Is.GreaterThan(oldPartitionProperties.LastEnqueuedSequenceNumber)); - Assert.That(newPartitionProperties.LastEnqueuedOffset, Is.GreaterThan(oldPartitionProperties.LastEnqueuedOffset)); + Assert.That(newPartitionProperties.LastEnqueuedOffsetString, Is.Not.EqualTo(oldPartitionProperties.LastEnqueuedOffsetString)); + Assert.That(newPartitionProperties.LastEnqueuedOffsetString, Is.Not.Null.And.Not.Empty); } } } @@ -964,7 +965,7 @@ public async Task SendDoesNotUpdatePartitionPropertiesWhenSendingToDifferentPart Assert.That(newPartitionProperties.EventHubName, Is.EqualTo(oldPartitionProperties.EventHubName)); Assert.That(newPartitionProperties.BeginningSequenceNumber, Is.EqualTo(oldPartitionProperties.BeginningSequenceNumber)); Assert.That(newPartitionProperties.LastEnqueuedSequenceNumber, Is.EqualTo(oldPartitionProperties.LastEnqueuedSequenceNumber)); - Assert.That(newPartitionProperties.LastEnqueuedOffset, Is.EqualTo(oldPartitionProperties.LastEnqueuedOffset)); + Assert.That(newPartitionProperties.LastEnqueuedOffsetString, Is.EqualTo(oldPartitionProperties.LastEnqueuedOffsetString)); } } } @@ -1375,7 +1376,7 @@ public async Task ProducerCanRetrievePartitionProperties(EventHubsTransportType Assert.That(partitionProperties.EventHubName, Is.EqualTo(scope.EventHubName).Using((IEqualityComparer)StringComparer.InvariantCultureIgnoreCase), "The Event Hub path should match."); Assert.That(partitionProperties.BeginningSequenceNumber, Is.Not.EqualTo(default(long)), "The beginning sequence number should have been populated."); Assert.That(partitionProperties.LastEnqueuedSequenceNumber, Is.Not.EqualTo(default(long)), "The last sequence number should have been populated."); - Assert.That(partitionProperties.LastEnqueuedOffset, Is.Not.EqualTo(default(long)), "The last offset should have been populated."); + Assert.That(partitionProperties.LastEnqueuedOffsetString, Is.Not.Null.And.Not.Empty, "The last offset should have been populated."); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientTests.cs index 95eb0d6d34f0..dfc0786557e7 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/EventHubProducerClientTests.cs @@ -2888,7 +2888,7 @@ internal override Task GetPropertiesAsync(EventHubsRetryPoli CancellationToken cancellationToken = default) { GetPropertiesInvokedWith = retryPolicy; - return Task.FromResult(new EventHubProperties(EventHubName, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), new string[] { "0", "1" })); + return Task.FromResult(new EventHubProperties(EventHubName, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), new string[] { "0", "1" }, false)); } internal override async Task GetPartitionIdsAsync(EventHubsRetryPolicy retryPolicy, diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/TransportProducerPoolTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/TransportProducerPoolTests.cs index a1a8c9c47a90..c4847f9d9be5 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/TransportProducerPoolTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Producer/TransportProducerPoolTests.cs @@ -398,7 +398,7 @@ internal override Task GetPropertiesAsync(EventHubsRetryPoli CancellationToken cancellationToken = default) { GetPropertiesInvokedWith = retryPolicy; - return Task.FromResult(new EventHubProperties(EventHubName, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), new string[] { "0", "1" })); + return Task.FromResult(new EventHubProperties(EventHubName, DateTimeOffset.Parse("2015-10-27T00:00:00Z"), new string[] { "0", "1" }, false)); } internal async override Task GetPartitionIdsAsync(EventHubsRetryPolicy retryPolicy, diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs index c758b7b90efe..c50916b7ddf8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample03_EventHubMetadataLiveTests.cs @@ -142,7 +142,7 @@ public async Task InspectPartition() Debug.WriteLine($"\tThe partition contains no events: { partitionProperties.IsEmpty }"); Debug.WriteLine($"\tThe first sequence number is: { partitionProperties.BeginningSequenceNumber }"); Debug.WriteLine($"\tThe last sequence number is: { partitionProperties.LastEnqueuedSequenceNumber }"); - Debug.WriteLine($"\tThe last offset is: { partitionProperties.LastEnqueuedOffset }"); + Debug.WriteLine($"\tThe last offset is: { partitionProperties.LastEnqueuedOffsetString }"); Debug.WriteLine($"\tThe last enqueued time is: { partitionProperties.LastEnqueuedTime }, in UTC."); } finally diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs index 0f7cf87fe79f..c90f15978dbc 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample05_ReadingEventsLiveTests.cs @@ -453,7 +453,7 @@ public async Task ReadPartitionFromOffset() string firstPartition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First(); PartitionProperties properties = await consumer.GetPartitionPropertiesAsync(firstPartition, cancellationSource.Token); - EventPosition startingPosition = EventPosition.FromOffset(properties.LastEnqueuedOffset); + EventPosition startingPosition = EventPosition.FromOffset(properties.LastEnqueuedOffsetString); await foreach (PartitionEvent partitionEvent in consumer.ReadEventsFromPartitionAsync( firstPartition, @@ -592,7 +592,7 @@ public async Task ReadPartitionTrackLastEnqueued() Debug.WriteLine($"Partition: { partitionEvent.Partition.PartitionId }"); Debug.WriteLine($"\tThe last sequence number is: { properties.SequenceNumber }"); - Debug.WriteLine($"\tThe last offset is: { properties.Offset }"); + Debug.WriteLine($"\tThe last offset is: { properties.OffsetString }"); Debug.WriteLine($"\tThe last enqueued time is: { properties.EnqueuedTime }, in UTC."); Debug.WriteLine($"\tThe information was updated at: { properties.LastReceivedTime }, in UTC."); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample11_MockingClientTypesLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample11_MockingClientTypesLiveTests.cs index 747da578b349..079fc42748d8 100644 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample11_MockingClientTypesLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Snippets/Sample11_MockingClientTypesLiveTests.cs @@ -88,7 +88,7 @@ public async Task MockingProducerProperties() isEmpty : true, beginningSequenceNumber: 1000, lastSequenceNumber : 1100, - lastOffset : 500, + lastOffsetString : "500:1:7863", lastEnqueuedTime : DateTime.UtcNow) }, // Empty partition @@ -98,7 +98,7 @@ public async Task MockingProducerProperties() isEmpty : false, beginningSequenceNumber : 2000, lastSequenceNumber : 2000, - lastOffset : 760, + lastOffsetString : "760:1:8800", lastEnqueuedTime : DateTime.UtcNow) } }; @@ -360,7 +360,7 @@ public async Task MockingConsumerClient() LastEnqueuedEventProperties lastEnqueueEventProperties = EventHubsModelFactory.LastEnqueuedEventProperties( lastSequenceNumber : 1234, - lastOffset : 234, + lastOffsetString : "234:1:954-2", lastEnqueuedTime : DateTimeOffset.Parse("1:24 AM"), lastReceivedTime : DateTimeOffset.Parse("1:26 AM")); @@ -386,7 +386,7 @@ async IAsyncEnumerable mockReturn() systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:44:59492", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); EventData eventData2 = EventHubsModelFactory.EventData( @@ -394,7 +394,7 @@ async IAsyncEnumerable mockReturn() systemProperties: new Dictionary(), //arbitrary value partitionKey: "sample-key", sequenceNumber: 1000, - offset: 1500, + offsetString: "1500:2:1111", enqueuedTime: DateTimeOffset.Parse("11:36 PM")); // This creates a mock PartitionEvent to return from the consumer client. @@ -480,7 +480,7 @@ public async Task PartitionReceiverMock() systemProperties: new Dictionary(), //arbitrary value partitionKey: $"sample-key-{index}", sequenceNumber: 1234, - offset: 234, + offsetString: "234:5:93928381.1", enqueuedTime: DateTimeOffset.Parse("9:25 AM")); receivedEvents.Add(eventData); diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/CHANGELOG.md b/sdk/eventhub/Azure.ResourceManager.EventHubs/CHANGELOG.md index 195f02c0dfad..cb0f55983a73 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/CHANGELOG.md +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/CHANGELOG.md @@ -112,8 +112,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -171,7 +171,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). #### Package Name diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/README.md b/sdk/eventhub/Azure.ResourceManager.EventHubs/README.md index 31ad21c68e20..28c014b6b894 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/README.md +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/README.md @@ -39,7 +39,7 @@ using Azure.Identity; ArmClient armClient = new ArmClient(new DefaultAzureCredential()); ``` -More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). +More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). ## Key concepts diff --git a/sdk/eventhub/Microsoft.Azure.EventHubs/README.md b/sdk/eventhub/Microsoft.Azure.EventHubs/README.md index a835a0038418..47653aa640b2 100755 --- a/sdk/eventhub/Microsoft.Azure.EventHubs/README.md +++ b/sdk/eventhub/Microsoft.Azure.EventHubs/README.md @@ -27,13 +27,13 @@ Use the client library for Event Hubs to: - Receive events from one or more publishers, transform them to better meet the needs of your ecosystem, then publish the transformed events to a new stream for consumers to observe. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Microsoft.Azure.EventHubs) | [Package (NuGet)](https://www.nuget.org/packages/Microsoft.Azure.EventHubs/) | [API reference documentation](https://docs.microsoft.com/dotnet/api/overview/azure/event-hubs?view=azure-dotnet) | [Product documentation](https://docs.microsoft.com/azure/event-hubs/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Microsoft.Azure.EventHubs) | [Package (NuGet)](https://www.nuget.org/packages/Microsoft.Azure.EventHubs/) | [API reference documentation](https://learn.microsoft.com/dotnet/api/overview/azure/event-hubs?view=azure-dotnet) | [Product documentation](https://learn.microsoft.com/azure/event-hubs/) ## Getting started The complete Microsoft Azure SDK can be downloaded from the [Microsoft Azure Downloads Page](https://azure.microsoft.com/downloads/?sdk=net) and ships with support for building deployment packages, integrating with tooling, rich command line tooling, and more. -If you are not already familiar with Azure Event Hubs, please review: [What is Event Hubs?](https://docs.microsoft.com/azure/event-hubs/event-hubs-about). +If you are not already familiar with Azure Event Hubs, please review: [What is Event Hubs?](https://learn.microsoft.com/azure/event-hubs/event-hubs-about). For the best development experience, developers should use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and hotfixes. @@ -48,7 +48,7 @@ For the best development experience, developers should use the official Microsof Code samples for the Azure Event Hubs client library that detail how to get started and how to implement common scenarios can be found in the following locations: - [Azure Code Samples](https://azure.microsoft.com/resources/samples/?sort=0&service=event-hubs&platform=dotnet) -- [Azure Event Hubs Documentation](https://docs.microsoft.com/azure/event-hubs/) +- [Azure Event Hubs Documentation](https://learn.microsoft.com/azure/event-hubs/) - [Azure Event Hubs Sample Repository](https://github.com/Azure/azure-event-hubs/tree/master/samples) - [Azure Event Hubs Notification Sample](https://github.com/Azure-Samples/event-hubs-dotnet-user-notifications) - [Azure Event Hubs Publishing Sample](https://github.com/Azure-Samples/event-hubs-dotnet-ingest) @@ -117,8 +117,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope ## Additional documentation -- [Azure Event Hubs General Documentation](https://docs.microsoft.com/azure/event-hubs/) -- [Azure Event Hubs REST API Reference](https://docs.microsoft.com/rest/api/eventhub/) -- [Azure Event Hubs SDK for .NET Documentation](https://docs.microsoft.com/dotnet/api/overview/azure/event-hubs?view=azure-dotnet) +- [Azure Event Hubs General Documentation](https://learn.microsoft.com/azure/event-hubs/) +- [Azure Event Hubs REST API Reference](https://learn.microsoft.com/rest/api/eventhub/) +- [Azure Event Hubs SDK for .NET Documentation](https://learn.microsoft.com/dotnet/api/overview/azure/event-hubs?view=azure-dotnet) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FMicrosoft.Azure.EventHubs%2FREADME.png) diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md index 2daeadd5166d..e214eb81954f 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/README.md @@ -16,15 +16,15 @@ dotnet add package Microsoft.Azure.WebJobs.Extensions.EventHubs - **Azure Subscription:** To use Azure services, including Azure Event Hubs, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- **Event Hubs namespace with an Event Hub:** To interact with Azure Event Hubs, you'll also need to have a namespace and Event Hub available. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [creating an Event Hub using the Azure portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-create). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create an Event Hub. +- **Event Hubs namespace with an Event Hub:** To interact with Azure Event Hubs, you'll also need to have a namespace and Event Hub available. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [creating an Event Hub using the Azure portal](https://learn.microsoft.com/azure/event-hubs/event-hubs-create). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create an Event Hub. -- **Azure Storage account with blob storage:** To persist checkpoints as blobs in Azure Storage, you'll need to have an Azure Storage account with blobs available. If you are not familiar with Azure Storage accounts, you may wish to follow the step-by-step guide for [creating a storage account using the Azure portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create storage accounts. +- **Azure Storage account with blob storage:** To persist checkpoints as blobs in Azure Storage, you'll need to have an Azure Storage account with blobs available. If you are not familiar with Azure Storage accounts, you may wish to follow the step-by-step guide for [creating a storage account using the Azure portal](https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). There, you can also find detailed instructions for using the Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates to create storage accounts. [![Deploy button](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-sdk-for-net%2Fmaster%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs.Processor%2Fassets%2Fsamples-azure-deploy.json) ### Authenticate the Client -For the Event Hubs client library to interact with an Event Hub, it will need to understand how to connect and authorize with it. The easiest means for doing so is to use a connection string, which is created automatically when creating an Event Hubs namespace. If you aren't familiar with using connection strings with Event Hubs, you may wish to follow the step-by-step guide to [get an Event Hubs connection string](https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string). +For the Event Hubs client library to interact with an Event Hub, it will need to understand how to connect and authorize with it. The easiest means for doing so is to use a connection string, which is created automatically when creating an Event Hubs namespace. If you aren't familiar with using connection strings with Event Hubs, you may wish to follow the step-by-step guide to [get an Event Hubs connection string](https://learn.microsoft.com/azure/event-hubs/event-hubs-get-connection-string). The `Connection` property of `EventHubAttribute` and `EventHubTriggerAttribute` is used to specify the configuration property that stores the connection string. @@ -41,11 +41,11 @@ For the local development use the `local.settings.json` file to store the connec } ``` -When deployed use the [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. +When deployed use the [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. #### Identity-based authentication -If your environment has [managed identity](https://docs.microsoft.com/azure/app-service/overview-managed-identity?tabs=dotnet) enabled you can use it to authenticate the Event Hubs extension. Before doing so, you will need to ensure that permissions have been configured as described in the [Azure Functions developer guide]( https://docs.microsoft.com/azure/azure-functions/functions-reference#grant-permission-to-the-identity). +If your environment has [managed identity](https://learn.microsoft.com/azure/app-service/overview-managed-identity?tabs=dotnet) enabled you can use it to authenticate the Event Hubs extension. Before doing so, you will need to ensure that permissions have been configured as described in the [Azure Functions developer guide]( https://learn.microsoft.com/azure/azure-functions/functions-reference#grant-permission-to-the-identity). To use identity-based authentication provide the `__fullyQualifiedNamespace` configuration setting. @@ -58,7 +58,7 @@ To use identity-based authentication provide the `__fullyQualif } ``` -Or in the case of deployed app set the same setting in [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings): +Or in the case of deployed app set the same setting in [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings): ``` __fullyQualifiedNamespace={event_hubs_namespace}.servicebus.windows.net @@ -72,13 +72,13 @@ More details about configuring an identity-based connection can be found [here]( The Event Hub Trigger allows a function to be executed when a message is sent to an Event Hub. -Please follow the [Azure Event Hubs trigger tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-event-hubs-trigger?tabs=csharp) to learn more about Event Hub triggers. +Please follow the [Azure Event Hubs trigger tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-event-hubs-trigger?tabs=csharp) to learn more about Event Hub triggers. ### Event Hub Output Binding The Event Hub Output Binding allows a function to send Event Hub events. -Please follow the [Azure Event Hubs output binding](https://docs.microsoft.com/azure/azure-functions/functions-bindings-event-hubs-output?tabs=csharp) to learn more about Event Hub bindings. +Please follow the [Azure Event Hubs output binding](https://learn.microsoft.com/azure/azure-functions/functions-bindings-event-hubs-output?tabs=csharp) to learn more about Event Hub bindings. ### Supported types @@ -197,11 +197,11 @@ public static void Run( ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -223,7 +223,7 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.EventHubs/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.EventHubs/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.EventHubs +[docs]: https://learn.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.EventHubs [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubListener.PartitionProcessor.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubListener.PartitionProcessor.cs index 5f22ee4831d6..d4fa786d0535 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubListener.PartitionProcessor.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubListener.PartitionProcessor.cs @@ -463,7 +463,7 @@ private static string GetOperationDetails(EventProcessorHostPartition context, s // leave the property name as lease for backcompat with T1 writer.WritePropertyName("lease"); writer.WriteStartObject(); - WritePropertyIfNotNull(writer, "offset", context.Checkpoint.Value.Offset.ToString(CultureInfo.InvariantCulture)); + WritePropertyIfNotNull(writer, "offset", context.Checkpoint.Value.Offset); WritePropertyIfNotNull(writer, "sequenceNumber", context.Checkpoint.Value.SequenceNumber.ToString(CultureInfo.InvariantCulture)); writer.WriteEndObject(); } @@ -471,7 +471,7 @@ private static string GetOperationDetails(EventProcessorHostPartition context, s // Log RuntimeInformation if EnableReceiverRuntimeMetric is enabled writer.WritePropertyName("runtimeInformation"); writer.WriteStartObject(); - WritePropertyIfNotNull(writer, "lastEnqueuedOffset", context.LastEnqueuedEventProperties.Offset?.ToString(CultureInfo.InvariantCulture)); + WritePropertyIfNotNull(writer, "lastEnqueuedOffset", context.LastEnqueuedEventProperties.OffsetString); WritePropertyIfNotNull(writer, "lastSequenceNumber", context.LastEnqueuedEventProperties.SequenceNumber?.ToString(CultureInfo.InvariantCulture)); WritePropertyIfNotNull(writer, "lastEnqueuedTimeUtc", context.LastEnqueuedEventProperties.EnqueuedTime?.ToString("o", CultureInfo.InvariantCulture)); writer.WriteEndObject(); diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj index a192b65d8a04..539e414cb53f 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Microsoft.Azure.WebJobs.Extensions.EventHubs.csproj @@ -12,7 +12,9 @@ - + + + @@ -22,6 +24,7 @@ + diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/CheckpointInfo.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/CheckpointInfo.cs index e1854f2609f1..2558c84f3149 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/CheckpointInfo.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/CheckpointInfo.cs @@ -7,11 +7,11 @@ namespace Microsoft.Azure.WebJobs.EventHubs.Processor { internal struct CheckpointInfo { - public long Offset { get; } + public string Offset { get; } public long SequenceNumber { get; } public DateTimeOffset? LastModified { get; } - public CheckpointInfo(long offset, long sequenceNumber, DateTimeOffset? lastModified) + public CheckpointInfo(string offset, long sequenceNumber, DateTimeOffset? lastModified) { Offset = offset; SequenceNumber = sequenceNumber; diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHost.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHost.cs index ea2ee5e3cfac..339f2e156448 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHost.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHost.cs @@ -66,7 +66,7 @@ protected override async Task GetCheckpointAsync(strin if (checkpoint is BlobCheckpointStoreInternal.BlobStorageCheckpoint blobCheckpoint && blobCheckpoint is not null) { - _lastReadCheckpoint[partitionId] = new CheckpointInfo(blobCheckpoint.Offset ?? -1, blobCheckpoint.SequenceNumber ?? -1, + _lastReadCheckpoint[partitionId] = new CheckpointInfo(blobCheckpoint.Offset, blobCheckpoint.SequenceNumber ?? -1, blobCheckpoint.LastModified); } diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHostPartition.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHostPartition.cs index 2487fa852d1c..5a128fc2cca5 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHostPartition.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Processor/EventProcessorHostPartition.cs @@ -62,7 +62,7 @@ public LastEnqueuedEventProperties LastEnqueuedEventProperties public async Task CheckpointAsync(EventData checkpointEvent) { await ProcessorHost.CheckpointAsync(PartitionId, checkpointEvent).ConfigureAwait(false); - Checkpoint = new CheckpointInfo(checkpointEvent.Offset, checkpointEvent.SequenceNumber, DateTimeOffset.UtcNow); + Checkpoint = new CheckpointInfo(checkpointEvent.OffsetString, checkpointEvent.SequenceNumber, DateTimeOffset.UtcNow); } private class EventProcessorHostPartitionContext : TriggerPartitionContext diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerBindingStrategy.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerBindingStrategy.cs index c6c1d17dd9ca..d91f39de57c7 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerBindingStrategy.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerBindingStrategy.cs @@ -114,7 +114,7 @@ internal static void AddBindingData(Dictionary bindingData, Even for (int i = 0; i < events.Length; i++) { partitionKeys[i] = events[i].PartitionKey; - offsets[i] = events[i].Offset.ToString(CultureInfo.InvariantCulture); + offsets[i] = events[i].OffsetString; sequenceNumbers[i] = events[i].SequenceNumber; enqueuedTimesUtc[i] = events[i].EnqueuedTime.DateTime; properties[i] = events[i].Properties; @@ -125,7 +125,7 @@ internal static void AddBindingData(Dictionary bindingData, Even private static void AddBindingData(Dictionary bindingData, EventData eventData) { SafeAddValue(() => bindingData.Add("PartitionKey", eventData.PartitionKey)); - SafeAddValue(() => bindingData.Add("Offset", eventData.Offset)); + SafeAddValue(() => bindingData.Add("Offset", eventData.OffsetString)); SafeAddValue(() => bindingData.Add("SequenceNumber", eventData.SequenceNumber)); SafeAddValue(() => bindingData.Add("EnqueuedTimeUtc", eventData.EnqueuedTime.DateTime)); SafeAddValue(() => bindingData.Add("Properties", eventData.Properties)); @@ -155,7 +155,7 @@ private static IDictionary GetSystemPropertiesForBinding(EventDa // Following is needed to maintain structure of bindingdata: https://github.com/Azure/azure-webjobs-sdk/pull/1849 modifiedDictionary["SequenceNumber"] = eventData.SequenceNumber; - modifiedDictionary["Offset"] = eventData.Offset; + modifiedDictionary["Offset"] = eventData.OffsetString; modifiedDictionary["PartitionKey"] = eventData.PartitionKey; modifiedDictionary["EnqueuedTimeUtc"] = eventData.EnqueuedTime.DateTime; return modifiedDictionary; diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerInput.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerInput.cs index 5400435d0c5e..576f8b4abcbc 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerInput.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Triggers/EventHubTriggerInput.cs @@ -67,7 +67,7 @@ public Dictionary GetTriggerDetails(EventProcessorPartition cont string offset, enqueueTimeUtc, sequenceNumber; if (IsSingleDispatch) { - offset = Events[0].Offset.ToString(CultureInfo.InvariantCulture); + offset = Events[0].OffsetString; enqueueTimeUtc = Events[0].EnqueuedTime.ToString("o", CultureInfo.InvariantCulture); sequenceNumber = Events[0].SequenceNumber.ToString(CultureInfo.InvariantCulture); } @@ -76,7 +76,7 @@ public Dictionary GetTriggerDetails(EventProcessorPartition cont EventData first = Events[0]; EventData last = Events[Events.Length - 1]; - offset = $"{first.Offset}-{last.Offset}"; + offset = $"{first.OffsetString}-{last.OffsetString}"; enqueueTimeUtc = $"{first.EnqueuedTime.ToString("o", CultureInfo.InvariantCulture)}-{last.EnqueuedTime.ToString("o", CultureInfo.InvariantCulture)}"; sequenceNumber = $"{first.SequenceNumber}-{last.SequenceNumber}"; } diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubEndToEndTests.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubEndToEndTests.cs index ad193b8cf841..2414e2d15397 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubEndToEndTests.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubEndToEndTests.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +// Ignore Spelling: Poco evt + using System; using System.Collections.Generic; using System.Linq; @@ -925,7 +927,7 @@ await checkpointStore.UpdateCheckpointAsync( EventHubConsumerClient.DefaultConsumerGroupName, partition, producer.Identifier, - new CheckpointPosition(-1), + new CheckpointPosition("-1", -1), CancellationToken.None); } } diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubListenerTests.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubListenerTests.cs index 2b7b44bd3fd0..a94cbe6e534a 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubListenerTests.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubListenerTests.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +// Ignore Spelling: Checkpointing Rebalancing + using System; using System.Collections.Generic; using System.Linq; @@ -186,7 +188,7 @@ public async Task ProcessEvents_MultipleDispatch_MinBatch_CheckpointsCorrectly_R var processor = new Mock(MockBehavior.Strict); processor.Setup(p => p.CheckpointAsync(partitionContext.PartitionId, It.IsAny(), It.IsAny())).Returns(Task.CompletedTask); - processor.Setup(p => p.GetLastReadCheckpoint(partitionContext.PartitionId)).Returns(() => new CheckpointInfo(123, 45678, DateTimeOffset.UtcNow.Subtract(TimeSpan.FromSeconds(1)))); + processor.Setup(p => p.GetLastReadCheckpoint(partitionContext.PartitionId)).Returns(() => new CheckpointInfo("123:1:11", 45678, DateTimeOffset.UtcNow.Subtract(TimeSpan.FromSeconds(1)))); partitionContext.ProcessorHost = processor.Object; var loggerMock = new Mock(); @@ -240,7 +242,7 @@ public async Task ProcessEvents_MultipleDispatch_MinBatch_CheckpointsCorrectly_O var processor = new Mock(MockBehavior.Strict); processor.Setup(p => p.CheckpointAsync(partitionContext.PartitionId, It.IsAny(), It.IsAny())).Returns(Task.CompletedTask); - processor.Setup(p => p.GetLastReadCheckpoint(partitionContext.PartitionId)).Returns(() => new CheckpointInfo(123, 45678, DateTimeOffset.UtcNow.Subtract(TimeSpan.FromHours(1)))); + processor.Setup(p => p.GetLastReadCheckpoint(partitionContext.PartitionId)).Returns(() => new CheckpointInfo("123", 45678, DateTimeOffset.UtcNow.Subtract(TimeSpan.FromHours(1)))); partitionContext.ProcessorHost = processor.Object; var loggerMock = new Mock(); @@ -292,7 +294,7 @@ public async Task ProcessEvents_MultipleDispatch_MinBatch_BackgroundInvokesParti var processor = new Mock(MockBehavior.Strict); processor.Setup(p => p.CheckpointAsync(partitionContext.PartitionId, It.IsAny(), It.IsAny())).Returns(Task.CompletedTask); - processor.Setup(p => p.GetLastReadCheckpoint(partitionContext.PartitionId)).Returns(() => new CheckpointInfo(123, 45678, DateTimeOffset.UtcNow.Subtract(TimeSpan.FromHours(1)))); + processor.Setup(p => p.GetLastReadCheckpoint(partitionContext.PartitionId)).Returns(() => new CheckpointInfo("123", 45678, DateTimeOffset.UtcNow.Subtract(TimeSpan.FromHours(1)))); partitionContext.ProcessorHost = processor.Object; // Because the first invocation will allow a partial batch due to the old checkpoint, diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubTests.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubTests.cs index b41229d68464..9dd2cb29949e 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubTests.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubTests.cs @@ -84,7 +84,7 @@ public void GetBindingData_SingleDispatch_ReturnsExpectedValue() Assert.AreSame(input.ProcessorPartition.PartitionContext, bindingData["TriggerPartitionContext"]); Assert.AreSame(input.ProcessorPartition.PartitionContext, bindingData["PartitionContext"]); Assert.AreEqual(evt.PartitionKey, bindingData["PartitionKey"]); - Assert.AreEqual(evt.Offset, bindingData["Offset"]); + Assert.AreEqual(evt.OffsetString, bindingData["Offset"]); Assert.AreEqual(evt.SequenceNumber, bindingData["SequenceNumber"]); Assert.AreEqual(evt.EnqueuedTime.DateTime, bindingData["EnqueuedTimeUtc"]); Assert.AreSame(evt.Properties, bindingData["Properties"]); @@ -99,7 +99,7 @@ public void GetBindingData_SingleDispatch_ReturnsExpectedValue() } private static EventData GetSystemProperties(byte[] body, string partitionKey = "TestKey") => - EventHubsModelFactory.EventData(new BinaryData(body), partitionKey: partitionKey, offset: 140, enqueuedTime: DateTimeOffset.MinValue, sequenceNumber: 4294967296, systemProperties: new Dictionary() + EventHubsModelFactory.EventData(new BinaryData(body), partitionKey: partitionKey, offsetString: "140:1:12", enqueuedTime: DateTimeOffset.MinValue, sequenceNumber: 4294967296, systemProperties: new Dictionary() { {"iothub-connection-device-id", "testDeviceId"}, {"iothub-enqueuedtime", DateTime.MinValue} diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubsMetricsProviderTests.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubsMetricsProviderTests.cs index 80e6803b7e04..a8ebba897d8a 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubsMetricsProviderTests.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubsMetricsProviderTests.cs @@ -72,7 +72,7 @@ public async Task CreateTriggerMetrics_ReturnsExpectedResult() this._checkpoints = new EventProcessorCheckpoint[] { - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 0 } + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 0 } }; var metrics = await _metricsProvider.GetMetricsAsync(); @@ -108,7 +108,7 @@ public async Task CreateTriggerMetrics_ReturnsExpectedResult() // Checkpointing is ahead of partition info and invalid (SequenceNumber > LastEnqueued) this._checkpoints = new EventProcessorCheckpoint[] { - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 999, SequenceNumber = 11 } + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "999", SequenceNumber = 11 } }; _partitions = new List @@ -129,9 +129,9 @@ public async Task CreateTriggerMetrics_MultiplePartitions_ReturnsExpectedResult( // No messages processed, no messages in queue this._checkpoints = new EventProcessorCheckpoint[] { - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 0, PartitionId = "1" }, - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 0, PartitionId = "2" }, - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 0, PartitionId = "3" } + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 0, PartitionId = "1" }, + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 0, PartitionId = "2" }, + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 0, PartitionId = "3" } }; _partitions = new List @@ -150,9 +150,9 @@ public async Task CreateTriggerMetrics_MultiplePartitions_ReturnsExpectedResult( // Messages processed, Messages in queue this._checkpoints = new EventProcessorCheckpoint[] { - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 2, PartitionId = "1" }, - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 3, PartitionId = "2" }, - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 4, PartitionId = "3" } + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 2, PartitionId = "1" }, + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 3, PartitionId = "2" }, + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 4, PartitionId = "3" } }; _partitions = new List @@ -171,9 +171,9 @@ public async Task CreateTriggerMetrics_MultiplePartitions_ReturnsExpectedResult( // One invalid sample this._checkpoints = new EventProcessorCheckpoint[] { - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 2, PartitionId = "1" }, - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 3, PartitionId = "2" }, - new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = 0, SequenceNumber = 4, PartitionId = "3" } + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 2, PartitionId = "1" }, + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 3, PartitionId = "2" }, + new BlobCheckpointStoreInternal.BlobStorageCheckpoint { Offset = "0", SequenceNumber = 4, PartitionId = "3" } }; _partitions = new List @@ -245,7 +245,7 @@ public async Task CreateTriggerMetrics_DifferentCheckpointFormats_ReturnsExpecte long checkpointSequenceNumber, long partitionBeginningSequenceNumber, long partitionLastSequenceNumber, - long expectedUprocessedMessageCount) + long expectedUnprocessedMessageCount) { if (!isNullCheckpoint) { @@ -265,7 +265,7 @@ public async Task CreateTriggerMetrics_DifferentCheckpointFormats_ReturnsExpecte }; var metrics = await _metricsProvider.GetMetricsAsync(); - Assert.AreEqual(expectedUprocessedMessageCount, metrics.EventCount); + Assert.AreEqual(expectedUnprocessedMessageCount, metrics.EventCount); } } } diff --git a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/TestPartitionProperties.cs b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/TestPartitionProperties.cs index be5fb9527b82..b3952349a74e 100644 --- a/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/TestPartitionProperties.cs +++ b/sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/TestPartitionProperties.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.WebJobs.EventHubs.UnitTests { public class TestPartitionProperties : PartitionProperties { - public TestPartitionProperties(string eventHubName = default, string partitionId = default, bool isEmpty = default, long beginningSequenceNumber = default, long lastSequenceNumber = default, long lastOffset = default, DateTimeOffset lastEnqueuedTime = default) : base(eventHubName, partitionId, isEmpty, beginningSequenceNumber, lastSequenceNumber, lastOffset, lastEnqueuedTime) + public TestPartitionProperties(string eventHubName = default, string partitionId = default, bool isEmpty = default, long beginningSequenceNumber = default, long lastSequenceNumber = default, string lastOffset = default, DateTimeOffset lastEnqueuedTime = default) : base(eventHubName, partitionId, isEmpty, beginningSequenceNumber, lastSequenceNumber, lastOffset, lastEnqueuedTime) { } } diff --git a/sdk/eventhub/README.md b/sdk/eventhub/README.md index fd68f6544c16..22603536d418 100644 --- a/sdk/eventhub/README.md +++ b/sdk/eventhub/README.md @@ -1,6 +1,6 @@ # Azure Event Hubs libraries for .NET -Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. Once Event Hubs has collected the data, you can retrieve, transform, and store it by using any real-time analytics provider or with batching/storage adapters. If you would like to know more about Azure Event Hubs, you may wish to review: [What is Event Hubs](https://docs.microsoft.com/azure/event-hubs/event-hubs-about). +Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. Once Event Hubs has collected the data, you can retrieve, transform, and store it by using any real-time analytics provider or with batching/storage adapters. If you would like to know more about Azure Event Hubs, you may wish to review: [What is Event Hubs](https://learn.microsoft.com/azure/event-hubs/event-hubs-about). ## Libraries for data access @@ -14,8 +14,8 @@ Use the following packages to publish and consume events from Event Hubs: | Nuget Package | Reference | Samples | |--------------------------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------| -| [Azure.Messaging.EventHubs](https://www.nuget.org/packages/Azure.Messaging.EventHubs) | [API Reference for Azure.Messaging.EventHubs](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs?view=azure-dotnet) | [Samples for Azure.Messaging.EventHubs](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples) | -| [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) | [API Reference for Azure.Messaging.EventHubs.Processor](https://docs.microsoft.com/dotnet/api/azure.messaging.eventhubs?view=azure-dotnet) | [Samples for Azure.Messaging.EventHubs.Processor](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) | +| [Azure.Messaging.EventHubs](https://www.nuget.org/packages/Azure.Messaging.EventHubs) | [API Reference for Azure.Messaging.EventHubs](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs?view=azure-dotnet) | [Samples for Azure.Messaging.EventHubs](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs/samples) | +| [Azure.Messaging.EventHubs.Processor](https://www.nuget.org/packages/Azure.Messaging.EventHubs.Processor) | [API Reference for Azure.Messaging.EventHubs.Processor](https://learn.microsoft.com/dotnet/api/azure.messaging.eventhubs?view=azure-dotnet) | [Samples for Azure.Messaging.EventHubs.Processor](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventhub/Azure.Messaging.EventHubs.Processor/samples) | ### `Microsoft.Azure.EventHubs` @@ -26,7 +26,7 @@ Use the following legacy packages to publish and consume events from Event Hubs: | Nuget Package | Reference | Samples | |--------------------------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------| | [Microsoft.Azure.EventHubs](https://www.nuget.org/packages/Microsoft.Azure.EventHubs) | [API Reference for Microsoft.Azure.EventHubs](https://learn.microsoft.com/dotnet/api/microsoft.azure.eventhubs?view=azure-dotnet-legacy) | [Samples for Azure.Messaging.EventHubs](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/) | -| [Microsoft.Azure.EventHubs.Processor](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.Processor) | [API Reference for Microsoft.Azure.EventHubs.Processor](https://docs.microsoft.com/dotnet/api/microsoft.azure.eventhubs.processor?view=azure-dotnet) | [Samples for Azure.Messaging.EventHubs.Processor](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/) | +| [Microsoft.Azure.EventHubs.Processor](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.Processor) | [API Reference for Microsoft.Azure.EventHubs.Processor](https://learn.microsoft.com/dotnet/api/microsoft.azure.eventhubs.processor?view=azure-dotnet) | [Samples for Azure.Messaging.EventHubs.Processor](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/) | ## Libraries for resource management diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/CHANGELOG.md b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/CHANGELOG.md index e3c9e323d435..2ffb0866fa41 100644 --- a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/CHANGELOG.md +++ b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/CHANGELOG.md @@ -80,4 +80,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/README.md b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/README.md index 2c2e605ae846..f7768a88179c 100644 --- a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/README.md +++ b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md index 9651e6f42d21..4dad0a2be28f 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/README.md @@ -28,7 +28,7 @@ az keyvault secret set --vault-name MyVault --name MySecret --value "hVFkk965BuU #### Azure role-based access control -When using [azure role-based access control](https://docs.microsoft.com/azure/key-vault/general/rbac-guide), the identity you are authenticating has to have the "Key Vault Reader" and "Key Vault Secrets User" roles. +When using [azure role-based access control](https://learn.microsoft.com/azure/key-vault/general/rbac-guide), the identity you are authenticating has to have the "Key Vault Reader" and "Key Vault Secrets User" roles. The "Key Vault Reader" role allows the extension to list secrets while the "Key Vault Secrets User" allows retrieving their values. ```powershell @@ -87,18 +87,18 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Azure.Extensions.AspNetCore.Configuration.Secrets/src [package]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.Configuration.Secrets/ -[docs]: https://docs.microsoft.com/dotnet/api/Azure.Extensions.AspNetCore.Configuration.Secrets +[docs]: https://learn.microsoft.com/dotnet/api/Azure.Extensions.AspNetCore.Configuration.Secrets [nuget]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.Configuration.Secrets -[keyvault_create_cli]: https://docs.microsoft.com/azure/key-vault/quick-create-cli#create-a-key-vault -[keyvault_create_portal]: https://docs.microsoft.com/azure/key-vault/quick-create-portal#create-a-vault -[keyvault_create_ps]: https://docs.microsoft.com/azure/key-vault/quick-create-powershell#create-a-key-vault -[azure_cli]: https://docs.microsoft.com/cli/azure +[keyvault_create_cli]: https://learn.microsoft.com/azure/key-vault/quick-create-cli#create-a-key-vault +[keyvault_create_portal]: https://learn.microsoft.com/azure/key-vault/quick-create-portal#create-a-vault +[keyvault_create_ps]: https://learn.microsoft.com/azure/key-vault/quick-create-powershell#create-a-key-vault +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[aspnetcore_configuration_doc]: https://docs.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1 -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[aspnetcore_configuration_doc]: https://learn.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1 +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com -[keyvault_doc]: https://docs.microsoft.com/azure/key-vault/general/overview +[keyvault_doc]: https://learn.microsoft.com/azure/key-vault/general/overview diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md index e32c5c93e17c..329e9995db07 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/README.md @@ -96,17 +96,17 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src [package]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs/ -[docs]: https://docs.microsoft.com/dotnet/api/Azure.Extensions.AspNetCore.DataProtection.Blobs +[docs]: https://learn.microsoft.com/dotnet/api/Azure.Extensions.AspNetCore.DataProtection.Blobs [nuget]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Blobs -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[storage_container_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-introduction#containers -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_container_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction#containers +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[aspnetcore_dataprotection_doc]: https://docs.microsoft.com/aspnet/core/security/data-protection/introduction +[aspnetcore_dataprotection_doc]: https://learn.microsoft.com/aspnet/core/security/data-protection/introduction [samples]: samples/ [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md index 8181ffa07859..1d08b03ecae5 100644 --- a/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md +++ b/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/README.md @@ -81,18 +81,18 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Keys/src [package]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys/ -[docs]: https://docs.microsoft.com/dotnet/api/Azure.Extensions.AspNetCore.DataProtection.Keys +[docs]: https://learn.microsoft.com/dotnet/api/Azure.Extensions.AspNetCore.DataProtection.Keys [nuget]: https://www.nuget.org/packages/Azure.Extensions.AspNetCore.DataProtection.Keys -[keyvault_doc]: https://docs.microsoft.com/azure/key-vault/general/overview -[keyvault_create_cli]: https://docs.microsoft.com/azure/key-vault/quick-create-cli#create-a-key-vault -[keyvault_create_portal]: https://docs.microsoft.com/azure/key-vault/quick-create-portal#create-a-vault -[keyvault_create_ps]: https://docs.microsoft.com/azure/key-vault/quick-create-powershell#create-a-key-vault -[azure_cli]: https://docs.microsoft.com/cli/azure +[keyvault_doc]: https://learn.microsoft.com/azure/key-vault/general/overview +[keyvault_create_cli]: https://learn.microsoft.com/azure/key-vault/quick-create-cli#create-a-key-vault +[keyvault_create_portal]: https://learn.microsoft.com/azure/key-vault/quick-create-portal#create-a-vault +[keyvault_create_ps]: https://learn.microsoft.com/azure/key-vault/quick-create-powershell#create-a-key-vault +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[aspnetcore_dataprotection_doc]: https://docs.microsoft.com/aspnet/core/security/data-protection/introduction?view=aspnetcore-3.1 +[aspnetcore_dataprotection_doc]: https://learn.microsoft.com/aspnet/core/security/data-protection/introduction?view=aspnetcore-3.1 [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes [samples]: samples/ [storage_contrib]: ../CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md b/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md index 270e4cc9753e..499b3c329584 100644 --- a/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md +++ b/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md @@ -73,5 +73,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source_root]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/ [nuget]: https://www.nuget.org/ [package]: https://www.nuget.org/packages/Microsoft.Extensions.Azure/ -[azure_function_settings]: https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings -[aspnet_core_env_vars]: https://docs.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1#environment-variables \ No newline at end of file +[azure_function_settings]: https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings +[aspnet_core_env_vars]: https://learn.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1#environment-variables \ No newline at end of file diff --git a/sdk/extensions/Microsoft.Extensions.Azure/README.md b/sdk/extensions/Microsoft.Extensions.Azure/README.md index e39a6dc11f67..4f230ac8e913 100644 --- a/sdk/extensions/Microsoft.Extensions.Azure/README.md +++ b/sdk/extensions/Microsoft.Extensions.Azure/README.md @@ -146,7 +146,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source_root]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Microsoft.Extensions.Azure/src [nuget]: https://www.nuget.org/ [package]: https://www.nuget.org/packages/Microsoft.Extensions.Azure/ -[configuration]: https://docs.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.0 -[dependency_injection]: https://docs.microsoft.com/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.0 +[configuration]: https://learn.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.0 +[dependency_injection]: https://learn.microsoft.com/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.0 [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/CHANGELOG.md b/sdk/fabric/Azure.ResourceManager.Fabric/CHANGELOG.md index 1bd7668ebbf7..5f8722e5c6bd 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/CHANGELOG.md +++ b/sdk/fabric/Azure.ResourceManager.Fabric/CHANGELOG.md @@ -32,4 +32,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/README.md b/sdk/fabric/Azure.ResourceManager.Fabric/README.md index b426f9e25b5c..6151703574eb 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/README.md +++ b/sdk/fabric/Azure.ResourceManager.Fabric/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml b/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml index 9df4256e1877..8f804a6ba37f 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml +++ b/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/fabric/Microsoft.Fabric.Management -commit: 0410d404c68289cb1737d06bba92133bb84b515c +commit: 7e22a66617633d162735fe65388c2852127b4aac repo: Azure/azure-rest-api-specs diff --git a/sdk/face/Azure.AI.Vision.Face/README.md b/sdk/face/Azure.AI.Vision.Face/README.md index aa672c377782..ac1dead04aa6 100644 --- a/sdk/face/Azure.AI.Vision.Face/README.md +++ b/sdk/face/Azure.AI.Vision.Face/README.md @@ -383,9 +383,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [get_endpoint_via_azure_cli]: https://learn.microsoft.com/azure/ai-services/multi-service-resource?tabs=windows&pivots=azcli#get-the-keys-for-your-resource [azure_sdk_net_azure_key_credential]: https://learn.microsoft.com/dotnet/api/azure.azurekeycredential?view=azure-dotnet [azure_sdk_net_identity]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [azure_sdk_net_default_azure_credential]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [face_sample_detection]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/face/Azure.AI.Vision.Face/samples/Sample1_FaceDetection.md [liveness_tutorial]: https://learn.microsoft.com/azure/ai-services/computer-vision/tutorials/liveness diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md index f2728211a959..2aa6746d4891 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md @@ -68,4 +68,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/README.md b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/README.md index 80a5ab283294..495385c3cd0a 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/README.md +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/CHANGELOG.md b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/CHANGELOG.md index f50ae2d921b5..29e166700df8 100644 --- a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/CHANGELOG.md +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/CHANGELOG.md @@ -76,4 +76,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/README.md b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/README.md index f3e142eb8adb..0d108acdaebd 100644 --- a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/README.md +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/MigrationGuide.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/MigrationGuide.md index b1ba2153438c..6964a6f35149 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/MigrationGuide.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/MigrationGuide.md @@ -589,10 +589,10 @@ Train a custom model with `3.1.x`: // managed identity configured. // // For instructions to set up forms for training in an Azure Blob Storage Container, please see: -// https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data +// https://learn.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data // For instructions to create a label file for your training forms, please see: -// https://docs.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 +// https://learn.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 Uri trainingFileUri = new Uri(""); string modelName = "My Model with labels"; diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md index dcb08c1aa756..fcfa47ba4ed8 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/README.md @@ -848,7 +848,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [formreco_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/src -[formreco_docs]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/ +[formreco_docs]: https://learn.microsoft.com/azure/cognitive-services/form-recognizer/ [formreco_refdocs]: https://aka.ms/azsdk/net/docs/ref/formrecognizer [formreco_nuget_package]: https://www.nuget.org/packages/Azure.AI.FormRecognizer [formreco_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/README.md @@ -859,20 +859,20 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [formreco_errors]: https://aka.ms/azsdk/formrecognizer/errors [formreco_build_model]: https://aka.ms/azsdk/formrecognizer/buildmodel [migration_guide]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/MigrationGuide.md -[cognitive_resource]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account +[cognitive_resource]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [doc_analysis_client_class]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/src/DocumentAnalysisClient.cs [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[aad_grant_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[aad_grant_access]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[cognitive_resource_portal]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account -[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli -[regional_endpoints]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains#is-there-a-list-of-regional-endpoints -[azure_cli_endpoint_lookup]: https://docs.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show -[azure_portal_get_endpoint]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows#get-the-keys-for-your-resource +[cognitive_resource_portal]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account +[cognitive_resource_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[regional_endpoints]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains#is-there-a-list-of-regional-endpoints +[azure_cli_endpoint_lookup]: https://learn.microsoft.com/cli/azure/cognitiveservices/account?view=azure-cli-latest#az-cognitiveservices-account-show +[azure_portal_get_endpoint]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows#get-the-keys-for-your-resource [fr_studio]: https://aka.ms/azsdk/formrecognizer/formrecognizerstudio @@ -895,7 +895,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [get_and_list]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_GetAndListOperations.md [mock_client]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_MockClient.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ [azure_portal]: https://portal.azure.com diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample5_TrainModel.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample5_TrainModel.md index 9f3c86cc54da..aa1a9de678a0 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample5_TrainModel.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample5_TrainModel.md @@ -30,7 +30,7 @@ Train custom models to recognize all fields and values found in your custom form // managed identity configured. // // For instructions on setting up forms for training in an Azure Blob Storage Container, see -// https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data +// https://learn.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data Uri trainingFileUri = new Uri(""); FormTrainingClient client = new FormTrainingClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); @@ -73,10 +73,10 @@ Train custom models to recognize specific fields and values you specify by label // managed identity configured. // // For instructions to set up forms for training in an Azure Blob Storage Container, please see: -// https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data +// https://learn.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data // For instructions to create a label file for your training forms, please see: -// https://docs.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 +// https://learn.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 Uri trainingFileUri = new Uri(""); string modelName = "My Model with labels"; @@ -110,4 +110,4 @@ foreach (CustomFormSubmodel submodel in model.Submodels) ``` [README]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer#getting-started -[labeling_tool]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 +[labeling_tool]: https://learn.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample8_ModelCompose.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample8_ModelCompose.md index bb4abc6d9306..235206c0d731 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample8_ModelCompose.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/V3.1/Sample8_ModelCompose.md @@ -33,7 +33,7 @@ In our case, we will be writing an application that collects the expenses a comp // For this sample, you can use the training forms found in the `trainingFiles` folder. // Upload the forms to your storage container and then generate a container SAS URL. // For instructions on setting up forms for training in an Azure Storage Blob Container, see -// https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data +// https://learn.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data bool useLabels = true; @@ -145,4 +145,4 @@ foreach (CustomFormSubmodel model in purchaseOrderModel.Submodels) ``` [README]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer#getting-started -[labeling_tool]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 +[labeling_tool]: https://learn.microsoft.com/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1 diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/CHANGELOG.md b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/CHANGELOG.md index 8244f7390c21..41a4030d97b6 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/CHANGELOG.md +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/CHANGELOG.md @@ -67,7 +67,7 @@ Polishing since last public beta release: - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `Uri` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -100,4 +100,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/README.md b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/README.md index 99bd43cf03a6..eb865aa415f4 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/README.md +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/CHANGELOG.md b/sdk/grafana/Azure.ResourceManager.Grafana/CHANGELOG.md index 98e91a7dee5b..5f7789fec6a5 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/CHANGELOG.md +++ b/sdk/grafana/Azure.ResourceManager.Grafana/CHANGELOG.md @@ -66,8 +66,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -101,4 +101,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/README.md b/sdk/grafana/Azure.ResourceManager.Grafana/README.md index 0235794eb0a0..5756785cffa6 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/README.md +++ b/sdk/grafana/Azure.ResourceManager.Grafana/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/CHANGELOG.md b/sdk/graphservices/Azure.ResourceManager.GraphServices/CHANGELOG.md index 4f1759ad4bb4..1338aaf9149b 100644 --- a/sdk/graphservices/Azure.ResourceManager.GraphServices/CHANGELOG.md +++ b/sdk/graphservices/Azure.ResourceManager.GraphServices/CHANGELOG.md @@ -51,4 +51,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/README.md b/sdk/graphservices/Azure.ResourceManager.GraphServices/README.md index 05dd7ad365b7..2a97c29e2171 100644 --- a/sdk/graphservices/Azure.ResourceManager.GraphServices/README.md +++ b/sdk/graphservices/Azure.ResourceManager.GraphServices/README.md @@ -42,7 +42,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/CHANGELOG.md b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/CHANGELOG.md index 29a3af916476..fe95e8745363 100644 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/CHANGELOG.md +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/CHANGELOG.md @@ -107,4 +107,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/README.md b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/README.md index 4f4e0a502092..36a40f7b46de 100644 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/README.md +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/CHANGELOG.md b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/CHANGELOG.md index 4f55eaf66211..1ccc7e6c5abf 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/CHANGELOG.md +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/CHANGELOG.md @@ -52,4 +52,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/README.md b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/README.md index bd3f38b75cca..016cfebcf79c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/README.md +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/CHANGELOG.md b/sdk/hdinsight/Azure.ResourceManager.HDInsight/CHANGELOG.md index 9e46f3edd3ca..8271596dc352 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight/CHANGELOG.md +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/CHANGELOG.md @@ -101,8 +101,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -133,4 +133,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/README.md b/sdk/hdinsight/Azure.ResourceManager.HDInsight/README.md index 893d9f8c3e64..a61a343c4757 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight/README.md +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/CHANGELOG.md b/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/CHANGELOG.md index fd50f75c0eca..077678947fad 100644 --- a/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/CHANGELOG.md +++ b/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/CHANGELOG.md @@ -72,4 +72,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/README.md b/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/README.md index fee1b508ae4c..42b1891b4944 100644 --- a/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/README.md +++ b/sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/CHANGELOG.md b/sdk/healthbot/Azure.ResourceManager.HealthBot/CHANGELOG.md index 801f244b2a03..9c2c22977c7f 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/CHANGELOG.md +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/CHANGELOG.md @@ -78,4 +78,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/README.md b/sdk/healthbot/Azure.ResourceManager.HealthBot/README.md index 7915d1dedce3..ae2283b00521 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/README.md +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/CHANGELOG.md b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/CHANGELOG.md index f23ed1292d03..a7701322ef99 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/CHANGELOG.md +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/CHANGELOG.md @@ -93,4 +93,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/README.md b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/README.md index d5945cb9f449..a3c3fb3f14eb 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/README.md +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md b/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md index 6151625fd2d2..2fb2665db06f 100644 --- a/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md +++ b/sdk/healthdataaiservices/Azure.Health.Deidentification/README.md @@ -5,7 +5,7 @@ Azure.Health.Deidentification is a managed service that enables users to tag, re -[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/healthdataaiservices/Azure.Health.Deidentification/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) | [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthdataaiservices/Azure.Health.Deidentification/samples) +[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/healthdataaiservices/Azure.Health.Deidentification/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://learn.microsoft.com/azure) | [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthdataaiservices/Azure.Health.Deidentification/samples) ## Getting started @@ -117,7 +117,7 @@ additional questions or comments. [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.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/healthdataaiservices/Azure.Health.Deidentification/README.png) diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/CHANGELOG.md b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/CHANGELOG.md index 9bf7cf7829f8..4b20b6677857 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/CHANGELOG.md +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/CHANGELOG.md @@ -30,4 +30,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/README.md b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/README.md index f581ea7131e4..e2c93007ba56 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/README.md +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/healthdataaiservices/test-resources.bicep b/sdk/healthdataaiservices/test-resources.bicep index a4cccabd07c3..e136fec35ca6 100644 --- a/sdk/healthdataaiservices/test-resources.bicep +++ b/sdk/healthdataaiservices/test-resources.bicep @@ -37,6 +37,28 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-05-01' = { kind: 'StorageV2' properties: { minimumTlsVersion: 'TLS1_2' + + accessTier: 'Hot' + supportsHttpsTrafficOnly: true + allowBlobPublicAccess: false + allowCrossTenantReplication: false + allowSharedKeyAccess: false + + encryption: { + services: { + blob: { + enabled: true + keyType: 'Account' + } + file: { + enabled: true + keyType: 'Account' + } + } + requireInfrastructureEncryption: true + keySource: 'Microsoft.Storage' + } + networkAcls: { bypass: 'AzureServices' defaultAction: 'Deny' diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md index bf9ab4300abd..42101bdd639f 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/README.md @@ -122,7 +122,7 @@ To learn more about other logging mechanisms see [Diagnostics Samples][logging]. ## Additional documentation -For more extensive documentation on Azure Health Insights Cancer Profiling, see the [Cancer Profiling documentation][cancer_profiling_docs] on docs.microsoft.com. +For more extensive documentation on Azure Health Insights Cancer Profiling, see the [Cancer Profiling documentation][cancer_profiling_docs] on learn.microsoft.com. ## Contributing @@ -140,7 +140,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [cancer_profiling_client_class]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs [samples_location]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/samples [logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ [azure_portal]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesHealthInsights diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md index 24ce40d0a458..420db2c529ce 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/README.md @@ -116,7 +116,7 @@ To learn more about other logging mechanisms see [Diagnostics Samples][logging]. ## Additional documentation -For more extensive documentation on Azure Health Insights Clinical Matching, see the [Clinical Matching documentation][clinical_matching_docs] on docs.microsoft.com. +For more extensive documentation on Azure Health Insights Clinical Matching, see the [Clinical Matching documentation][clinical_matching_docs] on learn.microsoft.com. ## Contributing @@ -129,9 +129,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [clinical_matching_client_class]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[cognitive_resource_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli [logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ [azure_portal]: https://portal.azure.com diff --git a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md index f479a4099c68..a3244b13349d 100644 --- a/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md +++ b/sdk/healthinsights/Azure.Health.Insights.RadiologyInsights/README.md @@ -113,9 +113,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org [azure_portal]: https://portal.azure.com -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [health_insights]: https://learn.microsoft.com/azure/azure-health-insights/overview?branch=main -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide [radiology_insights_docs]: https://learn.microsoft.com/azure/azure-health-insights/radiology-insights/ [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/CHANGELOG.md b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/CHANGELOG.md index a8dc55ec7300..a9ecc8c2b9df 100644 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/CHANGELOG.md +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/CHANGELOG.md @@ -70,4 +70,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/README.md b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/README.md index d824f84a6e88..1616f6cf676f 100644 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/README.md +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index 85442510ca0b..9131064e3da2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -119,4 +119,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md index bf4670cca4da..2ae9b570674d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md index 80fc19b77f3f..edeb17ba7274 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/CHANGELOG.md @@ -72,4 +72,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md index 7cac70b878bb..bfe95c8adc57 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/CHANGELOG.md b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/CHANGELOG.md index d831b7e2dcce..147edd0f69d3 100644 --- a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/CHANGELOG.md @@ -63,4 +63,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/README.md b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/README.md index cf81ae21f1d2..dacfd7fd0439 100644 --- a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/README.md +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/CHANGELOG.md b/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/CHANGELOG.md index 305be2910738..72d94a231c95 100644 --- a/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/CHANGELOG.md +++ b/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/README.md b/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/README.md index 087ebd730e3c..ad6e85c3e19b 100644 --- a/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/README.md +++ b/sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/CHANGELOG.md b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/CHANGELOG.md index 67f4b0bb5da7..d212f67a2357 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/CHANGELOG.md +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/CHANGELOG.md @@ -24,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/README.md b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/README.md index 7e01d9083bd4..3f93372e1513 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/README.md +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/iot/Azure.IoT.Hub.Service/src/API Design.md b/sdk/iot/Azure.IoT.Hub.Service/src/API Design.md index 70116d12de73..b8ce55369d60 100644 --- a/sdk/iot/Azure.IoT.Hub.Service/src/API Design.md +++ b/sdk/iot/Azure.IoT.Hub.Service/src/API Design.md @@ -52,7 +52,7 @@ var client = new IotHubServiceClient(connectionString); /// /// /// The IoT Hub connection string, with either "iothubowner", "service", "registryRead" or "registryReadWrite" policy, as applicable. -/// For more information, see . +/// For more information, see . /// public IotHubServiceClient(string connectionString) {} @@ -61,7 +61,7 @@ public IotHubServiceClient(string connectionString) {} /// /// /// The IoT Hub connection string, with either "iothubowner", "service", "registryRead" or "registryReadWrite" policy, as applicable. -/// For more information, see . +/// For more information, see . /// /// /// Options that allow configuration of requests sent to the IoT Hub service. diff --git a/sdk/iot/Azure.IoT.Hub.Service/tests/prerequisites/prerequisites.readme.md b/sdk/iot/Azure.IoT.Hub.Service/tests/prerequisites/prerequisites.readme.md index 9836bdb385f1..0bef8db86a92 100644 --- a/sdk/iot/Azure.IoT.Hub.Service/tests/prerequisites/prerequisites.readme.md +++ b/sdk/iot/Azure.IoT.Hub.Service/tests/prerequisites/prerequisites.readme.md @@ -7,7 +7,7 @@ - If already installed, check latest version: - Run `az --version` to make sure `azure-cli` is at least **version 2.0.8** - If it isn't, update it -- Use this link to install [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) +- Use this link to install [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) ## Maintenance diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/CHANGELOG.md b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/CHANGELOG.md index f8c7f1dd199f..599078ff45ff 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/CHANGELOG.md +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/CHANGELOG.md @@ -51,4 +51,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/README.md b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/README.md index a610bd1c6eb8..4a0b6ce35800 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/README.md +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/README.md @@ -43,7 +43,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/CHANGELOG.md b/sdk/iotcentral/Azure.ResourceManager.IotCentral/CHANGELOG.md index 977b5b96809c..f5f3ae8b7086 100644 --- a/sdk/iotcentral/Azure.ResourceManager.IotCentral/CHANGELOG.md +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/CHANGELOG.md @@ -55,8 +55,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -88,4 +88,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/README.md b/sdk/iotcentral/Azure.ResourceManager.IotCentral/README.md index 08bfec13126e..f1225a78f7fb 100644 --- a/sdk/iotcentral/Azure.ResourceManager.IotCentral/README.md +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/CHANGELOG.md b/sdk/iothub/Azure.ResourceManager.IotHub/CHANGELOG.md index 5991e5dd1ed7..29fc71af3179 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/CHANGELOG.md +++ b/sdk/iothub/Azure.ResourceManager.IotHub/CHANGELOG.md @@ -83,8 +83,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -115,4 +115,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/README.md b/sdk/iothub/Azure.ResourceManager.IotHub/README.md index 38f76556c22f..6a6500207f0e 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/README.md +++ b/sdk/iothub/Azure.ResourceManager.IotHub/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/CHANGELOG.md b/sdk/keyvault/Azure.ResourceManager.KeyVault/CHANGELOG.md index 77001a27880a..68c64dac036f 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/CHANGELOG.md +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/CHANGELOG.md @@ -210,7 +210,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). #### Management Client Changes diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/README.md b/sdk/keyvault/Azure.ResourceManager.KeyVault/README.md index 9802d21b0525..e6f474111003 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/README.md +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/README.md @@ -43,7 +43,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/CHANGELOG.md b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/CHANGELOG.md index bc38d92365b0..658238d72030 100644 --- a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/CHANGELOG.md +++ b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/CHANGELOG.md @@ -63,8 +63,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -96,4 +96,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/README.md b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/README.md index e91ee47492ca..ee49816efa3d 100644 --- a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/README.md +++ b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md b/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md index fe081e122bd4..e0d8b2429d85 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md +++ b/sdk/kusto/Azure.ResourceManager.Kusto/CHANGELOG.md @@ -143,5 +143,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/README.md b/sdk/kusto/Azure.ResourceManager.Kusto/README.md index 2e7acb2be034..d2de94efbd7a 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/README.md +++ b/sdk/kusto/Azure.ResourceManager.Kusto/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/tests/Prerequisites/prerequisites.readme.md b/sdk/kusto/Azure.ResourceManager.Kusto/tests/Prerequisites/prerequisites.readme.md index f0d19de6640b..014bead4bb50 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/tests/Prerequisites/prerequisites.readme.md +++ b/sdk/kusto/Azure.ResourceManager.Kusto/tests/Prerequisites/prerequisites.readme.md @@ -3,7 +3,7 @@ ## Install - Install the latest [Powershell 7](https://github.com/PowerShell/PowerShell/releases) -- Install the latest [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) +- Install the latest [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) - Install `Az.Kusto` module by running `Install-Module Az.Kusto` in PowerShell ## Usage diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/CHANGELOG.md b/sdk/labservices/Azure.ResourceManager.LabServices/CHANGELOG.md index f487608db11a..4dfd2fb51ff9 100644 --- a/sdk/labservices/Azure.ResourceManager.LabServices/CHANGELOG.md +++ b/sdk/labservices/Azure.ResourceManager.LabServices/CHANGELOG.md @@ -84,4 +84,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/README.md b/sdk/labservices/Azure.ResourceManager.LabServices/README.md index f107f939c726..94e7cb48d97f 100644 --- a/sdk/labservices/Azure.ResourceManager.LabServices/README.md +++ b/sdk/labservices/Azure.ResourceManager.LabServices/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/loadtestservice/Azure.Developer.LoadTesting/README.md b/sdk/loadtestservice/Azure.Developer.LoadTesting/README.md index a2bb5add86f1..ef13b0853800 100644 --- a/sdk/loadtestservice/Azure.Developer.LoadTesting/README.md +++ b/sdk/loadtestservice/Azure.Developer.LoadTesting/README.md @@ -9,7 +9,7 @@ Azure Load Testing provides client library in .NET to the user by which they can Various documentation is available to help you get started -- [API reference documentation](https://docs.microsoft.com/rest/api/loadtesting/) +- [API reference documentation](https://learn.microsoft.com/rest/api/loadtesting/) - [Product Documentation](https://azure.microsoft.com/services/load-testing/) ## Getting started @@ -24,7 +24,7 @@ dotnet add package Azure.Developer.LoadTesting ``` ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Load Test Service Resource](https://learn.microsoft.com/azure/load-testing/). 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`. +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Load Test Service Resource](https://learn.microsoft.com/azure/load-testing/). 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://learn.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 @@ -124,7 +124,7 @@ This is a template, but your SDK readme should include details on how to contrib -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [authenticate_with_token]: https://learn.microsoft.com/aspnet/core/security/authentication/identity @@ -133,5 +133,5 @@ This is a template, but your SDK readme should include details on how to contrib [client_secret_credential]: https://learn.microsoft.com/dotnet/api/azure.identity.clientsecretcredential [nuget]: https://www.nuget.org/ [azure_sub]: https://azure.microsoft.com/free/ -[api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/ +[api_reference_doc]: https://learn.microsoft.com/rest/api/loadtesting/ [product_documentation]: https://azure.microsoft.com/services/load-testing/ diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/CHANGELOG.md b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/CHANGELOG.md index 2f2a6bc18bea..e106a4c561ef 100644 --- a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/CHANGELOG.md +++ b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/CHANGELOG.md @@ -69,4 +69,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/README.md b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/README.md index 6fe23000b88e..8d4d7358c1e9 100644 --- a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/README.md +++ b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/logic/Azure.ResourceManager.Logic/CHANGELOG.md b/sdk/logic/Azure.ResourceManager.Logic/CHANGELOG.md index d47082b7a4c4..71bb802597bc 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/CHANGELOG.md +++ b/sdk/logic/Azure.ResourceManager.Logic/CHANGELOG.md @@ -71,8 +71,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -103,5 +103,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/logic/Azure.ResourceManager.Logic/README.md b/sdk/logic/Azure.ResourceManager.Logic/README.md index 77b67d8604ac..bcc20e850f7f 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/README.md +++ b/sdk/logic/Azure.ResourceManager.Logic/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/CHANGELOG.md b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/CHANGELOG.md index a0bc10b21d23..c99012580fc1 100644 --- a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/CHANGELOG.md +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/CHANGELOG.md @@ -67,4 +67,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/README.md b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/README.md index 56d41465d4cf..d50cb985f61e 100644 --- a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/README.md +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md index 73bdf55345fb..165c247e93cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/CHANGELOG.md @@ -122,4 +122,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/README.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/README.md index b5ab1b0672d7..f80a47c81a0c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/README.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md b/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md index 889efc5347fc..99eaf8f71a1d 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/CHANGELOG.md @@ -128,8 +128,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -161,4 +161,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/README.md b/sdk/maintenance/Azure.ResourceManager.Maintenance/README.md index 6df029f349e5..ad9d81cf5c2e 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/README.md +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/CHANGELOG.md b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/CHANGELOG.md index 2380ae11461a..3cb2f203ac47 100644 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/CHANGELOG.md +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/CHANGELOG.md @@ -63,4 +63,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/README.md b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/README.md index e5760238e5c8..94f5bbdbf823 100644 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/README.md +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md index 6d39bc6bb29d..99d8366e7340 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/CHANGELOG.md @@ -53,8 +53,8 @@ This release is the first stable release of the Managed Network Fabric library. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). ## 1.0.0-beta.1 (2023-06-28) @@ -70,4 +70,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/README.md b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/README.md index 9cf512632492..b71789ad0549 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/README.md +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/CHANGELOG.md b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/CHANGELOG.md index 7a7c497ed3c7..48173f38cce2 100644 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/CHANGELOG.md +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/CHANGELOG.md @@ -101,4 +101,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/README.md b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/README.md index bba54c0eab82..6d963e060c36 100644 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/README.md +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/managedservices/Azure.ResourceManager.ManagedServices/CHANGELOG.md b/sdk/managedservices/Azure.ResourceManager.ManagedServices/CHANGELOG.md index b53b48629973..4dc74b9860ff 100644 --- a/sdk/managedservices/Azure.ResourceManager.ManagedServices/CHANGELOG.md +++ b/sdk/managedservices/Azure.ResourceManager.ManagedServices/CHANGELOG.md @@ -59,8 +59,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -92,4 +92,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/managedservices/Azure.ResourceManager.ManagedServices/README.md b/sdk/managedservices/Azure.ResourceManager.ManagedServices/README.md index 7a4d874ed247..81588ba08610 100644 --- a/sdk/managedservices/Azure.ResourceManager.ManagedServices/README.md +++ b/sdk/managedservices/Azure.ResourceManager.ManagedServices/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/CHANGELOG.md b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/CHANGELOG.md index fef05a4a36de..9981ee872c47 100644 --- a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/CHANGELOG.md +++ b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/CHANGELOG.md @@ -63,5 +63,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/README.md b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/README.md index 59c1ba90526c..2205f5513f30 100644 --- a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/README.md +++ b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/maps/Azure.Maps.Common/README.md b/sdk/maps/Azure.Maps.Common/README.md index 429710ee4509..4ee43345b527 100644 --- a/sdk/maps/Azure.Maps.Common/README.md +++ b/sdk/maps/Azure.Maps.Common/README.md @@ -4,7 +4,7 @@ Azure Maps is a Microsoft-managed service providing maps service that is... The Azure.Maps.Common library provides infrastructure shared across other Azure Maps client libraries. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Common/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [Product documentation](https://docs.microsoft.com/azure/azure-maps) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Common/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [Product documentation](https://learn.microsoft.com/azure/azure-maps) ## Getting started @@ -21,7 +21,7 @@ dotnet add package Azure.Maps.Geolocation --prerelease ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: diff --git a/sdk/maps/Azure.Maps.Geolocation/README.md b/sdk/maps/Azure.Maps.Geolocation/README.md index d98c1eb21442..91c6f67d1b86 100644 --- a/sdk/maps/Azure.Maps.Geolocation/README.md +++ b/sdk/maps/Azure.Maps.Geolocation/README.md @@ -2,7 +2,7 @@ Azure Maps Geolocation is a library that can find geolocation to a location or points of interest. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Geolocation/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://docs.microsoft.com/rest/api/maps/geolocation) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Geolocation/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://learn.microsoft.com/rest/api/maps/geolocation) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## Getting started @@ -16,7 +16,7 @@ dotnet add package Azure.Maps.Geolocation --prerelease ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: @@ -164,7 +164,7 @@ For more detailed examples, please see [geolocation samples](https://github.com/ ### General -When you interact with the Azure Maps services, errors returned by the Language service correspond to the same HTTP status codes returned for [REST API requests](https://docs.microsoft.com/rest/api/maps/geolocation). +When you interact with the Azure Maps services, errors returned by the Language service correspond to the same HTTP status codes returned for [REST API requests](https://learn.microsoft.com/rest/api/maps/geolocation). For example, if you pass wrong IP address, an error is returned, indicating "Bad Request" (HTTP Status code: 400). diff --git a/sdk/maps/Azure.Maps.Rendering/README.md b/sdk/maps/Azure.Maps.Rendering/README.md index 55f8bbc8bb61..49543157bc7b 100644 --- a/sdk/maps/Azure.Maps.Rendering/README.md +++ b/sdk/maps/Azure.Maps.Rendering/README.md @@ -2,7 +2,7 @@ Azure Maps Render is a library that can fetch image tiles and copyright information. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://docs.microsoft.com/rest/api/maps/render) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://learn.microsoft.com/rest/api/maps/render) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## Getting started @@ -16,7 +16,7 @@ dotnet add package Azure.Maps.Rendering --prerelease ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: @@ -140,7 +140,7 @@ We guarantee that all client instance methods are thread-safe and independent of ## Examples -You can familiarize yourself with different APIs using our [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering/samples). Rendering map tiles requires knowledge about zoom levels and tile grid system. Please refer to the [documentation](https://docs.microsoft.com/azure/azure-maps/zoom-levels-and-tile-grid) for more information. +You can familiarize yourself with different APIs using our [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Rendering/samples). Rendering map tiles requires knowledge about zoom levels and tile grid system. Please refer to the [documentation](https://learn.microsoft.com/azure/azure-maps/zoom-levels-and-tile-grid) for more information. ### Get Imagery Tiles @@ -170,7 +170,7 @@ using (FileStream fileStream = File.Create(".\\BerlinImagery.png")) ### General -When you interact with the Azure Maps services, errors returned by the service correspond to the same HTTP status codes returned for [REST API requests](https://docs.microsoft.com/rest/api/maps/render). +When you interact with the Azure Maps services, errors returned by the service correspond to the same HTTP status codes returned for [REST API requests](https://learn.microsoft.com/rest/api/maps/render). For example, if you try to get an imagery tile with wrong tile index, an error is returned, indicating "Bad Request" (HTTP 400). diff --git a/sdk/maps/Azure.Maps.Rendering/samples/MapsRenderingTilesImageriesImagesSamples.md b/sdk/maps/Azure.Maps.Rendering/samples/MapsRenderingTilesImageriesImagesSamples.md index 48464c051037..91852a45de2b 100644 --- a/sdk/maps/Azure.Maps.Rendering/samples/MapsRenderingTilesImageriesImagesSamples.md +++ b/sdk/maps/Azure.Maps.Rendering/samples/MapsRenderingTilesImageriesImagesSamples.md @@ -26,7 +26,7 @@ var client = new MapsRouteClient(credential, clientId); ## Get correct tile index -Rendering map tiles requires the knowledge about [zoom levels and tile grid system](https://docs.microsoft.com/azure/azure-maps/zoom-levels-and-tile-grid). We provide APIs for you to find out the correct tile index and zoom level they need. +Rendering map tiles requires the knowledge about [zoom levels and tile grid system](https://learn.microsoft.com/azure/azure-maps/zoom-levels-and-tile-grid). We provide APIs for you to find out the correct tile index and zoom level they need. For example, if you wants to render a tile in Germany with a specific bounding box range, one can use utility function `PositionToTileXY` method from `TileMath`. With the desired coordinate, zoom level and tile size, one can get tile X and Y index: diff --git a/sdk/maps/Azure.Maps.Routing/CHANGELOG.md b/sdk/maps/Azure.Maps.Routing/CHANGELOG.md index b2cf18ee9f38..d1e38eb953f0 100644 --- a/sdk/maps/Azure.Maps.Routing/CHANGELOG.md +++ b/sdk/maps/Azure.Maps.Routing/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.5 (Unreleased) ### Features Added @@ -10,11 +10,17 @@ ### Other Changes +## 1.0.0-beta.4 (2024-12-10) + +### Bugs Fixed + +- Fix deserialization error in `RouteMatrixResultResponse` when POST route matrix returns errors. + ## 1.0.0-beta.3 (2024-08-06) ### Bugs Fixed -- Support multiple SectionTypes in SectionFilter +- Support multiple `SectionTypes` in `SectionFilter` ## 1.0.0-beta.2 (2023-07-13) diff --git a/sdk/maps/Azure.Maps.Routing/README.md b/sdk/maps/Azure.Maps.Routing/README.md index ae475e8e7e71..21179fcf3d3d 100644 --- a/sdk/maps/Azure.Maps.Routing/README.md +++ b/sdk/maps/Azure.Maps.Routing/README.md @@ -2,7 +2,7 @@ Azure Maps Routing is a library that can find route to a location or points of interest. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Routing/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://docs.microsoft.com/rest/api/maps/route) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Routing/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://learn.microsoft.com/rest/api/maps/route) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## Getting started @@ -16,7 +16,7 @@ dotnet add package Azure.Maps.Routing --prerelease ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: diff --git a/sdk/maps/Azure.Maps.Routing/assets.json b/sdk/maps/Azure.Maps.Routing/assets.json index 81dbcd919818..5fadd1fbab30 100644 --- a/sdk/maps/Azure.Maps.Routing/assets.json +++ b/sdk/maps/Azure.Maps.Routing/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/maps/Azure.Maps.Routing", - "Tag": "net/maps/Azure.Maps.Routing_54064ae0c1" + "Tag": "net/maps/Azure.Maps.Routing_0755b0a67d" } diff --git a/sdk/maps/Azure.Maps.Routing/src/Azure.Maps.Routing.csproj b/sdk/maps/Azure.Maps.Routing/src/Azure.Maps.Routing.csproj index 17586b0e5e44..2328d7b23933 100644 --- a/sdk/maps/Azure.Maps.Routing/src/Azure.Maps.Routing.csproj +++ b/sdk/maps/Azure.Maps.Routing/src/Azure.Maps.Routing.csproj @@ -2,7 +2,7 @@ Azure Maps Azure.Maps.Routing Azure Maps Azure.Maps.Routing - 1.0.0-beta.4 + 1.0.0-beta.5 Azure;Azure Maps;Maps Azure.Maps.Routing true $(RequiredTargetFrameworks) diff --git a/sdk/maps/Azure.Maps.Routing/src/Generated/Models/RouteMatrix.Serialization.cs b/sdk/maps/Azure.Maps.Routing/src/Generated/Models/RouteMatrix.Serialization.cs index b4a0ee8b7ddc..a2ee0b940aa0 100644 --- a/sdk/maps/Azure.Maps.Routing/src/Generated/Models/RouteMatrix.Serialization.cs +++ b/sdk/maps/Azure.Maps.Routing/src/Generated/Models/RouteMatrix.Serialization.cs @@ -11,44 +11,5 @@ namespace Azure.Maps.Routing.Models { public partial class RouteMatrix { - internal static RouteMatrix DeserializeRouteMatrix(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? statusCode = default; - RouteMatrixResultResponse response = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("statusCode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - statusCode = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("response"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - response = RouteMatrixResultResponse.DeserializeRouteMatrixResultResponse(property.Value); - continue; - } - } - return new RouteMatrix(statusCode, response); - } - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RouteMatrix FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRouteMatrix(document.RootElement); - } } } diff --git a/sdk/maps/Azure.Maps.Routing/src/Models/Operation/GetRouteMatrixOperation.cs b/sdk/maps/Azure.Maps.Routing/src/Models/Operation/GetRouteMatrixOperation.cs index 5fb4968e24d1..a6f11c876596 100644 --- a/sdk/maps/Azure.Maps.Routing/src/Models/Operation/GetRouteMatrixOperation.cs +++ b/sdk/maps/Azure.Maps.Routing/src/Models/Operation/GetRouteMatrixOperation.cs @@ -110,8 +110,7 @@ private async ValueTask> WaitForCompletionAsync(bool _id = paths[paths.Length - 1]; } - RouteMatrixResult result = null; - return Response.FromValue(result, response); + return await WaitForCompletionAsync(async, cancellationToken).ConfigureAwait(false); } /// diff --git a/sdk/maps/Azure.Maps.Routing/src/Models/RouteMatrix.Serialization.cs b/sdk/maps/Azure.Maps.Routing/src/Models/RouteMatrix.Serialization.cs new file mode 100644 index 000000000000..a6aa452de3c0 --- /dev/null +++ b/sdk/maps/Azure.Maps.Routing/src/Models/RouteMatrix.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.Text.Json; + +namespace Azure.Maps.Routing.Models +{ + public partial class RouteMatrix + { + internal static RouteMatrix DeserializeRouteMatrix(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? statusCode = default; + RouteMatrixResultResponse response = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("statusCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + statusCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("response"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + if (statusCode == 200) { + response = RouteMatrixResultResponse.DeserializeRouteMatrixResultResponse(property.Value); + } else { + response = new RouteMatrixResultResponse(null); + } + continue; + } + } + return new RouteMatrix(statusCode, response); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RouteMatrix FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRouteMatrix(document.RootElement); + } + } +} diff --git a/sdk/maps/Azure.Maps.Routing/tests/RouteMatrixTests.cs b/sdk/maps/Azure.Maps.Routing/tests/RouteMatrixTests.cs index 89946952da5e..bc3c96e39090 100644 --- a/sdk/maps/Azure.Maps.Routing/tests/RouteMatrixTests.cs +++ b/sdk/maps/Azure.Maps.Routing/tests/RouteMatrixTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -27,15 +28,19 @@ public async Task CanSyncRequestRouteMatrix() new GeoPosition(123.751, 45.9375), new GeoPosition(123.791, 45.96875) }, - Destinations = new List() { new GeoPosition(123.767, 45.90625) }, + Destinations = new List() + { + new GeoPosition(1, 13.5471), + new GeoPosition(123.767, 45.90625), + }, }; var result = await client.GetImmediateRouteMatrixAsync(routeMatrixQuery); Assert.AreEqual("0.0.1", result.Value.FormatVersion); Assert.AreEqual(2, result.Value.Matrix.Count); - Assert.AreEqual(1, result.Value.Matrix[0].Count); + Assert.AreEqual(2, result.Value.Matrix[0].Count); Assert.AreEqual(2, result.Value.Summary.SuccessfulRoutes); - Assert.AreEqual(2, result.Value.Summary.TotalRoutes); + Assert.AreEqual(4, result.Value.Summary.TotalRoutes); } [RecordedTest] diff --git a/sdk/maps/Azure.Maps.Search/README.md b/sdk/maps/Azure.Maps.Search/README.md index 33f6c5d4d807..034af42ac21c 100644 --- a/sdk/maps/Azure.Maps.Search/README.md +++ b/sdk/maps/Azure.Maps.Search/README.md @@ -2,7 +2,7 @@ Azure Maps Search is a library that can query for locations, points of interests or search within a geometric area. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Search/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://docs.microsoft.com/rest/api/maps/search) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Search/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://learn.microsoft.com/rest/api/maps/search) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## Getting started @@ -16,7 +16,7 @@ dotnet add package Azure.Maps.Search --prerelease ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: diff --git a/sdk/maps/Azure.Maps.TimeZone/api/Azure.Maps.TimeZone.net8.0.cs b/sdk/maps/Azure.Maps.TimeZone/api/Azure.Maps.TimeZone.net8.0.cs deleted file mode 100644 index 8fde7b27023b..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/api/Azure.Maps.TimeZone.net8.0.cs +++ /dev/null @@ -1,159 +0,0 @@ -namespace Azure.Maps.TimeZone -{ - public partial class CountryRecord - { - internal CountryRecord() { } - public string Code { get { throw null; } } - public string Name { get { throw null; } } - } - public partial class IanaId - { - internal IanaId() { } - public string AliasOf { get { throw null; } } - public bool? HasZone1970Location { get { throw null; } } - public string Id { get { throw null; } } - public bool? IsAlias { get { throw null; } } - } - public partial class MapsTimeZoneClient - { - protected MapsTimeZoneClient() { } - public MapsTimeZoneClient(Azure.AzureKeyCredential credential) { } - public MapsTimeZoneClient(Azure.AzureKeyCredential credential, Azure.Maps.TimeZone.MapsTimeZoneClientOptions options) { } - public MapsTimeZoneClient(Azure.AzureSasCredential credential) { } - public MapsTimeZoneClient(Azure.AzureSasCredential credential, Azure.Maps.TimeZone.MapsTimeZoneClientOptions options) { } - public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId) { } - public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId, Azure.Maps.TimeZone.MapsTimeZoneClientOptions options) { } - public virtual Azure.Response> ConvertWindowsTimeZoneToIana(string windowsTimezoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> ConvertWindowsTimeZoneToIanaAsync(string windowsTimezoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetIanaTimeZoneIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetIanaTimeZoneIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetIanaVersion(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIanaVersionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetTimeZoneByCoordinates(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetTimeZoneByCoordinatesAsync(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetTimeZoneByID(string timezoneId, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetTimeZoneByIDAsync(string timezoneId, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetWindowsTimeZoneIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetWindowsTimeZoneIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class MapsTimeZoneClientOptions : Azure.Core.ClientOptions - { - public MapsTimeZoneClientOptions(Azure.Maps.TimeZone.MapsTimeZoneClientOptions.ServiceVersion version = Azure.Maps.TimeZone.MapsTimeZoneClientOptions.ServiceVersion.V1_0, System.Uri endpoint = null) { } - public System.Uri Endpoint { get { throw null; } set { } } - public enum ServiceVersion - { - V1_0 = 1, - } - } - public static partial class MapsTimeZoneModelFactory - { - public static Azure.Maps.TimeZone.CountryRecord CountryRecord(string name = null, string code = null) { throw null; } - public static Azure.Maps.TimeZone.IanaId IanaId(string id = null, bool? isAlias = default(bool?), string aliasOf = null, bool? hasZone1970Location = default(bool?)) { throw null; } - public static Azure.Maps.TimeZone.ReferenceTime ReferenceTime(string tag = null, string standardOffset = null, string daylightSavings = null, string wallTime = null, int? posixTzValidYear = default(int?), string posixTz = null, System.DateTimeOffset? sunrise = default(System.DateTimeOffset?), System.DateTimeOffset? sunset = default(System.DateTimeOffset?)) { throw null; } - public static Azure.Maps.TimeZone.TimeTransition TimeTransition(string tag = null, string standardOffset = null, string daylightSavings = null, System.DateTimeOffset? utcStart = default(System.DateTimeOffset?), System.DateTimeOffset? utcEnd = default(System.DateTimeOffset?)) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneIanaVersionResult TimeZoneIanaVersionResult(string version = null) { throw null; } - public static Azure.Maps.TimeZone.TimezoneId TimezoneId(string id = null, System.Collections.Generic.IEnumerable aliases = null, System.Collections.Generic.IEnumerable countries = null, Azure.Maps.TimeZone.Models.TimeZoneNames names = null, Azure.Maps.TimeZone.ReferenceTime referenceTime = null, Azure.Maps.TimeZone.Models.RepresentativePoint representativePoint = null, System.Collections.Generic.IEnumerable timeTransitions = null) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneInformation TimeZoneInformation(string version = null, System.DateTimeOffset? referenceUtcTimestamp = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable timeZones = null) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneNames TimeZoneNames(string iso6391LanguageCode = null, string generic = null, string standard = null, string daylight = null) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneWindows TimeZoneWindows(string windowsId = null, string territory = null, System.Collections.Generic.IEnumerable ianaIds = null) { throw null; } - } - public partial class ReferenceTime - { - internal ReferenceTime() { } - public string DaylightSavings { get { throw null; } } - public string PosixTz { get { throw null; } } - public int? PosixTzValidYear { get { throw null; } } - public string StandardOffset { get { throw null; } } - public System.DateTimeOffset? Sunrise { get { throw null; } } - public System.DateTimeOffset? Sunset { get { throw null; } } - public string Tag { get { throw null; } } - public string WallTime { get { throw null; } } - } - public partial class TimeTransition - { - internal TimeTransition() { } - public string DaylightSavings { get { throw null; } } - public string StandardOffset { get { throw null; } } - public string Tag { get { throw null; } } - public System.DateTimeOffset? UtcEnd { get { throw null; } } - public System.DateTimeOffset? UtcStart { get { throw null; } } - } - public partial class TimezoneId - { - internal TimezoneId() { } - public System.Collections.Generic.IReadOnlyList Aliases { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Countries { get { throw null; } } - public string Id { get { throw null; } } - public Azure.Maps.TimeZone.Models.TimeZoneNames Names { get { throw null; } } - public Azure.Maps.TimeZone.ReferenceTime ReferenceTime { get { throw null; } } - public Azure.Maps.TimeZone.Models.RepresentativePoint RepresentativePoint { get { throw null; } } - public System.Collections.Generic.IReadOnlyList TimeTransitions { get { throw null; } } - } -} -namespace Azure.Maps.TimeZone.Models -{ - public partial class RepresentativePoint - { - internal RepresentativePoint() { } - public Azure.Core.GeoJson.GeoPosition geoPosition { get { throw null; } set { } } - } - public partial class TimeZoneIanaVersionResult - { - internal TimeZoneIanaVersionResult() { } - public string Version { get { throw null; } } - } - public partial class TimeZoneInformation - { - internal TimeZoneInformation() { } - public System.DateTimeOffset? ReferenceUtcTimestamp { get { throw null; } } - public System.Collections.Generic.IReadOnlyList TimeZones { get { throw null; } } - public string Version { get { throw null; } } - } - public partial class TimeZoneNames - { - internal TimeZoneNames() { } - public string Daylight { get { throw null; } } - public string Generic { get { throw null; } } - public string Iso6391LanguageCode { get { throw null; } } - public string Standard { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TimeZoneOptions : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public TimeZoneOptions(string value) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions All { get { throw null; } } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions None { get { throw null; } } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions Transitions { get { throw null; } } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions ZoneInfo { get { throw null; } } - public bool Equals(Azure.Maps.TimeZone.Models.TimeZoneOptions 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.Maps.TimeZone.Models.TimeZoneOptions left, Azure.Maps.TimeZone.Models.TimeZoneOptions right) { throw null; } - public static implicit operator Azure.Maps.TimeZone.Models.TimeZoneOptions (string value) { throw null; } - public static bool operator !=(Azure.Maps.TimeZone.Models.TimeZoneOptions left, Azure.Maps.TimeZone.Models.TimeZoneOptions right) { throw null; } - public override string ToString() { throw null; } - } - public partial class TimeZoneWindows - { - internal TimeZoneWindows() { } - public System.Collections.Generic.IReadOnlyList IanaIds { get { throw null; } } - public string Territory { get { throw null; } } - public string WindowsId { get { throw null; } } - } -} -namespace Azure.Maps.TimeZone.Models.Options -{ - public partial class TimeZoneBaseOptions - { - public TimeZoneBaseOptions() { } - public string AcceptLanguage { get { throw null; } set { } } - public System.DateTimeOffset? DaylightSavingsTimeFrom { get { throw null; } set { } } - public int? DaylightSavingsTimeLastingYears { get { throw null; } set { } } - public Azure.Maps.TimeZone.Models.TimeZoneOptions? Options { get { throw null; } set { } } - public System.DateTimeOffset? TimeStamp { get { throw null; } set { } } - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/api/Azure.Maps.TimeZone.netstandard2.0.cs b/sdk/maps/Azure.Maps.TimeZone/api/Azure.Maps.TimeZone.netstandard2.0.cs deleted file mode 100644 index 8fde7b27023b..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/api/Azure.Maps.TimeZone.netstandard2.0.cs +++ /dev/null @@ -1,159 +0,0 @@ -namespace Azure.Maps.TimeZone -{ - public partial class CountryRecord - { - internal CountryRecord() { } - public string Code { get { throw null; } } - public string Name { get { throw null; } } - } - public partial class IanaId - { - internal IanaId() { } - public string AliasOf { get { throw null; } } - public bool? HasZone1970Location { get { throw null; } } - public string Id { get { throw null; } } - public bool? IsAlias { get { throw null; } } - } - public partial class MapsTimeZoneClient - { - protected MapsTimeZoneClient() { } - public MapsTimeZoneClient(Azure.AzureKeyCredential credential) { } - public MapsTimeZoneClient(Azure.AzureKeyCredential credential, Azure.Maps.TimeZone.MapsTimeZoneClientOptions options) { } - public MapsTimeZoneClient(Azure.AzureSasCredential credential) { } - public MapsTimeZoneClient(Azure.AzureSasCredential credential, Azure.Maps.TimeZone.MapsTimeZoneClientOptions options) { } - public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId) { } - public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId, Azure.Maps.TimeZone.MapsTimeZoneClientOptions options) { } - public virtual Azure.Response> ConvertWindowsTimeZoneToIana(string windowsTimezoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> ConvertWindowsTimeZoneToIanaAsync(string windowsTimezoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetIanaTimeZoneIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetIanaTimeZoneIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetIanaVersion(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIanaVersionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetTimeZoneByCoordinates(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetTimeZoneByCoordinatesAsync(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetTimeZoneByID(string timezoneId, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetTimeZoneByIDAsync(string timezoneId, Azure.Maps.TimeZone.Models.Options.TimeZoneBaseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetWindowsTimeZoneIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetWindowsTimeZoneIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class MapsTimeZoneClientOptions : Azure.Core.ClientOptions - { - public MapsTimeZoneClientOptions(Azure.Maps.TimeZone.MapsTimeZoneClientOptions.ServiceVersion version = Azure.Maps.TimeZone.MapsTimeZoneClientOptions.ServiceVersion.V1_0, System.Uri endpoint = null) { } - public System.Uri Endpoint { get { throw null; } set { } } - public enum ServiceVersion - { - V1_0 = 1, - } - } - public static partial class MapsTimeZoneModelFactory - { - public static Azure.Maps.TimeZone.CountryRecord CountryRecord(string name = null, string code = null) { throw null; } - public static Azure.Maps.TimeZone.IanaId IanaId(string id = null, bool? isAlias = default(bool?), string aliasOf = null, bool? hasZone1970Location = default(bool?)) { throw null; } - public static Azure.Maps.TimeZone.ReferenceTime ReferenceTime(string tag = null, string standardOffset = null, string daylightSavings = null, string wallTime = null, int? posixTzValidYear = default(int?), string posixTz = null, System.DateTimeOffset? sunrise = default(System.DateTimeOffset?), System.DateTimeOffset? sunset = default(System.DateTimeOffset?)) { throw null; } - public static Azure.Maps.TimeZone.TimeTransition TimeTransition(string tag = null, string standardOffset = null, string daylightSavings = null, System.DateTimeOffset? utcStart = default(System.DateTimeOffset?), System.DateTimeOffset? utcEnd = default(System.DateTimeOffset?)) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneIanaVersionResult TimeZoneIanaVersionResult(string version = null) { throw null; } - public static Azure.Maps.TimeZone.TimezoneId TimezoneId(string id = null, System.Collections.Generic.IEnumerable aliases = null, System.Collections.Generic.IEnumerable countries = null, Azure.Maps.TimeZone.Models.TimeZoneNames names = null, Azure.Maps.TimeZone.ReferenceTime referenceTime = null, Azure.Maps.TimeZone.Models.RepresentativePoint representativePoint = null, System.Collections.Generic.IEnumerable timeTransitions = null) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneInformation TimeZoneInformation(string version = null, System.DateTimeOffset? referenceUtcTimestamp = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable timeZones = null) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneNames TimeZoneNames(string iso6391LanguageCode = null, string generic = null, string standard = null, string daylight = null) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneWindows TimeZoneWindows(string windowsId = null, string territory = null, System.Collections.Generic.IEnumerable ianaIds = null) { throw null; } - } - public partial class ReferenceTime - { - internal ReferenceTime() { } - public string DaylightSavings { get { throw null; } } - public string PosixTz { get { throw null; } } - public int? PosixTzValidYear { get { throw null; } } - public string StandardOffset { get { throw null; } } - public System.DateTimeOffset? Sunrise { get { throw null; } } - public System.DateTimeOffset? Sunset { get { throw null; } } - public string Tag { get { throw null; } } - public string WallTime { get { throw null; } } - } - public partial class TimeTransition - { - internal TimeTransition() { } - public string DaylightSavings { get { throw null; } } - public string StandardOffset { get { throw null; } } - public string Tag { get { throw null; } } - public System.DateTimeOffset? UtcEnd { get { throw null; } } - public System.DateTimeOffset? UtcStart { get { throw null; } } - } - public partial class TimezoneId - { - internal TimezoneId() { } - public System.Collections.Generic.IReadOnlyList Aliases { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Countries { get { throw null; } } - public string Id { get { throw null; } } - public Azure.Maps.TimeZone.Models.TimeZoneNames Names { get { throw null; } } - public Azure.Maps.TimeZone.ReferenceTime ReferenceTime { get { throw null; } } - public Azure.Maps.TimeZone.Models.RepresentativePoint RepresentativePoint { get { throw null; } } - public System.Collections.Generic.IReadOnlyList TimeTransitions { get { throw null; } } - } -} -namespace Azure.Maps.TimeZone.Models -{ - public partial class RepresentativePoint - { - internal RepresentativePoint() { } - public Azure.Core.GeoJson.GeoPosition geoPosition { get { throw null; } set { } } - } - public partial class TimeZoneIanaVersionResult - { - internal TimeZoneIanaVersionResult() { } - public string Version { get { throw null; } } - } - public partial class TimeZoneInformation - { - internal TimeZoneInformation() { } - public System.DateTimeOffset? ReferenceUtcTimestamp { get { throw null; } } - public System.Collections.Generic.IReadOnlyList TimeZones { get { throw null; } } - public string Version { get { throw null; } } - } - public partial class TimeZoneNames - { - internal TimeZoneNames() { } - public string Daylight { get { throw null; } } - public string Generic { get { throw null; } } - public string Iso6391LanguageCode { get { throw null; } } - public string Standard { get { throw null; } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TimeZoneOptions : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public TimeZoneOptions(string value) { throw null; } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions All { get { throw null; } } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions None { get { throw null; } } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions Transitions { get { throw null; } } - public static Azure.Maps.TimeZone.Models.TimeZoneOptions ZoneInfo { get { throw null; } } - public bool Equals(Azure.Maps.TimeZone.Models.TimeZoneOptions 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.Maps.TimeZone.Models.TimeZoneOptions left, Azure.Maps.TimeZone.Models.TimeZoneOptions right) { throw null; } - public static implicit operator Azure.Maps.TimeZone.Models.TimeZoneOptions (string value) { throw null; } - public static bool operator !=(Azure.Maps.TimeZone.Models.TimeZoneOptions left, Azure.Maps.TimeZone.Models.TimeZoneOptions right) { throw null; } - public override string ToString() { throw null; } - } - public partial class TimeZoneWindows - { - internal TimeZoneWindows() { } - public System.Collections.Generic.IReadOnlyList IanaIds { get { throw null; } } - public string Territory { get { throw null; } } - public string WindowsId { get { throw null; } } - } -} -namespace Azure.Maps.TimeZone.Models.Options -{ - public partial class TimeZoneBaseOptions - { - public TimeZoneBaseOptions() { } - public string AcceptLanguage { get { throw null; } set { } } - public System.DateTimeOffset? DaylightSavingsTimeFrom { get { throw null; } set { } } - public int? DaylightSavingsTimeLastingYears { get { throw null; } set { } } - public Azure.Maps.TimeZone.Models.TimeZoneOptions? Options { get { throw null; } set { } } - public System.DateTimeOffset? TimeStamp { get { throw null; } set { } } - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/samples/MapsTimeZoneSamples.md b/sdk/maps/Azure.Maps.TimeZone/samples/MapsTimeZoneSamples.md deleted file mode 100644 index bec69f759ce4..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/samples/MapsTimeZoneSamples.md +++ /dev/null @@ -1,56 +0,0 @@ -using Azure.Maps.TimeZone; - - -## Examples - - -### Get TimeZone By ID - -```C# Snippet:GetTimeZoneById -TimeZoneBaseOptions options = new TimeZoneBaseOptions(); -options.Options = TimeZoneOptions.All; -Response response = client.GetTimeZoneByID("Asia/Bahrain", options); -Console.WriteLine("Version: " + response.Value.Version); -Console.WriteLine("Countires: " + response.Value.TimeZones[0].Countries); -``` - -### Get TimeZone By Coordinates - -```C# Snippet:GetTimeZoneByCoordinates -TimeZoneBaseOptions options = new TimeZoneBaseOptions(); -options.Options = TimeZoneOptions.All; -GeoPosition coordinates = new GeoPosition(121.5640089, 25.0338053); -Response response = client.GetTimeZoneByCoordinates(coordinates, options); -Console.WriteLine("Names: " + response.Value.TimeZones[0].Names); -``` - -### Get Windows TimeZone Ids - -```C# Snippet:GetWindowsTimeZoneIds -Response> response = client.GetWindowsTimeZoneIds(); -Console.WriteLine("Count: " + response.Value.Count); -Console.WriteLine("WindowsId: " + response.Value[0].WindowsId); -Console.WriteLine("Territory: " + response.Value[0].Territory); -``` - -### Get Iana TimeZone Ids - -```C# Snippet:GetIanaTimeZoneIds -Response> response = client.GetIanaTimeZoneIds(); -Console.WriteLine("IsAlias: " + response.Value[0].IsAlias); -Console.WriteLine("Id: " + response.Value[0].Id); -``` - -### Get Iana Version - -```C# Snippet:GetIanaVersion -Response response = client.GetIanaVersion(); -Console.WriteLine("Version: " + response.Value.Version); -``` - -### Convert Windows TimeZone To Iana - -```C# Snippet:ConvertWindowsTimeZoneToIana -Response> response = client.ConvertWindowsTimeZoneToIana("Dateline Standard Time"); -Console.WriteLine("Id: " + response.Value[0].Id); -``` diff --git a/sdk/maps/Azure.Maps.TimeZone/samples/README.md b/sdk/maps/Azure.Maps.TimeZone/samples/README.md deleted file mode 100644 index 9b35fb264f43..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/samples/README.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -page_type: sample -languages: -- csharp -products: -- azure -- azure-maps -name: Azure.Maps.TimeZone samples for .NET -description: Samples for the Azure.Maps.TimeZone client library. ---- - -# Azure.Maps.TimeZone Samples - -For different APIs, please refer the following samples: - -[Timezone](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.TimeZone/samples/MapsTimeZoneSamples.md) diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/MapsTimeZoneModelFactory.cs b/sdk/maps/Azure.Maps.TimeZone/src/Generated/MapsTimeZoneModelFactory.cs deleted file mode 100644 index 0085f9d25aeb..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/MapsTimeZoneModelFactory.cs +++ /dev/null @@ -1,145 +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.Maps.TimeZone.Models; - -namespace Azure.Maps.TimeZone -{ - /// Model factory for models. - public static partial class MapsTimeZoneModelFactory - { - /// Initializes a new instance of . - /// Version property. - /// Reference Utc Timestamp property. - /// TimeZoneId array. - /// A new instance for mocking. - public static TimeZoneInformation TimeZoneInformation(string version = null, DateTimeOffset? referenceUtcTimestamp = null, IEnumerable timeZones = null) - { - timeZones ??= new List(); - - return new TimeZoneInformation(version, referenceUtcTimestamp, timeZones?.ToList()); - } - - /// Initializes a new instance of . - /// Id property. - /// - /// An array of time zone ID aliases. Only returned when [options]=*zoneinfo* or *all*. - /// - /// Note: may be null. - /// - /// An array of country/region records. Only returned when [options]=*zoneinfo* or *all*. - /// Timezone names object. - /// Details in effect at the local time. - /// Representative point property. - /// Time zone DST transitions from [transitionsFrom] until timestamp + 1 year. - /// A new instance for mocking. - public static TimezoneId TimezoneId(string id = null, IEnumerable aliases = null, IEnumerable countries = null, TimeZoneNames names = null, ReferenceTime referenceTime = null, RepresentativePoint representativePoint = null, IEnumerable timeTransitions = null) - { - aliases ??= new List(); - countries ??= new List(); - timeTransitions ??= new List(); - - return new TimezoneId( - id, - aliases?.ToList(), - countries?.ToList(), - names, - referenceTime, - representativePoint, - timeTransitions?.ToList()); - } - - /// Initializes a new instance of . - /// country/region Name. - /// ISO-3166 2-letter country/region code for the country/region. - /// A new instance for mocking. - public static CountryRecord CountryRecord(string name = null, string code = null) - { - return new CountryRecord(name, code); - } - - /// Initializes a new instance of . - /// The ISO 639-1 language code of the Names. - /// Generic Name. - /// Standard Name. - /// Daylight Name. - /// A new instance for mocking. - public static TimeZoneNames TimeZoneNames(string iso6391LanguageCode = null, string generic = null, string standard = null, string daylight = null) - { - return new TimeZoneNames(iso6391LanguageCode, generic, standard, daylight); - } - - /// Initializes a new instance of . - /// Time zone name in effect at the reference timestamp (i.e. PST or PDT depending whether Daylight Savings Time is in effect). - /// UTC offset in effect at the `ReferenceUTCTimestamp`. - /// Time saving in minutes in effect at the `ReferenceUTCTimestamp`. - /// Current wall time at the given time zone as shown in the `Tag` property. - /// The year this POSIX string is valid for. Note: A POSIX string will only be valid in the given year. - /// POSIX string used to set the time zone environment variable. - /// Sunrise at the given time zone as shown in the `Tag` property. The sunrise is described in the ISO8601 format. (Only be populated if the call is byCoordinates). - /// Sunset at the given time zone as shown in the `Tag` property. The sunset is described in the ISO8601 format.(Only be populated if the call is byCoordinates). - /// A new instance for mocking. - public static ReferenceTime ReferenceTime(string tag = null, string standardOffset = null, string daylightSavings = null, string wallTime = null, int? posixTzValidYear = null, string posixTz = null, DateTimeOffset? sunrise = null, DateTimeOffset? sunset = null) - { - return new ReferenceTime( - tag, - standardOffset, - daylightSavings, - wallTime, - posixTzValidYear, - posixTz, - sunrise, - sunset); - } - - /// Initializes a new instance of . - /// Tag property. - /// StandardOffset property. - /// DaylightSavings property. - /// Start date, start time for this transition period. - /// End date, end time for this transition period. - /// A new instance for mocking. - public static TimeTransition TimeTransition(string tag = null, string standardOffset = null, string daylightSavings = null, DateTimeOffset? utcStart = null, DateTimeOffset? utcEnd = null) - { - return new TimeTransition(tag, standardOffset, daylightSavings, utcStart, utcEnd); - } - - /// Initializes a new instance of . - /// Windows Id property. - /// Territory property. - /// IanaIds array. - /// A new instance for mocking. - public static TimeZoneWindows TimeZoneWindows(string windowsId = null, string territory = null, IEnumerable ianaIds = null) - { - ianaIds ??= new List(); - - return new TimeZoneWindows(windowsId, territory, ianaIds?.ToList()); - } - - /// Initializes a new instance of . - /// Id property. - /// IsAlias property. - /// AliasOf property. - /// This attribute returns `True` if the IanaId has any country/zone associated with it. - /// A new instance for mocking. - public static IanaId IanaId(string id = null, bool? isAlias = null, string aliasOf = null, bool? hasZone1970Location = null) - { - return new IanaId(id, isAlias, aliasOf, hasZone1970Location); - } - - /// Initializes a new instance of . - /// Version property. - /// A new instance for mocking. - public static TimeZoneIanaVersionResult TimeZoneIanaVersionResult(string version = null) - { - return new TimeZoneIanaVersionResult(version); - } - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeTransition.cs b/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeTransition.cs deleted file mode 100644 index bd1b6eb4687f..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeTransition.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.Maps.TimeZone -{ - /// The TimeTransition. - public partial class TimeTransition - { - /// Initializes a new instance of . - internal TimeTransition() - { - } - - /// Initializes a new instance of . - /// Tag property. - /// StandardOffset property. - /// DaylightSavings property. - /// Start date, start time for this transition period. - /// End date, end time for this transition period. - internal TimeTransition(string tag, string standardOffset, string daylightSavings, DateTimeOffset? utcStart, DateTimeOffset? utcEnd) - { - Tag = tag; - StandardOffset = standardOffset; - DaylightSavings = daylightSavings; - UtcStart = utcStart; - UtcEnd = utcEnd; - } - - /// Tag property. - public string Tag { get; } - /// StandardOffset property. - public string StandardOffset { get; } - /// DaylightSavings property. - public string DaylightSavings { get; } - /// Start date, start time for this transition period. - public DateTimeOffset? UtcStart { get; } - /// End date, end time for this transition period. - public DateTimeOffset? UtcEnd { get; } - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneOptions.cs b/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneOptions.cs deleted file mode 100644 index 80a5bdfd656d..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneOptions.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.Maps.TimeZone.Models -{ - /// The TimezoneOptions. - public readonly partial struct TimeZoneOptions : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TimeZoneOptions(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string ZoneInfoValue = "zoneInfo"; - private const string TransitionsValue = "transitions"; - private const string AllValue = "all"; - - /// Do not include zoneinfo or transitions in the result. - public static TimeZoneOptions None { get; } = new TimeZoneOptions(NoneValue); - /// Include additional time zone info in the result. - public static TimeZoneOptions ZoneInfo { get; } = new TimeZoneOptions(ZoneInfoValue); - /// Include transition information in the result (The number of transitions is currently capped at 250). - public static TimeZoneOptions Transitions { get; } = new TimeZoneOptions(TransitionsValue); - /// Include both zoneinfo and transitions in the result. - public static TimeZoneOptions All { get; } = new TimeZoneOptions(AllValue); - /// Determines if two values are the same. - public static bool operator ==(TimeZoneOptions left, TimeZoneOptions right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TimeZoneOptions left, TimeZoneOptions right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator TimeZoneOptions(string value) => new TimeZoneOptions(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TimeZoneOptions other && Equals(other); - /// - public bool Equals(TimeZoneOptions other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimezoneId.cs b/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimezoneId.cs deleted file mode 100644 index 38f951bd21e6..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimezoneId.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Maps.Common; -using Azure.Maps.TimeZone.Models; - -namespace Azure.Maps.TimeZone -{ - /// The TimezoneId. - public partial class TimezoneId - { - /// Initializes a new instance of . - internal TimezoneId() - { - Aliases = new ChangeTrackingList(); - Countries = new ChangeTrackingList(); - TimeTransitions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Id property. - /// - /// An array of time zone ID aliases. Only returned when [options]=*zoneinfo* or *all*. - /// - /// Note: may be null. - /// - /// An array of country/region records. Only returned when [options]=*zoneinfo* or *all*. - /// Timezone names object. - /// Details in effect at the local time. - /// Representative point property. - /// Time zone DST transitions from [transitionsFrom] until timestamp + 1 year. - internal TimezoneId(string id, IReadOnlyList aliases, IReadOnlyList countries, TimeZoneNames names, ReferenceTime referenceTime, RepresentativePoint representativePoint, IReadOnlyList timeTransitions) - { - Id = id; - Aliases = aliases; - Countries = countries; - Names = names; - ReferenceTime = referenceTime; - RepresentativePoint = representativePoint; - TimeTransitions = timeTransitions; - } - - /// Id property. - public string Id { get; } - /// - /// An array of time zone ID aliases. Only returned when [options]=*zoneinfo* or *all*. - /// - /// Note: may be null. - /// - public IReadOnlyList Aliases { get; } - /// An array of country/region records. Only returned when [options]=*zoneinfo* or *all*. - public IReadOnlyList Countries { get; } - /// Timezone names object. - public TimeZoneNames Names { get; } - /// Details in effect at the local time. - public ReferenceTime ReferenceTime { get; } - /// Representative point property. - public RepresentativePoint RepresentativePoint { get; } - /// Time zone DST transitions from [transitionsFrom] until timestamp + 1 year. - public IReadOnlyList TimeTransitions { get; } - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneModelFactory.cs b/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneModelFactory.cs deleted file mode 100644 index 3573a89a00c9..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneModelFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Maps.TimeZone -{ - /// Model factory for models. - [CodeGenModel("MapsTimeZoneModelFactory")] - public static partial class MapsTimeZoneModelFactory - { - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/RepresentativePoint.cs b/sdk/maps/Azure.Maps.TimeZone/src/Models/RepresentativePoint.cs deleted file mode 100644 index cd11be06f540..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/RepresentativePoint.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; -using Azure.Core.GeoJson; - -namespace Azure.Maps.TimeZone.Models -{ - /// Representative point property. - [CodeGenModel("RepresentativePoint")] - public partial class RepresentativePoint - { - [CodeGenMember("Latitude")] - internal float? Latitude { get; } - - [CodeGenMember("Longitude")] - internal float? Longitude { get; } - - /// GeoPosition property. - public GeoPosition geoPosition { get; set; } - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneOptions.cs b/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneOptions.cs deleted file mode 100644 index 6373367c064e..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Maps.TimeZone.Models -{ - /// Options for TimeZone Client. - [CodeGenModel("TimezoneOptions")] - public readonly partial struct TimeZoneOptions - { - } -} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/properties/AssemblyInfo.cs b/sdk/maps/Azure.Maps.TimeZone/src/properties/AssemblyInfo.cs deleted file mode 100644 index 9b803cf5bdd3..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/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: Azure.Core.AzureResourceProviderNamespace("Azure.Maps.TimeZone")] -[assembly: InternalsVisibleTo("Azure.Maps.TimeZone.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/assets.json b/sdk/maps/Azure.Maps.TimeZone/tests/assets.json deleted file mode 100644 index 21bf78ec1522..000000000000 --- a/sdk/maps/Azure.Maps.TimeZone/tests/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "net", - "TagPrefix": "net/maps/Azure.Maps.TimeZone/tests", - "Tag": "net/maps/Azure.Maps.TimeZone/tests_36e0e93072" -} diff --git a/sdk/maps/Azure.Maps.TimeZone/Azure.Maps.TimeZone.sln b/sdk/maps/Azure.Maps.TimeZones/Azure.Maps.TimeZones.sln similarity index 56% rename from sdk/maps/Azure.Maps.TimeZone/Azure.Maps.TimeZone.sln rename to sdk/maps/Azure.Maps.TimeZones/Azure.Maps.TimeZones.sln index 53793e4f98e7..420b99be2967 100644 --- a/sdk/maps/Azure.Maps.TimeZone/Azure.Maps.TimeZone.sln +++ b/sdk/maps/Azure.Maps.TimeZones/Azure.Maps.TimeZones.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32526.322 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Maps.TimeZone", "src\Azure.Maps.TimeZone.csproj", "{086A5E71-2A96-4FB9-801B-A4A0A9A70C49}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Maps.TimeZones", "src\Azure.Maps.TimeZones.csproj", "{0B02F873-2C5C-4809-8549-05E54C09AE4F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Maps.TimeZone.Tests", "tests\Azure.Maps.TimeZone.Tests.csproj", "{47DEA0AC-0636-45D6-98A1-2D1A3EE6A821}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Maps.TimeZones.Tests", "tests\Azure.Maps.TimeZones.Tests.csproj", "{0F031C50-78FB-4F1C-9971-BAB522A6CA31}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,14 +13,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {086A5E71-2A96-4FB9-801B-A4A0A9A70C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {086A5E71-2A96-4FB9-801B-A4A0A9A70C49}.Debug|Any CPU.Build.0 = Debug|Any CPU - {086A5E71-2A96-4FB9-801B-A4A0A9A70C49}.Release|Any CPU.ActiveCfg = Release|Any CPU - {086A5E71-2A96-4FB9-801B-A4A0A9A70C49}.Release|Any CPU.Build.0 = Release|Any CPU - {47DEA0AC-0636-45D6-98A1-2D1A3EE6A821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47DEA0AC-0636-45D6-98A1-2D1A3EE6A821}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47DEA0AC-0636-45D6-98A1-2D1A3EE6A821}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47DEA0AC-0636-45D6-98A1-2D1A3EE6A821}.Release|Any CPU.Build.0 = Release|Any CPU + {0B02F873-2C5C-4809-8549-05E54C09AE4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B02F873-2C5C-4809-8549-05E54C09AE4F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B02F873-2C5C-4809-8549-05E54C09AE4F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B02F873-2C5C-4809-8549-05E54C09AE4F}.Release|Any CPU.Build.0 = Release|Any CPU + {0F031C50-78FB-4F1C-9971-BAB522A6CA31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F031C50-78FB-4F1C-9971-BAB522A6CA31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F031C50-78FB-4F1C-9971-BAB522A6CA31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F031C50-78FB-4F1C-9971-BAB522A6CA31}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/maps/Azure.Maps.TimeZones/CHANGELOG.md b/sdk/maps/Azure.Maps.TimeZones/CHANGELOG.md new file mode 100644 index 000000000000..86004e63198d --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0-beta.1 (2024-12-10) + +### Features Added + +- Initial release diff --git a/sdk/maps/Azure.Maps.TimeZones/Directory.Build.props b/sdk/maps/Azure.Maps.TimeZones/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/maps/Azure.Maps.TimeZone/README.md b/sdk/maps/Azure.Maps.TimeZones/README.md similarity index 76% rename from sdk/maps/Azure.Maps.TimeZone/README.md rename to sdk/maps/Azure.Maps.TimeZones/README.md index 23b5acc64dfa..7da7ac03eede 100644 --- a/sdk/maps/Azure.Maps.TimeZone/README.md +++ b/sdk/maps/Azure.Maps.TimeZones/README.md @@ -2,7 +2,7 @@ Azure Maps TimeZone is a library which contains Azure Maps TimeZone APIs. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZone/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://docs.microsoft.com/rest/api/maps/timezone) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZones/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://learn.microsoft.com/rest/api/maps/timezone) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## Getting started @@ -11,12 +11,12 @@ Azure Maps TimeZone is a library which contains Azure Maps TimeZone APIs. Install the client library for .NET with [NuGet](https://www.nuget.org/): ```dotnetcli -dotnet add package Azure.Maps.TimeZone --prerelease +dotnet add package Azure.Maps.TimeZones --prerelease ``` ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: @@ -34,7 +34,7 @@ There are 3 ways to authenticate the client: Shared key authentication, Microso * Copy `Primary Key` or `Secondary Key` under **Shared Key authentication** section ```C# Snippet:InstantiateTimeZoneClientViaSubscriptionKey -// Create a SearchClient that will authenticate through Subscription Key (Shared key) +// Create a MapsTimeZoneClient that will authenticate through Subscription Key (Shared key) AzureKeyCredential credential = new AzureKeyCredential(""); MapsTimeZoneClient client = new MapsTimeZoneClient(credential); ``` @@ -58,14 +58,13 @@ MapsTimeZoneClient client = new MapsTimeZoneClient(credential, clientId); Shared access signature (SAS) tokens are authentication tokens created using the JSON Web token (JWT) format and are cryptographically signed to prove authentication for an application to the Azure Maps REST API. -Before integrating SAS token authentication, we need to install `Azure.ResourceManager` and `Azure.ResourceManager.Maps` (version `1.1.0-beta.2` or higher): +Before integrating SAS token authentication, we need to install `Azure.ResourceManager` and `Azure.ResourceManager.Maps` (version `1.1.0` or higher): ```powershell dotnet add package Azure.ResourceManager -dotnet add package Azure.ResourceManager.Maps --prerelease +dotnet add package Azure.ResourceManager.Maps ``` - And then we can get SAS token via [List Sas](https://learn.microsoft.com/rest/api/maps-management/accounts/list-sas?tabs=HTTP) API and assign it to `MapsTimeZoneClient`. In the follow code sample, we fetch a specific maps account resource, and create a SAS token for 1 day expiry time when the code is executed. ```C# Snippet:InstantiateTimeZoneClientViaSas @@ -95,7 +94,7 @@ string expiry = now.AddDays(1).ToString("O"); MapsAccountSasContent sasContent = new MapsAccountSasContent(MapsSigningKey.PrimaryKey, principalId, maxRatePerSecond, start, expiry); Response sas = mapsAccount.GetSas(sasContent); -// Create a TimeZoneClient that will authenticate via SAS token +// Create a MapsTimeZoneClient that will authenticate via SAS token AzureSasCredential sasCredential = new AzureSasCredential(sas.Value.AccountSasToken); MapsTimeZoneClient client = new MapsTimeZoneClient(sasCredential); ``` @@ -119,14 +118,16 @@ We guarantee that all client instance methods are thread-safe and independent of ## Examples -You can familiarize yourself with different APIs using our [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZone/samples). +You can familiarize yourself with different APIs using our [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZones/samples). ### Get TimeZone By ID ```C# Snippet:GetTimeZoneById -TimeZoneBaseOptions options = new TimeZoneBaseOptions(); -options.Options = TimeZoneOptions.All; -Response response = client.GetTimeZoneByID("Asia/Bahrain", options); +GetTimeZoneOptions options = new GetTimeZoneOptions() +{ + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All +}; +Response response = client.GetTimeZoneById("Asia/Bahrain", options); Console.WriteLine("Version: " + response.Value.Version); Console.WriteLine("Countires: " + response.Value.TimeZones[0].Countries); ``` @@ -134,57 +135,71 @@ Console.WriteLine("Countires: " + response.Value.TimeZones[0].Countries); ### Get TimeZone By Coordinates ```C# Snippet:GetTimeZoneByCoordinates -TimeZoneBaseOptions options = new TimeZoneBaseOptions(); -options.Options = TimeZoneOptions.All; +GetTimeZoneOptions options = new GetTimeZoneOptions() +{ + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All +}; GeoPosition coordinates = new GeoPosition(121.5640089, 25.0338053); -Response response = client.GetTimeZoneByCoordinates(coordinates, options); -Console.WriteLine("Names: " + response.Value.TimeZones[0].Names); +Response response = client.GetTimeZoneByCoordinates(coordinates, options); + +Console.WriteLine("Time zone for (latitude, longitude) = ({0}, {1}) is {2}: ", + coordinates.Latitude, coordinates.Longitude, + response.Value.TimeZones[0].Name.Generic); ``` ### Get Windows TimeZone Ids ```C# Snippet:GetWindowsTimeZoneIds -Response> response = client.GetWindowsTimeZoneIds(); -Console.WriteLine("Count: " + response.Value.Count); -Console.WriteLine("WindowsId: " + response.Value[0].WindowsId); -Console.WriteLine("Territory: " + response.Value[0].Territory); +Response response = client.GetWindowsTimeZoneIds(); +Console.WriteLine("Total time zones: " + response.Value.WindowsTimeZones.Count); +foreach (WindowsTimeZone timeZone in response.Value.WindowsTimeZones) +{ + Console.WriteLine("IANA Id: " + timeZone.IanaIds); + Console.WriteLine("Windows ID: " + timeZone.WindowsId); + Console.WriteLine("Territory: " + timeZone.Territory); +} ``` ### Get Iana TimeZone Ids -```C# Snippet:GetIanaTimeZoneIds -Response> response = client.GetIanaTimeZoneIds(); -Console.WriteLine("IsAlias: " + response.Value[0].IsAlias); -Console.WriteLine("Id: " + response.Value[0].Id); +```C# Snippet:GetTimeZoneIanaIds +Response response = client.GetTimeZoneIanaIds(); +if (response.Value.IanaIds[0].AliasOf != null) +{ + Console.WriteLine("It is an alias: " + response.Value.IanaIds[0].AliasOf); +} +else +{ + Console.WriteLine("It is not an alias"); +} +Console.WriteLine("IANA Id: " + response.Value.IanaIds[0].Id); ``` ### Get Iana Version ```C# Snippet:GetIanaVersion Response response = client.GetIanaVersion(); -Console.WriteLine("Version: " + response.Value.Version); +Console.WriteLine("IANA Version: " + response.Value.Version); ``` ### Convert Windows TimeZone To Iana ```C# Snippet:ConvertWindowsTimeZoneToIana -Response> response = client.ConvertWindowsTimeZoneToIana("Dateline Standard Time"); -Console.WriteLine("Id: " + response.Value[0].Id); +Response response = client.ConvertWindowsTimeZoneToIana("Dateline Standard Time"); +Console.WriteLine("IANA Id: " + response.Value.IanaIds[0].Id); ``` - ## Troubleshooting ### General -When you interact with the Azure Maps services, errors returned by the service correspond to the same HTTP status codes returned for [REST API requests](https://docs.microsoft.com/rest/api/maps/timezone). - -For example, if you search with an invalid coordinate, a error is returned, indicating "Bad Request".400 +When you interact with the Azure Maps services, errors returned by the service correspond to the same HTTP status codes returned for [REST API requests](https://learn.microsoft.com/rest/api/maps/timezone). +For example, if you search with an invalid coordinate, a error is returned, indicating "Bad Request". ## Next steps -* For more context and additional scenarios, please see: [detailed samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZone/samples) +* For more context and additional scenarios, please see: [detailed samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZones/samples) ## Contributing @@ -196,4 +211,4 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.TimeZone/README.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/maps/Azure.Maps.TimeZones/README.png) diff --git a/sdk/maps/Azure.Maps.TimeZones/api/Azure.Maps.TimeZones.net8.0.cs b/sdk/maps/Azure.Maps.TimeZones/api/Azure.Maps.TimeZones.net8.0.cs new file mode 100644 index 000000000000..1eab3a62d414 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/api/Azure.Maps.TimeZones.net8.0.cs @@ -0,0 +1,152 @@ +namespace Azure.Maps.TimeZones +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AdditionalTimeZoneReturnInformation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AdditionalTimeZoneReturnInformation(string value) { throw null; } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation All { get { throw null; } } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation None { get { throw null; } } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation Transitions { get { throw null; } } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation ZoneInfo { get { throw null; } } + public bool Equals(Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation 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.Maps.TimeZones.AdditionalTimeZoneReturnInformation left, Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation right) { throw null; } + public static implicit operator Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation (string value) { throw null; } + public static bool operator !=(Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation left, Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CountryRecord + { + internal CountryRecord() { } + public string Code { get { throw null; } } + public string Name { get { throw null; } } + } + public partial class GetTimeZoneOptions + { + public GetTimeZoneOptions() { } + public string AcceptLanguage { get { throw null; } set { } } + public Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation? AdditionalTimeZoneReturnInformation { get { throw null; } set { } } + public System.DateTimeOffset? DaylightSavingsTimeTransitionFrom { get { throw null; } set { } } + public int? DaylightSavingsTimeTransitionInYears { get { throw null; } set { } } + public System.DateTimeOffset? TimeStamp { get { throw null; } set { } } + } + public partial class IanaId + { + internal IanaId() { } + public string AliasOf { get { throw null; } } + public bool? HasZone1970Location { get { throw null; } } + public string Id { get { throw null; } } + } + public partial class IanaIdData + { + internal IanaIdData() { } + public System.Collections.Generic.IReadOnlyList IanaIds { get { throw null; } } + } + public partial class MapsTimeZoneClient + { + protected MapsTimeZoneClient() { } + public MapsTimeZoneClient(Azure.AzureKeyCredential credential) { } + public MapsTimeZoneClient(Azure.AzureKeyCredential credential, Azure.Maps.TimeZones.MapsTimeZoneClientOptions options) { } + public MapsTimeZoneClient(Azure.AzureSasCredential credential, Azure.Maps.TimeZones.MapsTimeZoneClientOptions options = null) { } + public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId) { } + public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId, Azure.Maps.TimeZones.MapsTimeZoneClientOptions options) { } + public virtual Azure.Response ConvertWindowsTimeZoneToIana(string windowsTimeZoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ConvertWindowsTimeZoneToIanaAsync(string windowsTimeZoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIanaVersion(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIanaVersionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTimeZoneByCoordinates(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTimeZoneByCoordinatesAsync(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTimeZoneById(string timeZoneId, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTimeZoneByIdAsync(string timeZoneId, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTimeZoneIanaIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTimeZoneIanaIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWindowsTimeZoneIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWindowsTimeZoneIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MapsTimeZoneClientOptions : Azure.Core.ClientOptions + { + public MapsTimeZoneClientOptions(Azure.Maps.TimeZones.MapsTimeZoneClientOptions.ServiceVersion version = Azure.Maps.TimeZones.MapsTimeZoneClientOptions.ServiceVersion.V1_0) { } + public System.Uri Endpoint { get { throw null; } set { } } + public enum ServiceVersion + { + V1_0 = 1, + } + } + public static partial class MapsTimeZonesModelFactory + { + public static Azure.Maps.TimeZones.CountryRecord CountryRecord(string name = null, string code = null) { throw null; } + public static Azure.Maps.TimeZones.TimeZoneIanaVersionResult TimeZoneIanaVersionResult(string version = null) { throw null; } + public static Azure.Maps.TimeZones.TimeZoneName TimeZoneName(string iso6391LanguageCode = null, string generic = null, string standard = null, string daylight = null) { throw null; } + public static Azure.Maps.TimeZones.TimeZoneResult TimeZoneResult(string version = null, System.DateTimeOffset? referenceUtcTimestamp = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable timeZones = null) { throw null; } + public static Azure.Maps.TimeZones.WindowsTimeZone WindowsTimeZone(string windowsId = null, string territory = null, System.Collections.Generic.IEnumerable ianaIds = null) { throw null; } + } + public partial class ReferenceTime + { + internal ReferenceTime() { } + public System.TimeSpan DaylightSavingsOffset { get { throw null; } } + public string PosixTimeZone { get { throw null; } } + public int? PosixTimeZoneValidYear { get { throw null; } } + public System.TimeSpan StandardOffset { get { throw null; } } + public System.DateTimeOffset? Sunrise { get { throw null; } } + public System.DateTimeOffset? Sunset { get { throw null; } } + public string Tag { get { throw null; } } + public System.DateTimeOffset WallTime { get { throw null; } } + } + public partial class TimeTransition + { + internal TimeTransition() { } + public System.TimeSpan DaylightSavingsOffset { get { throw null; } } + public System.TimeSpan StandardOffset { get { throw null; } } + public string Tag { get { throw null; } } + public System.DateTimeOffset? UtcEnd { get { throw null; } } + public System.DateTimeOffset? UtcStart { get { throw null; } } + } + public partial class TimeZoneIanaVersionResult + { + internal TimeZoneIanaVersionResult() { } + public string Version { get { throw null; } } + } + public partial class TimeZoneId + { + internal TimeZoneId() { } + public System.Collections.Generic.IReadOnlyList Aliases { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Countries { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Maps.TimeZones.TimeZoneName Name { get { throw null; } } + public Azure.Maps.TimeZones.ReferenceTime ReferenceTime { get { throw null; } } + public Azure.Core.GeoJson.GeoPosition RepresentativePoint { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TimeTransitions { get { throw null; } } + } + public partial class TimeZoneName + { + internal TimeZoneName() { } + public string Daylight { get { throw null; } } + public string Generic { get { throw null; } } + public string Iso6391LanguageCode { get { throw null; } } + public string Standard { get { throw null; } } + } + public partial class TimeZoneResult + { + internal TimeZoneResult() { } + public System.DateTimeOffset? ReferenceUtcTimestamp { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TimeZones { get { throw null; } } + public string Version { get { throw null; } } + } + public partial class WindowsTimeZone + { + internal WindowsTimeZone() { } + public System.Collections.Generic.IReadOnlyList IanaIds { get { throw null; } } + public string Territory { get { throw null; } } + public string WindowsId { get { throw null; } } + } + public partial class WindowsTimeZoneData + { + internal WindowsTimeZoneData() { } + public System.Collections.Generic.IReadOnlyList WindowsTimeZones { get { throw null; } } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZones/api/Azure.Maps.TimeZones.netstandard2.0.cs b/sdk/maps/Azure.Maps.TimeZones/api/Azure.Maps.TimeZones.netstandard2.0.cs new file mode 100644 index 000000000000..1eab3a62d414 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/api/Azure.Maps.TimeZones.netstandard2.0.cs @@ -0,0 +1,152 @@ +namespace Azure.Maps.TimeZones +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AdditionalTimeZoneReturnInformation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AdditionalTimeZoneReturnInformation(string value) { throw null; } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation All { get { throw null; } } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation None { get { throw null; } } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation Transitions { get { throw null; } } + public static Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation ZoneInfo { get { throw null; } } + public bool Equals(Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation 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.Maps.TimeZones.AdditionalTimeZoneReturnInformation left, Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation right) { throw null; } + public static implicit operator Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation (string value) { throw null; } + public static bool operator !=(Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation left, Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CountryRecord + { + internal CountryRecord() { } + public string Code { get { throw null; } } + public string Name { get { throw null; } } + } + public partial class GetTimeZoneOptions + { + public GetTimeZoneOptions() { } + public string AcceptLanguage { get { throw null; } set { } } + public Azure.Maps.TimeZones.AdditionalTimeZoneReturnInformation? AdditionalTimeZoneReturnInformation { get { throw null; } set { } } + public System.DateTimeOffset? DaylightSavingsTimeTransitionFrom { get { throw null; } set { } } + public int? DaylightSavingsTimeTransitionInYears { get { throw null; } set { } } + public System.DateTimeOffset? TimeStamp { get { throw null; } set { } } + } + public partial class IanaId + { + internal IanaId() { } + public string AliasOf { get { throw null; } } + public bool? HasZone1970Location { get { throw null; } } + public string Id { get { throw null; } } + } + public partial class IanaIdData + { + internal IanaIdData() { } + public System.Collections.Generic.IReadOnlyList IanaIds { get { throw null; } } + } + public partial class MapsTimeZoneClient + { + protected MapsTimeZoneClient() { } + public MapsTimeZoneClient(Azure.AzureKeyCredential credential) { } + public MapsTimeZoneClient(Azure.AzureKeyCredential credential, Azure.Maps.TimeZones.MapsTimeZoneClientOptions options) { } + public MapsTimeZoneClient(Azure.AzureSasCredential credential, Azure.Maps.TimeZones.MapsTimeZoneClientOptions options = null) { } + public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId) { } + public MapsTimeZoneClient(Azure.Core.TokenCredential credential, string clientId, Azure.Maps.TimeZones.MapsTimeZoneClientOptions options) { } + public virtual Azure.Response ConvertWindowsTimeZoneToIana(string windowsTimeZoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ConvertWindowsTimeZoneToIanaAsync(string windowsTimeZoneId, string windowsTerritoryCode = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIanaVersion(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIanaVersionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTimeZoneByCoordinates(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTimeZoneByCoordinatesAsync(Azure.Core.GeoJson.GeoPosition coordinates, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTimeZoneById(string timeZoneId, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTimeZoneByIdAsync(string timeZoneId, Azure.Maps.TimeZones.GetTimeZoneOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTimeZoneIanaIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTimeZoneIanaIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWindowsTimeZoneIds(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWindowsTimeZoneIdsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MapsTimeZoneClientOptions : Azure.Core.ClientOptions + { + public MapsTimeZoneClientOptions(Azure.Maps.TimeZones.MapsTimeZoneClientOptions.ServiceVersion version = Azure.Maps.TimeZones.MapsTimeZoneClientOptions.ServiceVersion.V1_0) { } + public System.Uri Endpoint { get { throw null; } set { } } + public enum ServiceVersion + { + V1_0 = 1, + } + } + public static partial class MapsTimeZonesModelFactory + { + public static Azure.Maps.TimeZones.CountryRecord CountryRecord(string name = null, string code = null) { throw null; } + public static Azure.Maps.TimeZones.TimeZoneIanaVersionResult TimeZoneIanaVersionResult(string version = null) { throw null; } + public static Azure.Maps.TimeZones.TimeZoneName TimeZoneName(string iso6391LanguageCode = null, string generic = null, string standard = null, string daylight = null) { throw null; } + public static Azure.Maps.TimeZones.TimeZoneResult TimeZoneResult(string version = null, System.DateTimeOffset? referenceUtcTimestamp = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable timeZones = null) { throw null; } + public static Azure.Maps.TimeZones.WindowsTimeZone WindowsTimeZone(string windowsId = null, string territory = null, System.Collections.Generic.IEnumerable ianaIds = null) { throw null; } + } + public partial class ReferenceTime + { + internal ReferenceTime() { } + public System.TimeSpan DaylightSavingsOffset { get { throw null; } } + public string PosixTimeZone { get { throw null; } } + public int? PosixTimeZoneValidYear { get { throw null; } } + public System.TimeSpan StandardOffset { get { throw null; } } + public System.DateTimeOffset? Sunrise { get { throw null; } } + public System.DateTimeOffset? Sunset { get { throw null; } } + public string Tag { get { throw null; } } + public System.DateTimeOffset WallTime { get { throw null; } } + } + public partial class TimeTransition + { + internal TimeTransition() { } + public System.TimeSpan DaylightSavingsOffset { get { throw null; } } + public System.TimeSpan StandardOffset { get { throw null; } } + public string Tag { get { throw null; } } + public System.DateTimeOffset? UtcEnd { get { throw null; } } + public System.DateTimeOffset? UtcStart { get { throw null; } } + } + public partial class TimeZoneIanaVersionResult + { + internal TimeZoneIanaVersionResult() { } + public string Version { get { throw null; } } + } + public partial class TimeZoneId + { + internal TimeZoneId() { } + public System.Collections.Generic.IReadOnlyList Aliases { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Countries { get { throw null; } } + public string Id { get { throw null; } } + public Azure.Maps.TimeZones.TimeZoneName Name { get { throw null; } } + public Azure.Maps.TimeZones.ReferenceTime ReferenceTime { get { throw null; } } + public Azure.Core.GeoJson.GeoPosition RepresentativePoint { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TimeTransitions { get { throw null; } } + } + public partial class TimeZoneName + { + internal TimeZoneName() { } + public string Daylight { get { throw null; } } + public string Generic { get { throw null; } } + public string Iso6391LanguageCode { get { throw null; } } + public string Standard { get { throw null; } } + } + public partial class TimeZoneResult + { + internal TimeZoneResult() { } + public System.DateTimeOffset? ReferenceUtcTimestamp { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TimeZones { get { throw null; } } + public string Version { get { throw null; } } + } + public partial class WindowsTimeZone + { + internal WindowsTimeZone() { } + public System.Collections.Generic.IReadOnlyList IanaIds { get { throw null; } } + public string Territory { get { throw null; } } + public string WindowsId { get { throw null; } } + } + public partial class WindowsTimeZoneData + { + internal WindowsTimeZoneData() { } + public System.Collections.Generic.IReadOnlyList WindowsTimeZones { get { throw null; } } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZones/assets.json b/sdk/maps/Azure.Maps.TimeZones/assets.json new file mode 100644 index 000000000000..913b3bd328f5 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/maps/Azure.Maps.TimeZones", + "Tag": "net/maps/Azure.Maps.TimeZones_057c460226" +} diff --git a/sdk/maps/Azure.Maps.TimeZones/samples/MapsTimeZoneSamples.md b/sdk/maps/Azure.Maps.TimeZones/samples/MapsTimeZoneSamples.md new file mode 100644 index 000000000000..ae5e7d58dd04 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/samples/MapsTimeZoneSamples.md @@ -0,0 +1,135 @@ +# TimeZone Samples + +To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZones#getting-started) for details. + +## Import the namespaces + +```C# Snippet:TimeZoneImportNamespaces +using Azure.Maps.TimeZones; +``` + +## Create TimeZone Client + +Before searching addresses, create a `MapsTimeZoneClient` first. Either use subscription key, Microsoft Entra or SAS token for authentication. + +Instantiate time zone client with subscription key: + +```C# Snippet:InstantiateTimeZoneClientViaSubscriptionKey +// Create a MapsTimeZoneClient that will authenticate through Subscription Key (Shared key) +AzureKeyCredential credential = new AzureKeyCredential(""); +MapsTimeZoneClient client = new MapsTimeZoneClient(credential); +``` + +Instantiate route client via Microsoft Entra authentication: + +```C# Snippet:InstantiateTimeZoneClientViaMicrosoftEntra +// Create a MapsTimeZoneClient that will authenticate through MicrosoftEntra +DefaultAzureCredential credential = new DefaultAzureCredential(); +string clientId = ""; +MapsTimeZoneClient client = new MapsTimeZoneClient(credential, clientId); +``` + +Instantiate time zone client with SAS token: + +```C# Snippet:InstantiateTimeZoneClientViaSas +// Get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line +TokenCredential cred = new DefaultAzureCredential(); +// Authenticate your client +ArmClient armClient = new ArmClient(cred); + +string subscriptionId = "MyMapsSubscriptionId"; +string resourceGroupName = "MyMapsResourceGroupName"; +string accountName = "MyMapsAccountName"; + +// Get maps account resource +ResourceIdentifier mapsAccountResourceId = MapsAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); +MapsAccountResource mapsAccount = armClient.GetMapsAccountResource(mapsAccountResourceId); + +// Assign SAS token information +// Every time you want to SAS token, update the principal ID, max rate, start and expiry time +string principalId = "MyManagedIdentityObjectId"; +int maxRatePerSecond = 500; + +// Set start and expiry time for the SAS token in round-trip date/time format +DateTime now = DateTime.Now; +string start = now.ToString("O"); +string expiry = now.AddDays(1).ToString("O"); + +MapsAccountSasContent sasContent = new MapsAccountSasContent(MapsSigningKey.PrimaryKey, principalId, maxRatePerSecond, start, expiry); +Response sas = mapsAccount.GetSas(sasContent); + +// Create a MapsTimeZoneClient that will authenticate via SAS token +AzureSasCredential sasCredential = new AzureSasCredential(sas.Value.AccountSasToken); +MapsTimeZoneClient client = new MapsTimeZoneClient(sasCredential); +``` + +## Examples + +### Get TimeZone By ID + +```C# Snippet:GetTimeZoneById +GetTimeZoneOptions options = new GetTimeZoneOptions() +{ + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All +}; +Response response = client.GetTimeZoneById("Asia/Bahrain", options); +Console.WriteLine("Version: " + response.Value.Version); +Console.WriteLine("Countires: " + response.Value.TimeZones[0].Countries); +``` + +### Get TimeZone By Coordinates + +```C# Snippet:GetTimeZoneByCoordinates +GetTimeZoneOptions options = new GetTimeZoneOptions() +{ + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All +}; +GeoPosition coordinates = new GeoPosition(121.5640089, 25.0338053); +Response response = client.GetTimeZoneByCoordinates(coordinates, options); + +Console.WriteLine("Time zone for (latitude, longitude) = ({0}, {1}) is {2}: ", + coordinates.Latitude, coordinates.Longitude, + response.Value.TimeZones[0].Name.Generic); +``` + +### Get Windows TimeZone Ids + +```C# Snippet:GetWindowsTimeZoneIds +Response response = client.GetWindowsTimeZoneIds(); +Console.WriteLine("Total time zones: " + response.Value.WindowsTimeZones.Count); +foreach (WindowsTimeZone timeZone in response.Value.WindowsTimeZones) +{ + Console.WriteLine("IANA Id: " + timeZone.IanaIds); + Console.WriteLine("Windows ID: " + timeZone.WindowsId); + Console.WriteLine("Territory: " + timeZone.Territory); +} +``` + +### Get Iana TimeZone Ids + +```C# Snippet:GetTimeZoneIanaIds +Response response = client.GetTimeZoneIanaIds(); +if (response.Value.IanaIds[0].AliasOf != null) +{ + Console.WriteLine("It is an alias: " + response.Value.IanaIds[0].AliasOf); +} +else +{ + Console.WriteLine("It is not an alias"); +} +Console.WriteLine("IANA Id: " + response.Value.IanaIds[0].Id); +``` + +### Get Iana Version + +```C# Snippet:GetIanaVersion +Response response = client.GetIanaVersion(); +Console.WriteLine("IANA Version: " + response.Value.Version); +``` + +### Convert Windows TimeZone To Iana + +```C# Snippet:ConvertWindowsTimeZoneToIana +Response response = client.ConvertWindowsTimeZoneToIana("Dateline Standard Time"); +Console.WriteLine("IANA Id: " + response.Value.IanaIds[0].Id); +``` diff --git a/sdk/maps/Azure.Maps.TimeZones/samples/README.md b/sdk/maps/Azure.Maps.TimeZones/samples/README.md new file mode 100644 index 000000000000..ce104699bf3d --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/samples/README.md @@ -0,0 +1,16 @@ +--- +page_type: sample +languages: +- csharp +products: +- azure +- azure-maps +name: Azure.Maps.TimeZones samples for .NET +description: Samples for the Azure.Maps.TimeZones client library. +--- + +# Azure.Maps.TimeZones Samples + +For different APIs, please refer the following samples: + +[Timezone](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/maps/Azure.Maps.TimeZones/samples/MapsTimeZoneSamples.md) diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Azure.Maps.TimeZone.csproj b/sdk/maps/Azure.Maps.TimeZones/src/Azure.Maps.TimeZones.csproj similarity index 81% rename from sdk/maps/Azure.Maps.TimeZone/src/Azure.Maps.TimeZone.csproj rename to sdk/maps/Azure.Maps.TimeZones/src/Azure.Maps.TimeZones.csproj index 011bbdb20d55..ca2342bdeaa7 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Azure.Maps.TimeZone.csproj +++ b/sdk/maps/Azure.Maps.TimeZones/src/Azure.Maps.TimeZones.csproj @@ -1,9 +1,9 @@ - + - Azure Maps Azure.Maps.TimeZone - Azure Maps Azure.Maps.TimeZone - 1.0.0-beta.1 - Azure;Azure Maps;Maps Azure.Maps.TimeZone + Azure Maps Time Zone SDK + Azure Maps Azure.Maps.TimeZones + 1.0.0-beta.2 + Azure;Azure Maps;Maps;Azure.Maps.TimeZones $(RequiredTargetFrameworks) $(NoWarn);AZC0012 $(RepoRoot)/sdk/maps/Azure.Maps.Common/src/ diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/Argument.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/Argument.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/Argument.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/Argument.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/ChangeTrackingDictionary.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/ChangeTrackingDictionary.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/ChangeTrackingDictionary.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/ChangeTrackingList.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/ChangeTrackingList.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/ChangeTrackingList.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/ChangeTrackingList.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/ModelSerializationExtensions.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/ModelSerializationExtensions.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/ModelSerializationExtensions.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/MultipartFormDataRequestContent.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/MultipartFormDataRequestContent.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/MultipartFormDataRequestContent.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/MultipartFormDataRequestContent.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/Optional.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/Optional.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/Optional.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/Optional.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/RequestContentHelper.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/RequestContentHelper.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/RequestContentHelper.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/RequestContentHelper.cs diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/Utf8JsonRequestContent.cs similarity index 100% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Internal/Utf8JsonRequestContent.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Internal/Utf8JsonRequestContent.cs diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Generated/MapsTimeZonesModelFactory.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/MapsTimeZonesModelFactory.cs new file mode 100644 index 000000000000..5bc18064e739 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/MapsTimeZonesModelFactory.cs @@ -0,0 +1,69 @@ +// 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.Maps.TimeZones +{ + /// Model factory for models. + public static partial class MapsTimeZonesModelFactory + { + /// Initializes a new instance of . + /// Version property. + /// Reference Utc Timestamp property. + /// TimeZoneId array. + /// A new instance for mocking. + public static TimeZoneResult TimeZoneResult(string version = null, DateTimeOffset? referenceUtcTimestamp = null, IEnumerable timeZones = null) + { + timeZones ??= new List(); + + return new TimeZoneResult(version, referenceUtcTimestamp, timeZones?.ToList()); + } + + /// Initializes a new instance of . + /// country/region Name. + /// ISO-3166 2-letter country/region code for the country/region. + /// A new instance for mocking. + public static CountryRecord CountryRecord(string name = null, string code = null) + { + return new CountryRecord(name, code); + } + + /// Initializes a new instance of . + /// The ISO 639-1 language code of the Names. + /// Generic Name. + /// Standard Name. + /// Daylight Name. + /// A new instance for mocking. + public static TimeZoneName TimeZoneName(string iso6391LanguageCode = null, string generic = null, string standard = null, string daylight = null) + { + return new TimeZoneName(iso6391LanguageCode, generic, standard, daylight); + } + + /// Initializes a new instance of . + /// Windows Id property. + /// Territory property. + /// IanaIds array. + /// A new instance for mocking. + public static WindowsTimeZone WindowsTimeZone(string windowsId = null, string territory = null, IEnumerable ianaIds = null) + { + ianaIds ??= new List(); + + return new WindowsTimeZone(windowsId, territory, ianaIds?.ToList()); + } + + /// Initializes a new instance of . + /// Version property. + /// A new instance for mocking. + public static TimeZoneIanaVersionResult TimeZoneIanaVersionResult(string version = null) + { + return new TimeZoneIanaVersionResult(version); + } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/AdditionalTimeZoneReturnInformation.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/AdditionalTimeZoneReturnInformation.cs new file mode 100644 index 000000000000..21acb20e71e9 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/AdditionalTimeZoneReturnInformation.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Maps.TimeZones +{ + /// The TimezoneOptions. + public readonly partial struct AdditionalTimeZoneReturnInformation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AdditionalTimeZoneReturnInformation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string ZoneInfoValue = "zoneInfo"; + private const string TransitionsValue = "transitions"; + private const string AllValue = "all"; + + /// Do not include zoneinfo or transitions in the result. + public static AdditionalTimeZoneReturnInformation None { get; } = new AdditionalTimeZoneReturnInformation(NoneValue); + /// Include additional time zone info in the result. + public static AdditionalTimeZoneReturnInformation ZoneInfo { get; } = new AdditionalTimeZoneReturnInformation(ZoneInfoValue); + /// Include transition information in the result (The number of transitions is currently capped at 250). + public static AdditionalTimeZoneReturnInformation Transitions { get; } = new AdditionalTimeZoneReturnInformation(TransitionsValue); + /// Include both zoneinfo and transitions in the result. + public static AdditionalTimeZoneReturnInformation All { get; } = new AdditionalTimeZoneReturnInformation(AllValue); + /// Determines if two values are the same. + public static bool operator ==(AdditionalTimeZoneReturnInformation left, AdditionalTimeZoneReturnInformation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AdditionalTimeZoneReturnInformation left, AdditionalTimeZoneReturnInformation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AdditionalTimeZoneReturnInformation(string value) => new AdditionalTimeZoneReturnInformation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AdditionalTimeZoneReturnInformation other && Equals(other); + /// + public bool Equals(AdditionalTimeZoneReturnInformation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/CountryRecord.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/CountryRecord.Serialization.cs similarity index 97% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/CountryRecord.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/CountryRecord.Serialization.cs index 82cf7472207d..bdcacb99f671 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/CountryRecord.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/CountryRecord.Serialization.cs @@ -7,7 +7,7 @@ using System.Text.Json; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { public partial class CountryRecord { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/CountryRecord.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/CountryRecord.cs similarity index 96% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/CountryRecord.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/CountryRecord.cs index 4ee164825715..4ed1cc623ab7 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/CountryRecord.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/CountryRecord.cs @@ -5,7 +5,7 @@ #nullable disable -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// A country/region record. public partial class CountryRecord diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs similarity index 98% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs index fb2d450e9a55..3cad0dee6918 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs @@ -8,7 +8,7 @@ using System.Text.Json; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { internal partial class ErrorAdditionalInfo { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 96% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorAdditionalInfo.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorAdditionalInfo.cs index b03b505b4d7e..77a35fc0dd39 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorAdditionalInfo.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorAdditionalInfo.cs @@ -5,7 +5,7 @@ #nullable disable -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// The resource management error additional info. internal partial class ErrorAdditionalInfo diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorDetail.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorDetail.Serialization.cs similarity index 99% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorDetail.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorDetail.Serialization.cs index 902fd17f1e1b..ef5621e741c8 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorDetail.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorDetail.Serialization.cs @@ -9,7 +9,7 @@ using System.Text.Json; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { internal partial class ErrorDetail { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorDetail.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorDetail.cs similarity index 98% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorDetail.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorDetail.cs index 9dd1eb2ee010..1bda4d2492f6 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorDetail.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorDetail.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// The error detail. internal partial class ErrorDetail diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorResponse.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorResponse.Serialization.cs similarity index 97% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorResponse.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorResponse.Serialization.cs index 5b04ebd50c4a..584b1e1b68ae 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorResponse.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorResponse.Serialization.cs @@ -7,7 +7,7 @@ using System.Text.Json; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { internal partial class ErrorResponse { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorResponse.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorResponse.cs similarity index 96% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorResponse.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorResponse.cs index 96f25033b795..39f77527dc6e 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ErrorResponse.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ErrorResponse.cs @@ -5,7 +5,7 @@ #nullable disable -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). internal partial class ErrorResponse diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/IanaId.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/IanaId.Serialization.cs similarity index 98% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/IanaId.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/IanaId.Serialization.cs index d71d73bcdf3d..97560f274a5d 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/IanaId.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/IanaId.Serialization.cs @@ -7,7 +7,7 @@ using System.Text.Json; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { public partial class IanaId { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/IanaId.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/IanaId.cs similarity index 85% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/IanaId.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/IanaId.cs index 9c817cdeebfe..1ef423fa0507 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/IanaId.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/IanaId.cs @@ -5,7 +5,7 @@ #nullable disable -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// The IanaId. public partial class IanaId @@ -30,10 +30,6 @@ internal IanaId(string id, bool? isAlias, string aliasOf, bool? hasZone1970Locat /// Id property. public string Id { get; } - /// IsAlias property. - public bool? IsAlias { get; } - /// AliasOf property. - public string AliasOf { get; } /// This attribute returns `True` if the IanaId has any country/zone associated with it. public bool? HasZone1970Location { get; } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/JsonFormat.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/JsonFormat.cs similarity index 98% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/JsonFormat.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/JsonFormat.cs index 72f5ff28cc44..23faedc7ebc5 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/JsonFormat.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/JsonFormat.cs @@ -8,7 +8,7 @@ using System; using System.ComponentModel; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// The JsonFormat. internal readonly partial struct JsonFormat : IEquatable diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ReferenceTime.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ReferenceTime.Serialization.cs similarity index 99% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ReferenceTime.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ReferenceTime.Serialization.cs index 18d737727eb1..8000eccd81f6 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ReferenceTime.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ReferenceTime.Serialization.cs @@ -9,7 +9,7 @@ using System.Text.Json; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { public partial class ReferenceTime { diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ReferenceTime.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ReferenceTime.cs new file mode 100644 index 000000000000..701e0ded6a7b --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/ReferenceTime.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Maps.TimeZones +{ + /// Details in effect at the local time. + public partial class ReferenceTime + { + /// Initializes a new instance of . + internal ReferenceTime() + { + } + + /// Time zone name in effect at the reference timestamp (i.e. PST or PDT depending whether Daylight Savings Time is in effect). + public string Tag { get; } + /// Sunrise at the given time zone as shown in the `Tag` property. The sunrise is described in the ISO8601 format. (Only be populated if the call is byCoordinates). + public DateTimeOffset? Sunrise { get; } + /// Sunset at the given time zone as shown in the `Tag` property. The sunset is described in the ISO8601 format.(Only be populated if the call is byCoordinates). + public DateTimeOffset? Sunset { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/RepresentativePoint.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/RepresentativePoint.Serialization.cs similarity index 95% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/RepresentativePoint.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/RepresentativePoint.Serialization.cs index 94cb3d6e40a1..488ab86d3177 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/RepresentativePoint.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/RepresentativePoint.Serialization.cs @@ -7,9 +7,9 @@ using System.Text.Json; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - public partial class RepresentativePoint + internal partial class RepresentativePoint { internal static RepresentativePoint DeserializeRepresentativePoint(JsonElement element) { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/RepresentativePoint.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/RepresentativePoint.cs similarity index 74% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/RepresentativePoint.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/RepresentativePoint.cs index 0dd8c997a9fd..a97af36c7da3 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/RepresentativePoint.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/RepresentativePoint.cs @@ -5,10 +5,10 @@ #nullable disable -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// Representative point property. - public partial class RepresentativePoint + internal partial class RepresentativePoint { /// Initializes a new instance of . internal RepresentativePoint() @@ -23,5 +23,10 @@ internal RepresentativePoint(float? latitude, float? longitude) Latitude = latitude; Longitude = longitude; } + + /// Latitude property. + public float? Latitude { get; } + /// Longitude property. + public float? Longitude { get; } } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeTransition.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeTransition.Serialization.cs similarity index 98% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeTransition.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeTransition.Serialization.cs index 8b470cd6a496..5d2874516b30 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeTransition.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeTransition.Serialization.cs @@ -9,7 +9,7 @@ using System.Text.Json; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { public partial class TimeTransition { diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeTransition.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeTransition.cs new file mode 100644 index 000000000000..6cf8c6a181c5 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeTransition.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Maps.TimeZones +{ + /// The TimeTransition. + public partial class TimeTransition + { + /// Initializes a new instance of . + internal TimeTransition() + { + } + + /// Tag property. + public string Tag { get; } + /// Start date, start time for this transition period. + public DateTimeOffset? UtcStart { get; } + /// End date, end time for this transition period. + public DateTimeOffset? UtcEnd { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneIanaVersionResult.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneIanaVersionResult.Serialization.cs similarity index 97% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneIanaVersionResult.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneIanaVersionResult.Serialization.cs index 59d232d93b85..0fd007cbba72 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneIanaVersionResult.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneIanaVersionResult.Serialization.cs @@ -7,7 +7,7 @@ using System.Text.Json; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { public partial class TimeZoneIanaVersionResult { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneIanaVersionResult.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneIanaVersionResult.cs similarity index 95% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneIanaVersionResult.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneIanaVersionResult.cs index ee5cc9b1f7e5..35a6acf7057f 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneIanaVersionResult.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneIanaVersionResult.cs @@ -5,7 +5,7 @@ #nullable disable -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// This object is returned from a successful Timezone IANA Version call. public partial class TimeZoneIanaVersionResult diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimezoneId.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneId.Serialization.cs similarity index 88% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimezoneId.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneId.Serialization.cs index 2c2596a67084..3402a7cc51d2 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimezoneId.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneId.Serialization.cs @@ -8,13 +8,12 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Maps.Common; -using Azure.Maps.TimeZone.Models; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { - public partial class TimezoneId + public partial class TimeZoneId { - internal static TimezoneId DeserializeTimezoneId(JsonElement element) + internal static TimeZoneId DeserializeTimeZoneId(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { @@ -23,7 +22,7 @@ internal static TimezoneId DeserializeTimezoneId(JsonElement element) string id = default; IReadOnlyList aliases = default; IReadOnlyList countries = default; - TimeZoneNames names = default; + TimeZoneName names = default; ReferenceTime referenceTime = default; RepresentativePoint representativePoint = default; IReadOnlyList timeTransitions = default; @@ -68,7 +67,7 @@ internal static TimezoneId DeserializeTimezoneId(JsonElement element) { continue; } - names = TimeZoneNames.DeserializeTimeZoneNames(property.Value); + names = TimeZoneName.DeserializeTimeZoneName(property.Value); continue; } if (property.NameEquals("ReferenceTime"u8)) @@ -86,7 +85,7 @@ internal static TimezoneId DeserializeTimezoneId(JsonElement element) { continue; } - representativePoint = RepresentativePoint.DeserializeRepresentativePoint(property.Value); + representativePoint = TimeZones.RepresentativePoint.DeserializeRepresentativePoint(property.Value); continue; } if (property.NameEquals("TimeTransitions"u8)) @@ -104,7 +103,7 @@ internal static TimezoneId DeserializeTimezoneId(JsonElement element) continue; } } - return new TimezoneId( + return new TimeZoneId( id, aliases ?? new ChangeTrackingList(), countries ?? new ChangeTrackingList(), @@ -116,10 +115,10 @@ internal static TimezoneId DeserializeTimezoneId(JsonElement element) /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TimezoneId FromResponse(Response response) + internal static TimeZoneId FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTimezoneId(document.RootElement); + return DeserializeTimeZoneId(document.RootElement); } } } diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneId.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneId.cs new file mode 100644 index 000000000000..37f5bba44d76 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneId.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Maps.Common; + +namespace Azure.Maps.TimeZones +{ + /// The TimezoneId. + public partial class TimeZoneId + { + /// Initializes a new instance of . + internal TimeZoneId() + { + Aliases = new ChangeTrackingList(); + Countries = new ChangeTrackingList(); + TimeTransitions = new ChangeTrackingList(); + } + + /// Id property. + public string Id { get; } + /// + /// An array of time zone ID aliases. Only returned when [options]=*zoneinfo* or *all*. + /// + /// Note: may be null. + /// + public IReadOnlyList Aliases { get; } + /// An array of country/region records. Only returned when [options]=*zoneinfo* or *all*. + public IReadOnlyList Countries { get; } + /// Details in effect at the local time. + public ReferenceTime ReferenceTime { get; } + /// Time zone DST transitions from [transitionsFrom] until timestamp + 1 year. + public IReadOnlyList TimeTransitions { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneNames.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneName.Serialization.cs similarity index 80% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneNames.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneName.Serialization.cs index fd405e12e1bf..a2cea44ccbc6 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneNames.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneName.Serialization.cs @@ -7,11 +7,11 @@ using System.Text.Json; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - public partial class TimeZoneNames + public partial class TimeZoneName { - internal static TimeZoneNames DeserializeTimeZoneNames(JsonElement element) + internal static TimeZoneName DeserializeTimeZoneName(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { @@ -44,15 +44,15 @@ internal static TimeZoneNames DeserializeTimeZoneNames(JsonElement element) continue; } } - return new TimeZoneNames(isO6391LanguageCode, generic, standard, daylight); + return new TimeZoneName(isO6391LanguageCode, generic, standard, daylight); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TimeZoneNames FromResponse(Response response) + internal static TimeZoneName FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTimeZoneNames(document.RootElement); + return DeserializeTimeZoneName(document.RootElement); } } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneNames.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneName.cs similarity index 79% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneNames.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneName.cs index 76dce915611a..bc045f9f7b21 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneNames.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneName.cs @@ -5,22 +5,22 @@ #nullable disable -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// Timezone names object. - public partial class TimeZoneNames + public partial class TimeZoneName { - /// Initializes a new instance of . - internal TimeZoneNames() + /// Initializes a new instance of . + internal TimeZoneName() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The ISO 639-1 language code of the Names. /// Generic Name. /// Standard Name. /// Daylight Name. - internal TimeZoneNames(string iso6391LanguageCode, string generic, string standard, string daylight) + internal TimeZoneName(string iso6391LanguageCode, string generic, string standard, string daylight) { Iso6391LanguageCode = iso6391LanguageCode; Generic = generic; diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneInformation.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneResult.Serialization.cs similarity index 74% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneInformation.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneResult.Serialization.cs index 0c920e3b787a..22d2bde8c8ee 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneInformation.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneResult.Serialization.cs @@ -10,11 +10,11 @@ using System.Text.Json; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - public partial class TimeZoneInformation + public partial class TimeZoneResult { - internal static TimeZoneInformation DeserializeTimeZoneInformation(JsonElement element) + internal static TimeZoneResult DeserializeTimeZoneResult(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { @@ -22,7 +22,7 @@ internal static TimeZoneInformation DeserializeTimeZoneInformation(JsonElement e } string version = default; DateTimeOffset? referenceUtcTimestamp = default; - IReadOnlyList timeZones = default; + IReadOnlyList timeZones = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("Version"u8)) @@ -45,24 +45,24 @@ internal static TimeZoneInformation DeserializeTimeZoneInformation(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(TimezoneId.DeserializeTimezoneId(item)); + array.Add(TimeZoneId.DeserializeTimeZoneId(item)); } timeZones = array; continue; } } - return new TimeZoneInformation(version, referenceUtcTimestamp, timeZones ?? new ChangeTrackingList()); + return new TimeZoneResult(version, referenceUtcTimestamp, timeZones ?? new ChangeTrackingList()); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TimeZoneInformation FromResponse(Response response) + internal static TimeZoneResult FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTimeZoneInformation(document.RootElement); + return DeserializeTimeZoneResult(document.RootElement); } } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneInformation.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneResult.cs similarity index 71% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneInformation.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneResult.cs index 18a089b02fed..f6825227ff6b 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneInformation.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/TimeZoneResult.cs @@ -9,22 +9,22 @@ using System.Collections.Generic; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// This object is returned from a successful Timezone By ID call or By Coordinates call. - public partial class TimeZoneInformation + public partial class TimeZoneResult { - /// Initializes a new instance of . - internal TimeZoneInformation() + /// Initializes a new instance of . + internal TimeZoneResult() { - TimeZones = new ChangeTrackingList(); + TimeZones = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Version property. /// Reference Utc Timestamp property. /// TimeZoneId array. - internal TimeZoneInformation(string version, DateTimeOffset? referenceUtcTimestamp, IReadOnlyList timeZones) + internal TimeZoneResult(string version, DateTimeOffset? referenceUtcTimestamp, IReadOnlyList timeZones) { Version = version; ReferenceUtcTimestamp = referenceUtcTimestamp; @@ -36,6 +36,6 @@ internal TimeZoneInformation(string version, DateTimeOffset? referenceUtcTimesta /// Reference Utc Timestamp property. public DateTimeOffset? ReferenceUtcTimestamp { get; } /// TimeZoneId array. - public IReadOnlyList TimeZones { get; } + public IReadOnlyList TimeZones { get; } } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneWindows.Serialization.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/WindowsTimeZone.Serialization.cs similarity index 83% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneWindows.Serialization.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/WindowsTimeZone.Serialization.cs index 94d11774a7fe..95e61dd45d7c 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneWindows.Serialization.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/WindowsTimeZone.Serialization.cs @@ -9,11 +9,11 @@ using System.Text.Json; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - public partial class TimeZoneWindows + public partial class WindowsTimeZone { - internal static TimeZoneWindows DeserializeTimeZoneWindows(JsonElement element) + internal static WindowsTimeZone DeserializeWindowsTimeZone(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { @@ -49,15 +49,15 @@ internal static TimeZoneWindows DeserializeTimeZoneWindows(JsonElement element) continue; } } - return new TimeZoneWindows(windowsId, territory, ianaIds ?? new ChangeTrackingList()); + return new WindowsTimeZone(windowsId, territory, ianaIds ?? new ChangeTrackingList()); } /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static TimeZoneWindows FromResponse(Response response) + internal static WindowsTimeZone FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeTimeZoneWindows(document.RootElement); + return DeserializeWindowsTimeZone(document.RootElement); } } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneWindows.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/WindowsTimeZone.cs similarity index 72% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneWindows.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/WindowsTimeZone.cs index e3d04b9d20b0..bb6e00981a8f 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/TimeZoneWindows.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/Models/WindowsTimeZone.cs @@ -8,22 +8,22 @@ using System.Collections.Generic; using Azure.Maps.Common; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// The TimezoneWindows. - public partial class TimeZoneWindows + public partial class WindowsTimeZone { - /// Initializes a new instance of . - internal TimeZoneWindows() + /// Initializes a new instance of . + internal WindowsTimeZone() { IanaIds = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Windows Id property. /// Territory property. /// IanaIds array. - internal TimeZoneWindows(string windowsId, string territory, IReadOnlyList ianaIds) + internal WindowsTimeZone(string windowsId, string territory, IReadOnlyList ianaIds) { WindowsId = windowsId; Territory = territory; diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/TimezoneRestClient.cs b/sdk/maps/Azure.Maps.TimeZones/src/Generated/TimezoneRestClient.cs similarity index 91% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/TimezoneRestClient.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Generated/TimezoneRestClient.cs index c21764207a89..55cf290ecd6c 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/TimezoneRestClient.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Generated/TimezoneRestClient.cs @@ -13,9 +13,8 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.Maps.Common; -using Azure.Maps.TimeZone.Models; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { internal partial class TimezoneRestClient { @@ -43,7 +42,7 @@ public TimezoneRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipe _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); } - internal HttpMessage CreateGetTimezoneByIDRequest(JsonFormat format, string timezoneId, string acceptLanguage, TimeZoneOptions? options, DateTimeOffset? timeStamp, DateTimeOffset? daylightSavingsTimeFrom, int? daylightSavingsTimeLastingYears) + internal HttpMessage CreateGetTimezoneByIDRequest(JsonFormat format, string timezoneId, string acceptLanguage, AdditionalTimeZoneReturnInformation? options, DateTimeOffset? timeStamp, DateTimeOffset? daylightSavingsTimeFrom, int? daylightSavingsTimeLastingYears) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -97,7 +96,7 @@ internal HttpMessage CreateGetTimezoneByIDRequest(JsonFormat format, string time /// /// The `Get Timezone By ID` API is an HTTP `GET` request that returns current, historical, and future time zone information for the specified IANA time zone ID. /// - public async Task> GetTimezoneByIDAsync(JsonFormat format, string timezoneId, string acceptLanguage = null, TimeZoneOptions? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) + public async Task> GetTimezoneByIDAsync(JsonFormat format, string timezoneId, string acceptLanguage = null, AdditionalTimeZoneReturnInformation? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) { if (timezoneId == null) { @@ -110,9 +109,9 @@ public async Task> GetTimezoneByIDAsync(JsonFormat { case 200: { - TimeZoneInformation value = default; + TimeZoneResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TimeZoneInformation.DeserializeTimeZoneInformation(document.RootElement); + value = TimeZoneResult.DeserializeTimeZoneResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -134,7 +133,7 @@ public async Task> GetTimezoneByIDAsync(JsonFormat /// /// The `Get Timezone By ID` API is an HTTP `GET` request that returns current, historical, and future time zone information for the specified IANA time zone ID. /// - public Response GetTimezoneByID(JsonFormat format, string timezoneId, string acceptLanguage = null, TimeZoneOptions? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) + public Response GetTimezoneByID(JsonFormat format, string timezoneId, string acceptLanguage = null, AdditionalTimeZoneReturnInformation? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) { if (timezoneId == null) { @@ -147,9 +146,9 @@ public Response GetTimezoneByID(JsonFormat format, string t { case 200: { - TimeZoneInformation value = default; + TimeZoneResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TimeZoneInformation.DeserializeTimeZoneInformation(document.RootElement); + value = TimeZoneResult.DeserializeTimeZoneResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -157,7 +156,7 @@ public Response GetTimezoneByID(JsonFormat format, string t } } - internal HttpMessage CreateGetTimezoneByCoordinatesRequest(JsonFormat format, IEnumerable coordinates, string acceptLanguage, TimeZoneOptions? options, DateTimeOffset? timeStamp, DateTimeOffset? daylightSavingsTimeFrom, int? daylightSavingsTimeLastingYears) + internal HttpMessage CreateGetTimezoneByCoordinatesRequest(JsonFormat format, IEnumerable coordinates, string acceptLanguage, AdditionalTimeZoneReturnInformation? options, DateTimeOffset? timeStamp, DateTimeOffset? daylightSavingsTimeFrom, int? daylightSavingsTimeLastingYears) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -214,7 +213,7 @@ internal HttpMessage CreateGetTimezoneByCoordinatesRequest(JsonFormat format, IE /// /// The `Get Timezone By Coordinates` API is an HTTP `GET` request that returns current, historical, and future time zone information for a specified latitude-longitude pair. In addition, the API provides sunset and sunrise times for a given location. /// - public async Task> GetTimezoneByCoordinatesAsync(JsonFormat format, IEnumerable coordinates, string acceptLanguage = null, TimeZoneOptions? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) + public async Task> GetTimezoneByCoordinatesAsync(JsonFormat format, IEnumerable coordinates, string acceptLanguage = null, AdditionalTimeZoneReturnInformation? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) { if (coordinates == null) { @@ -227,9 +226,9 @@ public async Task> GetTimezoneByCoordinatesAsync(J { case 200: { - TimeZoneInformation value = default; + TimeZoneResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TimeZoneInformation.DeserializeTimeZoneInformation(document.RootElement); + value = TimeZoneResult.DeserializeTimeZoneResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -251,7 +250,7 @@ public async Task> GetTimezoneByCoordinatesAsync(J /// /// The `Get Timezone By Coordinates` API is an HTTP `GET` request that returns current, historical, and future time zone information for a specified latitude-longitude pair. In addition, the API provides sunset and sunrise times for a given location. /// - public Response GetTimezoneByCoordinates(JsonFormat format, IEnumerable coordinates, string acceptLanguage = null, TimeZoneOptions? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) + public Response GetTimezoneByCoordinates(JsonFormat format, IEnumerable coordinates, string acceptLanguage = null, AdditionalTimeZoneReturnInformation? options = null, DateTimeOffset? timeStamp = null, DateTimeOffset? daylightSavingsTimeFrom = null, int? daylightSavingsTimeLastingYears = null, CancellationToken cancellationToken = default) { if (coordinates == null) { @@ -264,9 +263,9 @@ public Response GetTimezoneByCoordinates(JsonFormat format, { case 200: { - TimeZoneInformation value = default; + TimeZoneResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TimeZoneInformation.DeserializeTimeZoneInformation(document.RootElement); + value = TimeZoneResult.DeserializeTimeZoneResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -300,7 +299,7 @@ internal HttpMessage CreateGetWindowsTimezoneIdsRequest(JsonFormat format) /// /// The `Get Windows Time Zones` API is an HTTP `GET` request that returns a full list of Windows Time Zone IDs. /// - public async Task>> GetWindowsTimezoneIdsAsync(JsonFormat format, CancellationToken cancellationToken = default) + public async Task>> GetWindowsTimezoneIdsAsync(JsonFormat format, CancellationToken cancellationToken = default) { using var message = CreateGetWindowsTimezoneIdsRequest(format); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -308,12 +307,12 @@ public async Task>> GetWindowsTimezoneId { case 200: { - IReadOnlyList value = default; + IReadOnlyList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); + List array = new List(); foreach (var item in document.RootElement.EnumerateArray()) { - array.Add(TimeZoneWindows.DeserializeTimeZoneWindows(item)); + array.Add(WindowsTimeZone.DeserializeWindowsTimeZone(item)); } value = array; return Response.FromValue(value, message.Response); @@ -330,7 +329,7 @@ public async Task>> GetWindowsTimezoneId /// /// The `Get Windows Time Zones` API is an HTTP `GET` request that returns a full list of Windows Time Zone IDs. /// - public Response> GetWindowsTimezoneIds(JsonFormat format, CancellationToken cancellationToken = default) + public Response> GetWindowsTimezoneIds(JsonFormat format, CancellationToken cancellationToken = default) { using var message = CreateGetWindowsTimezoneIdsRequest(format); _pipeline.Send(message, cancellationToken); @@ -338,12 +337,12 @@ public Response> GetWindowsTimezoneIds(JsonFormat { case 200: { - IReadOnlyList value = default; + IReadOnlyList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); + List array = new List(); foreach (var item in document.RootElement.EnumerateArray()) { - array.Add(TimeZoneWindows.DeserializeTimeZoneWindows(item)); + array.Add(WindowsTimeZone.DeserializeWindowsTimeZone(item)); } value = array; return Response.FromValue(value, message.Response); diff --git a/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneClient.cs b/sdk/maps/Azure.Maps.TimeZones/src/MapsTimeZoneClient.cs similarity index 76% rename from sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneClient.cs rename to sdk/maps/Azure.Maps.TimeZones/src/MapsTimeZoneClient.cs index ac312e159f2d..ce35a3fd7657 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneClient.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/MapsTimeZoneClient.cs @@ -12,9 +12,8 @@ using Azure.Core.GeoJson; using Azure.Core.Pipeline; using Azure.Maps.Common; -using Azure.Maps.TimeZone.Models.Options; -using Azure.Maps.TimeZone.Models; -namespace Azure.Maps.TimeZone + +namespace Azure.Maps.TimeZones { /// The Render service client. public partial class MapsTimeZoneClient @@ -56,7 +55,7 @@ public MapsTimeZoneClient(AzureKeyCredential credential, MapsTimeZoneClientOptio { Argument.AssertNotNull(credential, nameof(credential)); - var endpoint = options.Endpoint ?? new Uri("https://atlas.microsoft.com"); + var endpoint = options?.Endpoint ?? new Uri("https://atlas.microsoft.com"); options ??= new MapsTimeZoneClientOptions(); _clientDiagnostics = new ClientDiagnostics(options); _pipeline = HttpPipelineBuilder.Build(options, new AzureKeyCredentialPolicy(credential, "subscription-key")); @@ -86,7 +85,7 @@ public MapsTimeZoneClient(TokenCredential credential, string clientId, MapsTimeZ { Argument.AssertNotNull(credential, nameof(credential)); - var endpoint = options.Endpoint ?? new Uri("https://atlas.microsoft.com"); + var endpoint = options?.Endpoint ?? new Uri("https://atlas.microsoft.com"); options ??= new MapsTimeZoneClientOptions(); _clientDiagnostics = new ClientDiagnostics(options); string[] scopes = { "https://atlas.microsoft.com/.default" }; @@ -97,26 +96,12 @@ public MapsTimeZoneClient(TokenCredential credential, string clientId, MapsTimeZ /// Initializes a new instance of MapsTimeZoneClient. /// The Shared Access Signature credential used to connect to Azure. This signature /// can be constructed using the . - public MapsTimeZoneClient(AzureSasCredential credential) - { - Argument.AssertNotNull(credential, nameof(credential)); - - var endpoint = new Uri("https://atlas.microsoft.com"); - var options = new MapsTimeZoneClientOptions(); - _clientDiagnostics = new ClientDiagnostics(options); - _pipeline = HttpPipelineBuilder.Build(options, new MapsSasCredentialPolicy(credential)); - restClient = new TimezoneRestClient(_clientDiagnostics, _pipeline, endpoint, null, options.Version); - } - - /// Initializes a new instance of MapsTimeZoneClient. - /// The Shared Access Signature credential used to connect to Azure. This signature - /// can be constructed using the . - /// The options for configuring the client. - public MapsTimeZoneClient(AzureSasCredential credential, MapsTimeZoneClientOptions options) + /// The options for configuring the client. If options is null, default option settings will be applied. + public MapsTimeZoneClient(AzureSasCredential credential, MapsTimeZoneClientOptions options = null) { Argument.AssertNotNull(credential, nameof(credential)); - var endpoint = options.Endpoint; + var endpoint = options?.Endpoint ?? new Uri("https://atlas.microsoft.com"); options ??= new MapsTimeZoneClientOptions(); _clientDiagnostics = new ClientDiagnostics(options); _pipeline = HttpPipelineBuilder.Build(options, new MapsSasCredentialPolicy(credential)); @@ -141,17 +126,17 @@ internal MapsTimeZoneClient(ClientDiagnostics clientDiagnostics, HttpPipeline pi /// /// This API returns current, historical, and future time zone information for the specified IANA time zone ID. /// - /// The IANA time zone ID. + /// The IANA time zone ID. /// Contains parameters for get timezone by id. /// The cancellation token to use. - /// is null. - public virtual async Task> GetTimeZoneByIDAsync(string timezoneId, TimeZoneBaseOptions options, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> GetTimeZoneByIdAsync(string timeZoneId, GetTimeZoneOptions options, CancellationToken cancellationToken = default) { - using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneByID"); + using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneById"); scope.Start(); try { - return await restClient.GetTimezoneByIDAsync(JsonFormat.Json, timezoneId, options.AcceptLanguage, options?.Options, options?.TimeStamp, options?.DaylightSavingsTimeFrom, options?.DaylightSavingsTimeLastingYears, cancellationToken).ConfigureAwait(false); + return await restClient.GetTimezoneByIDAsync(JsonFormat.Json, timeZoneId, options.AcceptLanguage, options?.AdditionalTimeZoneReturnInformation, options?.TimeStamp, options?.DaylightSavingsTimeTransitionFrom, options?.DaylightSavingsTimeTransitionInYears, cancellationToken).ConfigureAwait(false); } catch (Exception e) { @@ -163,17 +148,17 @@ public virtual async Task> GetTimeZoneByIDAsync(st /// /// This API returns current, historical, and future time zone information for the specified IANA time zone ID. /// - /// The IANA time zone ID. + /// The IANA time zone ID. /// Contains parameters for get timezone by id. /// The cancellation token to use. - /// is null. - public virtual Response GetTimeZoneByID(string timezoneId, TimeZoneBaseOptions options, CancellationToken cancellationToken = default) + /// is null. + public virtual Response GetTimeZoneById(string timeZoneId, GetTimeZoneOptions options, CancellationToken cancellationToken = default) { - using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneByID"); + using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneById"); scope.Start(); try { - return restClient.GetTimezoneByID(JsonFormat.Json, timezoneId, options.AcceptLanguage, options?.Options, options?.TimeStamp, options?.DaylightSavingsTimeFrom, options?.DaylightSavingsTimeLastingYears, cancellationToken); + return restClient.GetTimezoneByID(JsonFormat.Json, timeZoneId, options.AcceptLanguage, options?.AdditionalTimeZoneReturnInformation, options?.TimeStamp, options?.DaylightSavingsTimeTransitionFrom, options?.DaylightSavingsTimeTransitionInYears, cancellationToken); } catch (Exception e) { @@ -189,7 +174,7 @@ public virtual Response GetTimeZoneByID(string timezoneId, /// Contains parameters for get timezone by id. /// The cancellation token to use. /// is null. - public virtual async Task> GetTimeZoneByCoordinatesAsync(GeoPosition coordinates, TimeZoneBaseOptions options, CancellationToken cancellationToken = default) + public virtual async Task> GetTimeZoneByCoordinatesAsync(GeoPosition coordinates, GetTimeZoneOptions options, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneByCoordinates"); scope.Start(); @@ -200,7 +185,16 @@ public virtual async Task> GetTimeZoneByCoordinate Convert.ToDouble(coordinates.Latitude, CultureInfo.InvariantCulture.NumberFormat), Convert.ToDouble(coordinates.Longitude, CultureInfo.InvariantCulture.NumberFormat) }; - return await restClient.GetTimezoneByCoordinatesAsync(JsonFormat.Json, coord, options.AcceptLanguage, options?.Options, options?.TimeStamp, options?.DaylightSavingsTimeFrom, options?.DaylightSavingsTimeLastingYears, cancellationToken).ConfigureAwait(false); + return await restClient.GetTimezoneByCoordinatesAsync( + JsonFormat.Json, + coord, + options.AcceptLanguage, + options?.AdditionalTimeZoneReturnInformation, + options?.TimeStamp, + options?.DaylightSavingsTimeTransitionFrom, + options?.DaylightSavingsTimeTransitionInYears, + cancellationToken + ).ConfigureAwait(false); } catch (Exception e) { @@ -216,7 +210,7 @@ public virtual async Task> GetTimeZoneByCoordinate /// Contains parameters for get timezone by id. /// The cancellation token to use. /// is null. - public virtual Response GetTimeZoneByCoordinates(GeoPosition coordinates, TimeZoneBaseOptions options, CancellationToken cancellationToken = default) + public virtual Response GetTimeZoneByCoordinates(GeoPosition coordinates, GetTimeZoneOptions options, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneByCoordinates"); scope.Start(); @@ -227,7 +221,16 @@ public virtual Response GetTimeZoneByCoordinates(GeoPositio Convert.ToDouble(coordinates.Latitude, CultureInfo.InvariantCulture.NumberFormat), Convert.ToDouble(coordinates.Longitude, CultureInfo.InvariantCulture.NumberFormat) }; - return restClient.GetTimezoneByCoordinates(JsonFormat.Json, coord, options.AcceptLanguage, options?.Options, options?.TimeStamp, options?.DaylightSavingsTimeFrom, options?.DaylightSavingsTimeLastingYears, cancellationToken); + return restClient.GetTimezoneByCoordinates( + JsonFormat.Json, + coord, + options.AcceptLanguage, + options?.AdditionalTimeZoneReturnInformation, + options?.TimeStamp, + options?.DaylightSavingsTimeTransitionFrom, + options?.DaylightSavingsTimeTransitionInYears, + cancellationToken + ); } catch (Exception e) { @@ -240,13 +243,15 @@ public virtual Response GetTimeZoneByCoordinates(GeoPositio /// Use to get the list of Windows Time Zone IDs. /// /// The cancellation token to use. - public virtual async Task>> GetWindowsTimeZoneIdsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetWindowsTimeZoneIdsAsync(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetWindowsTimeZoneIds"); scope.Start(); try { - return await restClient.GetWindowsTimezoneIdsAsync(JsonFormat.Json, cancellationToken).ConfigureAwait(false); + Response> response = await restClient.GetWindowsTimezoneIdsAsync(JsonFormat.Json, cancellationToken).ConfigureAwait(false); + var value = new WindowsTimeZoneData(response.Value); + return Response.FromValue(value, response.GetRawResponse()); } catch (Exception e) { @@ -259,13 +264,15 @@ public virtual async Task>> GetWindowsTi /// Use to get the list of Windows time zone IDs. /// /// The cancellation token to use. - public virtual Response> GetWindowsTimeZoneIds(CancellationToken cancellationToken = default) + public virtual Response GetWindowsTimeZoneIds(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetWindowsTimeZoneIds"); scope.Start(); try { - return restClient.GetWindowsTimezoneIds(JsonFormat.Json, cancellationToken); + Response> response = restClient.GetWindowsTimezoneIds(JsonFormat.Json, cancellationToken); + var value = new WindowsTimeZoneData(response.Value); + return Response.FromValue(value, response.GetRawResponse()); } catch (Exception e) { @@ -281,13 +288,15 @@ public virtual Response> GetWindowsTimeZoneIds(Ca /// /// The Get IANA Time Zones API is an HTTP GET request that returns a full list of Internet Assigned Numbers Authority (IANA) time zone IDs. Updates to the IANA service are reflected in the system within one day. /// - public virtual async Task>> GetIanaTimeZoneIdsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetTimeZoneIanaIdsAsync(CancellationToken cancellationToken = default) { - using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetIanaTimeZoneIds"); + using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneIanaIds"); scope.Start(); try { - return await restClient.GetIanaTimezoneIdsAsync(JsonFormat.Json, cancellationToken).ConfigureAwait(false); + Response> response = await restClient.GetIanaTimezoneIdsAsync(JsonFormat.Json, cancellationToken).ConfigureAwait(false); + var value = new IanaIdData(response.Value); + return Response.FromValue(value, response.GetRawResponse()); } catch (Exception e) { @@ -303,13 +312,15 @@ public virtual async Task>> GetIanaTimeZoneIdsAsy /// /// The Get IANA Time Zones API is an HTTP GET request that returns a full list of Internet Assigned Numbers Authority (IANA) time zone IDs. Updates to the IANA service are reflected in the system within one day. /// - public virtual Response> GetIanaTimeZoneIds(CancellationToken cancellationToken = default) + public virtual Response GetTimeZoneIanaIds(CancellationToken cancellationToken = default) { - using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetIanaTimeZoneIds"); + using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.GetTimeZoneIanaIds"); scope.Start(); try { - return restClient.GetIanaTimezoneIds(JsonFormat.Json, cancellationToken); + Response> response = restClient.GetIanaTimezoneIds(JsonFormat.Json, cancellationToken); + var value = new IanaIdData(response.Value); + return Response.FromValue(value, response.GetRawResponse()); } catch (Exception e) { @@ -365,20 +376,22 @@ public virtual Response GetIanaVersion(CancellationTo /// /// Use to get the IANA ID. /// - /// The Windows time zone ID. + /// The Windows time zone ID. /// Windows Time Zone territory code. /// The cancellation token to use. - /// is null. + /// is null. /// /// The `Get Windows to IANA Time Zone` API is an HTTP `GET` request that returns a corresponding Internet Assigned Numbers Authority (IANA) ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be returned for a single Windows ID. It is possible to narrow these results by adding an optional territory parameter. /// - public virtual async Task>> ConvertWindowsTimeZoneToIanaAsync(string windowsTimezoneId, string windowsTerritoryCode = null, CancellationToken cancellationToken = default) + public virtual async Task> ConvertWindowsTimeZoneToIanaAsync(string windowsTimeZoneId, string windowsTerritoryCode = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.ConvertWindowsTimeZoneToIana"); scope.Start(); try { - return await restClient.ConvertWindowsTimezoneToIanaAsync(JsonFormat.Json, windowsTimezoneId, windowsTerritoryCode, cancellationToken).ConfigureAwait(false); + Response> response = await restClient.ConvertWindowsTimezoneToIanaAsync(JsonFormat.Json, windowsTimeZoneId, windowsTerritoryCode, cancellationToken).ConfigureAwait(false); + var value = new IanaIdData(response.Value); + return Response.FromValue(value, response.GetRawResponse()); } catch (Exception e) { @@ -390,20 +403,22 @@ public virtual async Task>> ConvertWindowsTimeZon /// /// Use to get the IANA ID. /// - /// The Windows time zone ID. + /// The Windows time zone ID. /// Windows Time Zone territory code. /// The cancellation token to use. - /// is null. + /// is null. /// /// The Get Windows to IANA Time Zone API is an HTTP GET request that returns a corresponding Internet Assigned Numbers Authority (IANA) ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be returned for a single Windows ID. It is possible to narrow these results by adding an optional territory parameter. /// - public virtual Response> ConvertWindowsTimeZoneToIana(string windowsTimezoneId, string windowsTerritoryCode = null, CancellationToken cancellationToken = default) + public virtual Response ConvertWindowsTimeZoneToIana(string windowsTimeZoneId, string windowsTerritoryCode = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("MapsTimeZoneClient.ConvertWindowsTimeZoneToIana"); scope.Start(); try { - return restClient.ConvertWindowsTimezoneToIana(JsonFormat.Json, windowsTimezoneId, windowsTerritoryCode, cancellationToken); + Response> response = restClient.ConvertWindowsTimezoneToIana(JsonFormat.Json, windowsTimeZoneId, windowsTerritoryCode, cancellationToken); + var value = new IanaIdData(response.Value); + return Response.FromValue(value, response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneClientOptions.cs b/sdk/maps/Azure.Maps.TimeZones/src/MapsTimeZoneClientOptions.cs similarity index 86% rename from sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneClientOptions.cs rename to sdk/maps/Azure.Maps.TimeZones/src/MapsTimeZoneClientOptions.cs index 20b85f0268de..1b2a08180519 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/MapsTimeZoneClientOptions.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/MapsTimeZoneClientOptions.cs @@ -7,7 +7,7 @@ using System; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// Client options for MapsRenderClient. public partial class MapsTimeZoneClientOptions : Azure.Core.ClientOptions @@ -28,15 +28,13 @@ public enum ServiceVersion /// Initializes new instance of MapsTimeZoneClientOptions. /// Azure Maps TimeZone API version. - /// The endpoint for Azure Maps. - public MapsTimeZoneClientOptions(ServiceVersion version = LatestVersion, Uri endpoint = null) + public MapsTimeZoneClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { ServiceVersion.V1_0 => "1.0", _ => throw new NotSupportedException() }; - Endpoint = endpoint; } } } diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/AdditionalTimeZoneReturnInformation.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/AdditionalTimeZoneReturnInformation.cs new file mode 100644 index 000000000000..4ac65195d749 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/AdditionalTimeZoneReturnInformation.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.Maps.TimeZones +{ + /// Options available for types of information returned in the result. + [CodeGenModel("TimezoneOptions")] + public readonly partial struct AdditionalTimeZoneReturnInformation + { + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/Options/TimeZoneBaseOptions.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/GetTimeZoneOptions.cs similarity index 68% rename from sdk/maps/Azure.Maps.TimeZone/src/Models/Options/TimeZoneBaseOptions.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/GetTimeZoneOptions.cs index c7b0c62674b6..090a3979250f 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/Options/TimeZoneBaseOptions.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/GetTimeZoneOptions.cs @@ -2,26 +2,26 @@ // Licensed under the MIT License. using System; -using Azure.Maps.TimeZone; +using Azure.Maps.TimeZones; -namespace Azure.Maps.TimeZone.Models.Options +namespace Azure.Maps.TimeZones { /// Options for TimeZone Client. - public class TimeZoneBaseOptions + public class GetTimeZoneOptions { /// Specifies the language code in which the timezone names should be returned. Please refer to Supported Languages public string AcceptLanguage { get; set; } - /// Options available for types of information returned in the result. - public TimeZoneOptions? Options { get; set; } + /// Options available for types of additional information returned in the result. + public AdditionalTimeZoneReturnInformation? AdditionalTimeZoneReturnInformation { get; set; } /// Reference time, if omitted, the API will use the machine time serving the request. public DateTimeOffset? TimeStamp { get; set; } /// The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions. - public DateTimeOffset? DaylightSavingsTimeFrom { get; set; } + public DateTimeOffset? DaylightSavingsTimeTransitionFrom { get; set; } /// The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions. - public int? DaylightSavingsTimeLastingYears { get; set; } + public int? DaylightSavingsTimeTransitionInYears { get; set; } } } diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/IanaId.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/IanaId.cs new file mode 100644 index 000000000000..9cdd6310f5a1 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/IanaId.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Maps.TimeZones +{ + /// The IanaId. + public partial class IanaId + { + /// IsAlias property. + internal bool? IsAlias { get; } + + /// Alias of the IANA ID. Will be null if there's no alias for the IANA ID. + public string AliasOf { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/IanaIdData.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/IanaIdData.cs new file mode 100644 index 000000000000..2dfb07d07e2a --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/IanaIdData.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Maps.TimeZones +{ + /// The Iana IDs information. + public partial class IanaIdData + { + /// Initializes a new instance of . + internal IanaIdData(IReadOnlyList ianaIds) + { + IanaIds = ianaIds; + } + + /// The list of IANA IDs. + public IReadOnlyList IanaIds { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/JsonFormat.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/JsonFormat.cs similarity index 76% rename from sdk/maps/Azure.Maps.TimeZone/src/Models/JsonFormat.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/JsonFormat.cs index 6c7c1f1c9daa..96242d48afeb 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/JsonFormat.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/JsonFormat.cs @@ -3,10 +3,9 @@ using Azure.Core; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// The JsonFormat. - [CodeGenModel("JsonFormat")] internal readonly partial struct JsonFormat { } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ReferenceTime.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/ReferenceTime.cs similarity index 54% rename from sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ReferenceTime.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/ReferenceTime.cs index e1da6feb3784..060e98afc38c 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Generated/Models/ReferenceTime.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/ReferenceTime.cs @@ -1,22 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// - #nullable disable using System; +using Azure.Core; -namespace Azure.Maps.TimeZone +namespace Azure.Maps.TimeZones { /// Details in effect at the local time. public partial class ReferenceTime { - /// Initializes a new instance of . - internal ReferenceTime() - { - } - /// Initializes a new instance of . /// Time zone name in effect at the reference timestamp (i.e. PST or PDT depending whether Daylight Savings Time is in effect). /// UTC offset in effect at the `ReferenceUTCTimestamp`. @@ -29,30 +23,51 @@ internal ReferenceTime() internal ReferenceTime(string tag, string standardOffset, string daylightSavings, string wallTime, int? posixTzValidYear, string posixTz, DateTimeOffset? sunrise, DateTimeOffset? sunset) { Tag = tag; - StandardOffset = standardOffset; - DaylightSavings = daylightSavings; - WallTime = wallTime; - PosixTzValidYear = posixTzValidYear; - PosixTz = posixTz; + _standardOffset = standardOffset; + if (TimeSpan.TryParse(standardOffset, out TimeSpan StandardOffsetValue)) + { + StandardOffset = StandardOffsetValue; + } + + _daylightSavings = daylightSavings; + if (TimeSpan.TryParse(daylightSavings, out TimeSpan DaylightSavingsValue)) + { + DaylightSavingsOffset = DaylightSavingsValue; + } + + _wallTime = wallTime; + if (DateTimeOffset.TryParse(wallTime, out DateTimeOffset WallTimeValue)) + { + WallTime = WallTimeValue; + } + + PosixTimeZoneValidYear = posixTzValidYear; + PosixTimeZone = posixTz; Sunrise = sunrise; Sunset = sunset; } - /// Time zone name in effect at the reference timestamp (i.e. PST or PDT depending whether Daylight Savings Time is in effect). - public string Tag { get; } - /// UTC offset in effect at the `ReferenceUTCTimestamp`. - public string StandardOffset { get; } - /// Time saving in minutes in effect at the `ReferenceUTCTimestamp`. - public string DaylightSavings { get; } - /// Current wall time at the given time zone as shown in the `Tag` property. - public string WallTime { get; } + [CodeGenMember("StandardOffset")] + internal string _standardOffset { get; } + /// UTC offset in format in effect at the ReferenceUTCTimestamp. + public TimeSpan StandardOffset { get; } + + [CodeGenMember("DaylightSavings")] + internal string _daylightSavings { get; } + /// Time saving in format in effect at the ReferenceUTCTimestamp. + public TimeSpan DaylightSavingsOffset { get; } + + /// Current wall time at the given time zone as shown in the Tag property. + [CodeGenMember("WallTime")] + internal string _wallTime { get; } + /// Current wall time at the given time zone as shown in the Tag property. + public DateTimeOffset WallTime { get; } + /// The year this POSIX string is valid for. Note: A POSIX string will only be valid in the given year. - public int? PosixTzValidYear { get; } + [CodeGenMember("PosixTzValidYear")] + public int? PosixTimeZoneValidYear { get; } /// POSIX string used to set the time zone environment variable. - public string PosixTz { get; } - /// Sunrise at the given time zone as shown in the `Tag` property. The sunrise is described in the ISO8601 format. (Only be populated if the call is byCoordinates). - public DateTimeOffset? Sunrise { get; } - /// Sunset at the given time zone as shown in the `Tag` property. The sunset is described in the ISO8601 format.(Only be populated if the call is byCoordinates). - public DateTimeOffset? Sunset { get; } + [CodeGenMember("PosixTz")] + public string PosixTimeZone { get; } } } diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/RepresentativePoint.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/RepresentativePoint.cs new file mode 100644 index 000000000000..450d8c38abe4 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/RepresentativePoint.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Maps.TimeZones +{ + /// Representative point property. + internal partial class RepresentativePoint + { + } +} diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeTransition.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeTransition.cs new file mode 100644 index 000000000000..0b058daf1ce1 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeTransition.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Maps.TimeZones +{ + /// The TimeTransition. + public partial class TimeTransition + { + /// Initializes a new instance of . + /// Tag property. + /// StandardOffset property. + /// DaylightSavings property. + /// Start date, start time for this transition period. + /// End date, end time for this transition period. + internal TimeTransition(string tag, string standardOffset, string daylightSavings, DateTimeOffset? utcStart, DateTimeOffset? utcEnd) + { + Tag = tag; + + _standardOffset = standardOffset; + if (TimeSpan.TryParse(standardOffset, out TimeSpan StandardOffsetValue)) + { + StandardOffset = StandardOffsetValue; + } + + _daylightSavings = daylightSavings; + if (TimeSpan.TryParse(daylightSavings, out TimeSpan DaylightSavingsValue)) + { + DaylightSavingsOffset = DaylightSavingsValue; + } + + UtcStart = utcStart; + UtcEnd = utcEnd; + } + + [CodeGenMember("StandardOffset")] + internal string _standardOffset { get; } + /// UTC offset in format in effect at the ReferenceUTCTimestamp. + public TimeSpan StandardOffset { get; } + + [CodeGenMember("DaylightSavings")] + internal string _daylightSavings { get; } + /// Time saving in format in effect at the ReferenceUTCTimestamp. + public TimeSpan DaylightSavingsOffset { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneIanaVersionResult.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneIanaVersionResult.cs similarity index 89% rename from sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneIanaVersionResult.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneIanaVersionResult.cs index dbcd55649409..c9ceb56e43aa 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneIanaVersionResult.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneIanaVersionResult.cs @@ -3,7 +3,7 @@ using Azure.Core; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { /// TimeZoneIanaVersionResult for TimeZone Client. [CodeGenModel("TimezoneIanaVersionResult")] diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneId.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneId.cs new file mode 100644 index 000000000000..3c18c875e52c --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneId.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Globalization; +using Azure.Core; +using Azure.Core.GeoJson; + +namespace Azure.Maps.TimeZones +{ + /// The Time Zone ID. + [CodeGenModel("TimezoneId")] + public partial class TimeZoneId + { + /// Initializes a new instance of . + internal TimeZoneId(string id, IReadOnlyList aliases, IReadOnlyList countries, TimeZoneName name, ReferenceTime referenceTime, RepresentativePoint representativePoint, IReadOnlyList timeTransitions) + { + Id = id; + Aliases = aliases; + Countries = countries; + Name = name; + ReferenceTime = referenceTime; + _representativePoint = representativePoint; + if (representativePoint != null && representativePoint.Latitude != null && representativePoint.Longitude != null) + { + RepresentativePoint = new GeoPosition( + Convert.ToDouble(representativePoint.Longitude, CultureInfo.InvariantCulture.NumberFormat), + Convert.ToDouble(representativePoint.Latitude, CultureInfo.InvariantCulture.NumberFormat) + ); + } + TimeTransitions = timeTransitions; + } + + /// Representative point property. + [CodeGenMember("RepresentativePoint")] + internal RepresentativePoint _representativePoint { get; } + + /// Representative point representing a coordinate in GeoPosition format. + public GeoPosition RepresentativePoint { get; } + + /// Time zone name object. + [CodeGenMember("Names")] + public TimeZoneName Name { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneNames.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneName.cs similarity index 72% rename from sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneNames.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneName.cs index cc102ad559b3..7edf2367330c 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneNames.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneName.cs @@ -3,11 +3,11 @@ using Azure.Core; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - /// Timezone names object. + /// Time zone name object. [CodeGenModel("TimeZoneNames")] - public partial class TimeZoneNames + public partial class TimeZoneName { /// The ISO 639-1 language code of the Names. [CodeGenMember("ISO6391LanguageCode")] diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneResult.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneResult.cs similarity index 53% rename from sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneResult.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneResult.cs index fbe0ce9aad4a..7c2e325eedde 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneResult.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/TimeZoneResult.cs @@ -3,11 +3,11 @@ using Azure.Core; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - /// TimeZoneResult for TimeZone Client. + /// The time zone information specific time zone. [CodeGenModel("TimezoneResult")] - public partial class TimeZoneInformation + public partial class TimeZoneResult { } } diff --git a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneWindows.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/WindowsTimeZone.cs similarity index 54% rename from sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneWindows.cs rename to sdk/maps/Azure.Maps.TimeZones/src/Models/WindowsTimeZone.cs index 906af10226c9..096f48aeb335 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/Models/TimeZoneWindows.cs +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/WindowsTimeZone.cs @@ -3,11 +3,11 @@ using Azure.Core; -namespace Azure.Maps.TimeZone.Models +namespace Azure.Maps.TimeZones { - /// TimeZoneWindows for TimeZone Client. + /// Windows time zone for TimeZone Client. [CodeGenModel("TimezoneWindows")] - public partial class TimeZoneWindows + public partial class WindowsTimeZone { } } diff --git a/sdk/maps/Azure.Maps.TimeZones/src/Models/WindowsTimeZoneData.cs b/sdk/maps/Azure.Maps.TimeZones/src/Models/WindowsTimeZoneData.cs new file mode 100644 index 000000000000..a85a5ced3047 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/Models/WindowsTimeZoneData.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Maps.TimeZones +{ + /// The Windows time zone to Iana response information. + public partial class WindowsTimeZoneData + { + /// Initializes a new instance of . + internal WindowsTimeZoneData(IReadOnlyList windowsTimeZones) + { + WindowsTimeZones = windowsTimeZones; + } + + /// The list of Windows time zones. + public IReadOnlyList WindowsTimeZones { get; } + } +} diff --git a/sdk/maps/Azure.Maps.TimeZone/src/autorest.md b/sdk/maps/Azure.Maps.TimeZones/src/autorest.md similarity index 97% rename from sdk/maps/Azure.Maps.TimeZone/src/autorest.md rename to sdk/maps/Azure.Maps.TimeZones/src/autorest.md index 8331453d65a1..96d1b18ddcf0 100644 --- a/sdk/maps/Azure.Maps.TimeZone/src/autorest.md +++ b/sdk/maps/Azure.Maps.TimeZones/src/autorest.md @@ -20,7 +20,7 @@ generation1-convenience-client: true model-namespace: false sync-methods: None license-header: MICROSOFT_MIT_NO_VERSION -namespace: Azure.Maps.TimeZone +namespace: Azure.Maps.TimeZones public-clients: false clear-output-folder: true data-plane: true diff --git a/sdk/maps/Azure.Maps.TimeZones/src/properties/AssemblyInfo.cs b/sdk/maps/Azure.Maps.TimeZones/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5f322d298c23 --- /dev/null +++ b/sdk/maps/Azure.Maps.TimeZones/src/properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Azure.Maps.TimeZones")] +[assembly: InternalsVisibleTo("Azure.Maps.TimeZones.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/Azure.Maps.TimeZone.Tests.csproj b/sdk/maps/Azure.Maps.TimeZones/tests/Azure.Maps.TimeZones.Tests.csproj similarity index 93% rename from sdk/maps/Azure.Maps.TimeZone/tests/Azure.Maps.TimeZone.Tests.csproj rename to sdk/maps/Azure.Maps.TimeZones/tests/Azure.Maps.TimeZones.Tests.csproj index 1f91190db3fc..19e7b72860de 100644 --- a/sdk/maps/Azure.Maps.TimeZone/tests/Azure.Maps.TimeZone.Tests.csproj +++ b/sdk/maps/Azure.Maps.TimeZones/tests/Azure.Maps.TimeZones.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/MapsTimeZoneTests.cs b/sdk/maps/Azure.Maps.TimeZones/tests/MapsTimeZoneTests.cs similarity index 71% rename from sdk/maps/Azure.Maps.TimeZone/tests/MapsTimeZoneTests.cs rename to sdk/maps/Azure.Maps.TimeZones/tests/MapsTimeZoneTests.cs index 843c54230742..0743165f5e2c 100644 --- a/sdk/maps/Azure.Maps.TimeZone/tests/MapsTimeZoneTests.cs +++ b/sdk/maps/Azure.Maps.TimeZones/tests/MapsTimeZoneTests.cs @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. + using System; using System.Threading.Tasks; -using Azure.Maps.TimeZone.Models.Options; -using Azure.Maps.TimeZone.Models; -using Azure.Core.TestFramework; using NUnit.Framework; -using System.Collections.Generic; +using Azure.Core; +using Azure.Core.TestFramework; using Azure.Core.GeoJson; -namespace Azure.Maps.TimeZone.Tests +namespace Azure.Maps.TimeZones.Tests { public class MapsTimeZoneTests : TimeZoneClientLiveTestsBase { @@ -21,9 +20,11 @@ public MapsTimeZoneTests(bool isAsync) : base(isAsync) public async Task GetTimezoneByIdTest() { var client = CreateClient(); - TimeZoneBaseOptions options = new TimeZoneBaseOptions(); - options.Options = TimeZoneOptions.All; - var response = await client.GetTimeZoneByIDAsync("Asia/Bahrain", options); + GetTimeZoneOptions options = new GetTimeZoneOptions() + { + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All + }; + var response = await client.GetTimeZoneByIdAsync("Asia/Bahrain", options); Assert.AreEqual("Asia/Qatar", response.Value.TimeZones[0].Id); } @@ -31,9 +32,9 @@ public async Task GetTimezoneByIdTest() public void InvalidGetTimezoneByIdTest() { var client = CreateClient(); - TimeZoneBaseOptions options = new TimeZoneBaseOptions(); + GetTimeZoneOptions options = new GetTimeZoneOptions(); RequestFailedException ex = Assert.ThrowsAsync( - async () => await client.GetTimeZoneByIDAsync("", options)); + async () => await client.GetTimeZoneByIdAsync("", options)); Assert.AreEqual(400, ex.Status); } @@ -41,8 +42,10 @@ public void InvalidGetTimezoneByIdTest() public async Task GetTimezoneByCoordinatesTest() { var client = CreateClient(); - TimeZoneBaseOptions options = new TimeZoneBaseOptions(); - options.Options = TimeZoneOptions.All; + GetTimeZoneOptions options = new GetTimeZoneOptions() + { + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All + }; GeoPosition coordinates = new GeoPosition(121.5640089, 25.0338053); var response = await client.GetTimeZoneByCoordinatesAsync(coordinates, options); Assert.AreEqual(1, response.Value.TimeZones.Count); @@ -54,8 +57,10 @@ public void InvalidGetTimezoneByCoordinatesTest() { // "The provided coordinates in query are invalid, out of range, or not in the expected format" var client = CreateClient(); - TimeZoneBaseOptions options = new TimeZoneBaseOptions(); - options.Options = TimeZoneOptions.All; + GetTimeZoneOptions options = new GetTimeZoneOptions() + { + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All + }; GeoPosition coordinates = new GeoPosition(121.0, -100.0); RequestFailedException ex = Assert.ThrowsAsync( async () => await client.GetTimeZoneByCoordinatesAsync(coordinates, options)); @@ -67,15 +72,15 @@ public async Task GetWindowsTimezoneIdsTest() { var client = CreateClient(); var response = await client.GetWindowsTimeZoneIdsAsync(); - Assert.AreEqual(505, response.Value.Count); + Assert.AreEqual(505, response.Value.WindowsTimeZones.Count); } [RecordedTest] - public async Task GetIanaTimezoneIdsTest() + public async Task GetTimeZoneIanaIdsTest() { var client = CreateClient(); - var response = await client.GetIanaTimeZoneIdsAsync(); - Assert.AreEqual(596, response.Value.Count); + var response = await client.GetTimeZoneIanaIdsAsync(); + Assert.AreEqual(596, response.Value.IanaIds.Count); } [RecordedTest] @@ -91,8 +96,8 @@ public async Task ConvertWindowsTimezoneToIanaTest() { var client = CreateClient(); var response = await client.ConvertWindowsTimeZoneToIanaAsync("Dateline Standard Time"); - Assert.AreEqual(1, response.Value.Count); - Assert.AreEqual("Etc/GMT+12", response.Value[0].Id); + Assert.AreEqual(1, response.Value.IanaIds.Count); + Assert.AreEqual("Etc/GMT+12", response.Value.IanaIds[0].Id); } [RecordedTest] diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/Samples/README.md b/sdk/maps/Azure.Maps.TimeZones/tests/Samples/README.md similarity index 68% rename from sdk/maps/Azure.Maps.TimeZone/tests/Samples/README.md rename to sdk/maps/Azure.Maps.TimeZones/tests/Samples/README.md index f3bb0bfb59be..2e7f462ba5ad 100644 --- a/sdk/maps/Azure.Maps.TimeZone/tests/Samples/README.md +++ b/sdk/maps/Azure.Maps.TimeZones/tests/Samples/README.md @@ -1,3 +1,3 @@ Source files in this directory are written as tests from which samples are extracted. They are not intended to be viewed directly and help ensure our samples compile and work correctly. -See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZone/samples) for more explanation about how to use this client library. +See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZones/samples) for more explanation about how to use this client library. diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/Samples/TimeZoneClientSamples.cs b/sdk/maps/Azure.Maps.TimeZones/tests/Samples/TimeZoneClientSamples.cs similarity index 72% rename from sdk/maps/Azure.Maps.TimeZone/tests/Samples/TimeZoneClientSamples.cs rename to sdk/maps/Azure.Maps.TimeZones/tests/Samples/TimeZoneClientSamples.cs index 8ba3ac25ce5a..276afca95631 100644 --- a/sdk/maps/Azure.Maps.TimeZone/tests/Samples/TimeZoneClientSamples.cs +++ b/sdk/maps/Azure.Maps.TimeZones/tests/Samples/TimeZoneClientSamples.cs @@ -1,27 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core; using System; +using Azure.Core; +using Azure.Core.GeoJson; using Azure.Core.TestFramework; -using Azure.ResourceManager.Maps.Models; -using Azure.ResourceManager.Maps; +#region Snippet:TimeZoneImportNamespaces +using Azure.Maps.TimeZones; +#endregion using Azure.ResourceManager; +using Azure.ResourceManager.Maps; +using Azure.ResourceManager.Maps.Models; using NUnit.Framework; -using Azure.Maps.TimeZone.Models.Options; -using Azure.Maps.TimeZone.Models; -using Azure.Maps.TimeZone; -using System.Collections.Generic; -using Azure.Core.GeoJson; -namespace Azure.Maps.TimeZone.Tests.Samples +namespace Azure.Maps.TimeZones.Tests.Samples { public class TimeZoneClientSamples : SamplesBase { public void TimeZoneClientViaSubscriptionKey() { #region Snippet:InstantiateTimeZoneClientViaSubscriptionKey - // Create a SearchClient that will authenticate through Subscription Key (Shared key) + // Create a MapsTimeZoneClient that will authenticate through Subscription Key (Shared key) AzureKeyCredential credential = new AzureKeyCredential(""); MapsTimeZoneClient client = new MapsTimeZoneClient(credential); #endregion @@ -66,7 +65,7 @@ public void TimeZoneClientViaSas() MapsAccountSasContent sasContent = new MapsAccountSasContent(MapsSigningKey.PrimaryKey, principalId, maxRatePerSecond, start, expiry); Response sas = mapsAccount.GetSas(sasContent); - // Create a TimeZoneClient that will authenticate via SAS token + // Create a MapsTimeZoneClient that will authenticate via SAS token AzureSasCredential sasCredential = new AzureSasCredential(sas.Value.AccountSasToken); MapsTimeZoneClient client = new MapsTimeZoneClient(sasCredential); #endregion @@ -82,9 +81,11 @@ public void GetTimeZoneById() var clientId = TestEnvironment.MapAccountClientId; var client = new MapsTimeZoneClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetTimeZoneById - TimeZoneBaseOptions options = new TimeZoneBaseOptions(); - options.Options = TimeZoneOptions.All; - Response response = client.GetTimeZoneByID("Asia/Bahrain", options); + GetTimeZoneOptions options = new GetTimeZoneOptions() + { + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All + }; + Response response = client.GetTimeZoneById("Asia/Bahrain", options); Console.WriteLine("Version: " + response.Value.Version); Console.WriteLine("Countires: " + response.Value.TimeZones[0].Countries); #endregion @@ -100,11 +101,16 @@ public void GetTimeZoneByCoordinates() var clientId = TestEnvironment.MapAccountClientId; var client = new MapsTimeZoneClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetTimeZoneByCoordinates - TimeZoneBaseOptions options = new TimeZoneBaseOptions(); - options.Options = TimeZoneOptions.All; + GetTimeZoneOptions options = new GetTimeZoneOptions() + { + AdditionalTimeZoneReturnInformation = AdditionalTimeZoneReturnInformation.All + }; GeoPosition coordinates = new GeoPosition(121.5640089, 25.0338053); - Response response = client.GetTimeZoneByCoordinates(coordinates, options); - Console.WriteLine("Names: " + response.Value.TimeZones[0].Names); + Response response = client.GetTimeZoneByCoordinates(coordinates, options); + + Console.WriteLine("Time zone for (latitude, longitude) = ({0}, {1}) is {2}: ", + coordinates.Latitude, coordinates.Longitude, + response.Value.TimeZones[0].Name.Generic); #endregion } @@ -118,15 +124,19 @@ public void GetWindowsTimeZoneIds() var clientId = TestEnvironment.MapAccountClientId; var client = new MapsTimeZoneClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetWindowsTimeZoneIds - Response> response = client.GetWindowsTimeZoneIds(); - Console.WriteLine("Count: " + response.Value.Count); - Console.WriteLine("WindowsId: " + response.Value[0].WindowsId); - Console.WriteLine("Territory: " + response.Value[0].Territory); + Response response = client.GetWindowsTimeZoneIds(); + Console.WriteLine("Total time zones: " + response.Value.WindowsTimeZones.Count); + foreach (WindowsTimeZone timeZone in response.Value.WindowsTimeZones) + { + Console.WriteLine("IANA Id: " + timeZone.IanaIds); + Console.WriteLine("Windows ID: " + timeZone.WindowsId); + Console.WriteLine("Territory: " + timeZone.Territory); + } #endregion } [Test] - public void GetIanaTimeZoneIds() + public void GetTimeZoneIanaIds() { var clientOptions = new MapsTimeZoneClientOptions() { @@ -134,10 +144,17 @@ public void GetIanaTimeZoneIds() }; var clientId = TestEnvironment.MapAccountClientId; var client = new MapsTimeZoneClient(TestEnvironment.Credential, clientId, clientOptions); - #region Snippet:GetIanaTimeZoneIds - Response> response = client.GetIanaTimeZoneIds(); - Console.WriteLine("IsAlias: " + response.Value[0].IsAlias); - Console.WriteLine("Id: " + response.Value[0].Id); + #region Snippet:GetTimeZoneIanaIds + Response response = client.GetTimeZoneIanaIds(); + if (response.Value.IanaIds[0].AliasOf != null) + { + Console.WriteLine("It is an alias: " + response.Value.IanaIds[0].AliasOf); + } + else + { + Console.WriteLine("It is not an alias"); + } + Console.WriteLine("IANA Id: " + response.Value.IanaIds[0].Id); #endregion } @@ -152,7 +169,7 @@ public void GetIanaVersion() var client = new MapsTimeZoneClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetIanaVersion Response response = client.GetIanaVersion(); - Console.WriteLine("Version: " + response.Value.Version); + Console.WriteLine("IANA Version: " + response.Value.Version); #endregion } @@ -166,8 +183,8 @@ public void ConvertWindowsTimeZoneToIana() var clientId = TestEnvironment.MapAccountClientId; var client = new MapsTimeZoneClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:ConvertWindowsTimeZoneToIana - Response> response = client.ConvertWindowsTimeZoneToIana("Dateline Standard Time"); - Console.WriteLine("Id: " + response.Value[0].Id); + Response response = client.ConvertWindowsTimeZoneToIana("Dateline Standard Time"); + Console.WriteLine("IANA Id: " + response.Value.IanaIds[0].Id); #endregion } } diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/TimeZoneClientLiveTestsBase.cs b/sdk/maps/Azure.Maps.TimeZones/tests/TimeZoneClientLiveTestsBase.cs similarity index 61% rename from sdk/maps/Azure.Maps.TimeZone/tests/TimeZoneClientLiveTestsBase.cs rename to sdk/maps/Azure.Maps.TimeZones/tests/TimeZoneClientLiveTestsBase.cs index f31c6c44f9aa..de89d864f2df 100644 --- a/sdk/maps/Azure.Maps.TimeZone/tests/TimeZoneClientLiveTestsBase.cs +++ b/sdk/maps/Azure.Maps.TimeZones/tests/TimeZoneClientLiveTestsBase.cs @@ -2,11 +2,12 @@ // Licensed under the MIT License. using Azure.Core.TestFramework; -using Azure.Maps.TimeZone; +using Azure.Identity; +using Azure.Maps.TimeZones; -namespace Azure.Maps.TimeZone.Tests +namespace Azure.Maps.TimeZones.Tests { - public class TimeZoneClientLiveTestsBase : RecordedTestBase + public class TimeZoneClientLiveTestsBase : RecordedTestBase { public TimeZoneClientLiveTestsBase(bool isAsync) : base(isAsync) { @@ -15,7 +16,8 @@ public TimeZoneClientLiveTestsBase(bool isAsync) : base(isAsync) protected MapsTimeZoneClient CreateClient() { return InstrumentClient(new MapsTimeZoneClient( - credential: new AzureKeyCredential(""), + credential: TestEnvironment.Credential, + clientId: TestEnvironment.MapAccountClientId, options: InstrumentClientOptions(new MapsTimeZoneClientOptions()) )); } diff --git a/sdk/maps/Azure.Maps.TimeZone/tests/TimeZoneClientTestEnvironment.cs b/sdk/maps/Azure.Maps.TimeZones/tests/TimeZoneClientTestEnvironment.cs similarity index 93% rename from sdk/maps/Azure.Maps.TimeZone/tests/TimeZoneClientTestEnvironment.cs rename to sdk/maps/Azure.Maps.TimeZones/tests/TimeZoneClientTestEnvironment.cs index dfb7df7cbee3..63cb54eb6cba 100644 --- a/sdk/maps/Azure.Maps.TimeZone/tests/TimeZoneClientTestEnvironment.cs +++ b/sdk/maps/Azure.Maps.TimeZones/tests/TimeZoneClientTestEnvironment.cs @@ -4,7 +4,7 @@ using System; using Azure.Core.TestFramework; -namespace Azure.Maps.TimeZone.Tests +namespace Azure.Maps.TimeZones.Tests { public class TimeZoneClientTestEnvironment : TestEnvironment { diff --git a/sdk/maps/Azure.Maps.Weather/README.md b/sdk/maps/Azure.Maps.Weather/README.md index dd9e6354be78..45b5af719127 100644 --- a/sdk/maps/Azure.Maps.Weather/README.md +++ b/sdk/maps/Azure.Maps.Weather/README.md @@ -2,7 +2,7 @@ Azure Maps Weather is a library which contains Azure Maps Weather APIs. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Weather/src) | [API reference documentation](https://docs.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://docs.microsoft.com/rest/api/maps/weather) | [Product documentation](https://docs.microsoft.com/azure/azure-maps/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Weather/src) | [API reference documentation](https://learn.microsoft.com/rest/api/maps/) | [REST API reference documentation](https://learn.microsoft.com/rest/api/maps/weather) | [Product documentation](https://learn.microsoft.com/azure/azure-maps/) ## Getting started @@ -16,7 +16,7 @@ dotnet add package Azure.Maps.Weather --prerelease ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: @@ -365,7 +365,7 @@ Console.WriteLine("Temperature: " + response.Value.Waypoints[0].Temperature.Valu ### General -When you interact with the Azure Maps services, errors returned by the service correspond to the same HTTP status codes returned for [REST API requests](https://docs.microsoft.com/rest/api/maps/weather). +When you interact with the Azure Maps services, errors returned by the service correspond to the same HTTP status codes returned for [REST API requests](https://learn.microsoft.com/rest/api/maps/weather). For example, if you search with an invalid coordinate, an error is returned, indicating "Bad Request".400 diff --git a/sdk/maps/Azure.ResourceManager.Maps/CHANGELOG.md b/sdk/maps/Azure.ResourceManager.Maps/CHANGELOG.md index 813bfa1dc0b3..ec4784385326 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/CHANGELOG.md +++ b/sdk/maps/Azure.ResourceManager.Maps/CHANGELOG.md @@ -94,4 +94,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/maps/Azure.ResourceManager.Maps/README.md b/sdk/maps/Azure.ResourceManager.Maps/README.md index aa3412e07dc3..b89ac3498607 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/README.md +++ b/sdk/maps/Azure.ResourceManager.Maps/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/maps/README.md b/sdk/maps/README.md index 7523c953fa39..a1bce4cff2f1 100644 --- a/sdk/maps/README.md +++ b/sdk/maps/README.md @@ -11,7 +11,7 @@ Below are the packages contained in Azure Maps: - [Azure.Maps.Routing][route] allows you to get the routing information for multiple origins and destinations. - [Azure.Maps.Search][search] supports many searching functionalities for entities, point of interests (POI) or streets, and also supports reverse geocode a coordinate to a place or an entity. - [Azure.Maps.Geolocation][geolocation] allows you to get the ISO country code for the provided IP address. -- [Azure.Maps.TimeZone][timezone] +- [Azure.Maps.TimeZones][timezone] allows you to get time zone information for the world. - [Azure.Maps.Weather][weather] allows you to get real-time, forecasted, and historical weather data. ### Install the package @@ -22,14 +22,14 @@ dotnet add package Azure.Maps.Rendering --prerelease dotnet add package Azure.Maps.Routing --prerelease dotnet add package Azure.Maps.Search --prerelease dotnet add package Azure.Maps.Geolocation --prerelease -dotnet add package Azure.Maps.TimeZone --prerelease +dotnet add package Azure.Maps.TimeZones --prerelease ``` Azure.Maps.Common will be automatically installed when you install other packages. ### Prerequisites -> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Azure Maps account](https://learn.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account). To create a new Azure Maps account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI: @@ -39,7 +39,7 @@ az maps account create --kind "Gen2" --account-name "myMapAccountName" --resourc ### Authenticate the client -There are 2 ways to authenticate the client: Shared key authentication and Azure AD. Please refer to each package's README for details. +There are 3 ways to authenticate the client: Shared key authentication, Microsoft Entra and Shared Access Signature (SAS) Authentication. Please refer to each package's README for details. ## Key concepts @@ -75,7 +75,7 @@ using Azure.Maps.Routing; using Azure.Maps.Search; ``` -In the main function, instantiate `MapsSearchClient`, `MapsRoutingClient` and `MapsRenderingClient` either via AAD or subscription key authentication. Below is an example of instantiation via AAD: +In the main function, instantiate `MapsSearchClient`, `MapsRoutingClient` and `MapsRenderingClient` either via subscription key, Microsoft Entra, or SAS token authentication. Below is an example of instantiation via Microsoft Entra: ```C# // Create a MapsSearchClient and MapsRoutingClient that will authenticate through Active Directory @@ -221,7 +221,7 @@ additional questions or comments. [route]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Routing [geolocation]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Geolocation [search]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Search -[timezone]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZone +[timezone]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.TimeZones [weather]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps/Azure.Maps.Weather [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/maps/ci.yml b/sdk/maps/ci.yml index 67555348e196..ce98d66e27d2 100644 --- a/sdk/maps/ci.yml +++ b/sdk/maps/ci.yml @@ -44,3 +44,5 @@ extends: safeName: AzureMapsSearch - name: Azure.Maps.Geolocation safeName: AzureMapsGeolocation + - name: Azure.Maps.TimeZones + safeName: AzureMapsTimeZones diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/CHANGELOG.md b/sdk/marketplace/Azure.ResourceManager.Marketplace/CHANGELOG.md index e9eafd26f7c0..9fab741e9c9c 100644 --- a/sdk/marketplace/Azure.ResourceManager.Marketplace/CHANGELOG.md +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/CHANGELOG.md @@ -65,8 +65,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -98,4 +98,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/README.md b/sdk/marketplace/Azure.ResourceManager.Marketplace/README.md index 1f0adbc31604..7913e5ef29d5 100644 --- a/sdk/marketplace/Azure.ResourceManager.Marketplace/README.md +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/CHANGELOG.md b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/CHANGELOG.md index 293a0a96357d..aedf0bf857c6 100644 --- a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/CHANGELOG.md +++ b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/CHANGELOG.md @@ -79,4 +79,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/README.md b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/README.md index 4dda8ef40351..9cc9c2f77f36 100644 --- a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/README.md +++ b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/CHANGELOG.md b/sdk/mediaservices/Azure.ResourceManager.Media/CHANGELOG.md index e9eae082dec3..79994bdd8403 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/CHANGELOG.md +++ b/sdk/mediaservices/Azure.ResourceManager.Media/CHANGELOG.md @@ -90,8 +90,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -122,4 +122,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/README.md b/sdk/mediaservices/Azure.ResourceManager.Media/README.md index e2e6dcccc132..c4341d1c3532 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/README.md +++ b/sdk/mediaservices/Azure.ResourceManager.Media/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md index a8bb04a3c8a0..416f1035ac83 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/README.md @@ -568,7 +568,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [metricsadv_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src -[metricsadv_docs]: https://docs.microsoft.com/azure/cognitive-services/metrics-advisor +[metricsadv_docs]: https://learn.microsoft.com/azure/cognitive-services/metrics-advisor [metricsadv_nuget_package]: https://www.nuget.org/packages/Azure.AI.MetricsAdvisor [metricsadv_refdocs]: https://aka.ms/azsdk/net/docs/ref/metricsadvisor [metricsadv_rest_api]: https://westus2.dev.cognitive.microsoft.com/docs/services/MetricsAdvisor @@ -590,18 +590,18 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [metricsadv-sample10]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample10_QueryTimeSeriesInformation.cs [metricsadv-sample11]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample11_FeedbackCrudOperations.cs -[aad_grant_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[aad_grant_access]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md -[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli -[cognitive_resource_portal]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account +[cognitive_resource_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[cognitive_resource_portal]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [metricsadv_authentication]: https://aka.ms/metricsadvisor/authentication [logging]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/samples/Diagnostics.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_portal]: https://portal.azure.com [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org diff --git a/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/CHANGELOG.md b/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/CHANGELOG.md index 2a66e9c38886..8d9e5f947438 100644 --- a/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/CHANGELOG.md +++ b/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/CHANGELOG.md @@ -30,4 +30,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/README.md b/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/README.md index 330c82aa0a16..e82c471a603f 100644 --- a/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/README.md +++ b/sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/mixedreality/Azure.MixedReality.Authentication/README.md b/sdk/mixedreality/Azure.MixedReality.Authentication/README.md index 2e7148928789..787f0f7d1a79 100644 --- a/sdk/mixedreality/Azure.MixedReality.Authentication/README.md +++ b/sdk/mixedreality/Azure.MixedReality.Authentication/README.md @@ -6,7 +6,7 @@ token from the STS that can be used to access Mixed Reality services. [Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/mixedreality/Azure.MixedReality.Authentication/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.MixedReality.Authentication) -![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png) +![Mixed Reality service authentication diagram](https://learn.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png) - [Azure Mixed Reality Authentication client library for .NET](#azure-mixed-reality-authentication-client-library-for-net) - [Getting started](#getting-started) @@ -50,8 +50,8 @@ Add a package reference: - You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). - You must have an account with an [Azure Mixed Reality service](https://azure.microsoft.com/topic/mixed-reality/): - - [Azure Remote Rendering](https://docs.microsoft.com/azure/remote-rendering/) - - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/) + - [Azure Remote Rendering](https://learn.microsoft.com/azure/remote-rendering/) + - [Azure Spatial Anchors](https://learn.microsoft.com/azure/spatial-anchors/) - Familiarity with the authentication and credential concepts from [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ### Authenticate the client @@ -69,7 +69,7 @@ Mixed Reality services support a few different forms of authentication: method for production applications because it allows you to avoid embedding the credentials for access to a Mixed Reality service in your client application. -See [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information. +See [here](https://learn.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information. #### Authentication examples diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/CHANGELOG.md b/sdk/mixedreality/Azure.ResourceManager.MixedReality/CHANGELOG.md index 722ca1aa845c..bad7f125f147 100644 --- a/sdk/mixedreality/Azure.ResourceManager.MixedReality/CHANGELOG.md +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/CHANGELOG.md @@ -59,8 +59,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -92,5 +92,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md b/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md index bb629a1d9105..835b27f37e1c 100644 --- a/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/CHANGELOG.md b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/CHANGELOG.md index 3b350e731265..bb903a24d90f 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/CHANGELOG.md +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/CHANGELOG.md @@ -74,4 +74,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/README.md b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/README.md index 80827bdf7d1c..2757f07d5c6b 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/README.md +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/README.md @@ -38,7 +38,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/modelsrepository/Azure.IoT.ModelsRepository/README.md b/sdk/modelsrepository/Azure.IoT.ModelsRepository/README.md index 05695c346b2a..7dbaae8aa9cc 100644 --- a/sdk/modelsrepository/Azure.IoT.ModelsRepository/README.md +++ b/sdk/modelsrepository/Azure.IoT.ModelsRepository/README.md @@ -91,4 +91,4 @@ For more information see the [Code of Conduct FAQ][code_of_conduct_faq] or conta [thread_safety_guideline]: https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety [json_ld_reference]: https://json-ld.org [dtdlv2_reference]: https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md -[eventsourcelistener_reference]: https://docs.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener?view=azure-dotnet +[eventsourcelistener_reference]: https://learn.microsoft.com/dotnet/api/azure.core.diagnostics.azureeventsourcelistener?view=azure-dotnet diff --git a/sdk/modelsrepository/Azure.IoT.ModelsRepository/samples/readme.md b/sdk/modelsrepository/Azure.IoT.ModelsRepository/samples/readme.md index f0dc83f993ab..9ad927414497 100644 --- a/sdk/modelsrepository/Azure.IoT.ModelsRepository/samples/readme.md +++ b/sdk/modelsrepository/Azure.IoT.ModelsRepository/samples/readme.md @@ -198,8 +198,8 @@ Console.WriteLine(fullyQualifiedModelPath); [modelsrepository_github_repo]: https://github.com/Azure/iot-plugandplay-models [modelsrepository_sample_extension]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/modelsrepository/Azure.IoT.ModelsRepository/samples/ModelsRepositoryClientSamples/ModelsRepositoryClientExtensions.cs [modelsrepository_clientoptions]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/modelsrepository/Azure.IoT.ModelsRepository/src/ModelsRepositoryClientOptions.cs -[modelsrepository_msdocs]: https://docs.microsoft.com/azure/iot-pnp/concepts-model-repository -[modelsrepository_publish_msdocs]: https://docs.microsoft.com/azure/iot-pnp/concepts-model-repository#publish-a-model +[modelsrepository_msdocs]: https://learn.microsoft.com/azure/iot-pnp/concepts-model-repository +[modelsrepository_publish_msdocs]: https://learn.microsoft.com/azure/iot-pnp/concepts-model-repository#publish-a-model [modelsrepository_iot_endpoint]: https://devicemodels.azure.com/ [json_ld_reference]: https://json-ld.org [dtdlv2_reference]: https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md index 2c3982b22059..32dc45e1ea66 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md @@ -24,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md index a8860122c4e1..8e6c6f641e1f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/monitor/Azure.Monitor.Ingestion/samples/README.md b/sdk/monitor/Azure.Monitor.Ingestion/samples/README.md index e648d3586cdf..b97196db1b4c 100644 --- a/sdk/monitor/Azure.Monitor.Ingestion/samples/README.md +++ b/sdk/monitor/Azure.Monitor.Ingestion/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.Monitor.Ingestion samples for .NET description: Samples for the Azure Monitor Ingestion client library. diff --git a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogData.md b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogData.md index 1690c378edd6..79728ffddbe0 100644 --- a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogData.md +++ b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogData.md @@ -4,7 +4,7 @@ To use these samples, you'll first need to set up resources. See [getting starte ## Upload custom logs -You can create a client and call the client's `Upload` method. Take note of the data ingestion [limits](https://docs.microsoft.com/azure/azure-monitor/service-limits#custom-logs). +You can create a client and call the client's `Upload` method. Take note of the data ingestion [limits](https://learn.microsoft.com/azure/azure-monitor/service-limits#custom-logs). ```C# Snippet:UploadCustomLogs var endpoint = new Uri(""); diff --git a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogDataAsync.md b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogDataAsync.md index 40bdcea356ca..09d316355942 100644 --- a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogDataAsync.md +++ b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample1_LogDataAsync.md @@ -4,7 +4,7 @@ To use these samples, you'll first need to set up resources. See [getting starte ## Upload custom logs asynchronously -You can create a client and call the client's `UploadAsync` method. Take note of the data ingestion [limits](https://docs.microsoft.com/azure/azure-monitor/service-limits#custom-logs). +You can create a client and call the client's `UploadAsync` method. Take note of the data ingestion [limits](https://learn.microsoft.com/azure/azure-monitor/service-limits#custom-logs). ```C# Snippet:UploadCustomLogsAsync var endpoint = new Uri(""); diff --git a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrency.md b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrency.md index 8830d8a48127..b75a6baae92c 100644 --- a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrency.md +++ b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrency.md @@ -4,7 +4,7 @@ To use these samples, you'll first need to set up resources. See [getting starte ## Upload custom logs with max concurrency -You can create a client and call the client's `Upload` method. Take note of the data ingestion [limits](https://docs.microsoft.com/azure/azure-monitor/service-limits#custom-logs). To upload multiple log requests in parallel, set the `UploadLogsOptions.MaxConcurrency` property. +You can create a client and call the client's `Upload` method. Take note of the data ingestion [limits](https://learn.microsoft.com/azure/azure-monitor/service-limits#custom-logs). To upload multiple log requests in parallel, set the `UploadLogsOptions.MaxConcurrency` property. ```C# Snippet:UploadWithMaxConcurrency var endpoint = new Uri(""); diff --git a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrencyAsync.md b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrencyAsync.md index fc0702eade42..c3d35d35e250 100644 --- a/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrencyAsync.md +++ b/sdk/monitor/Azure.Monitor.Ingestion/samples/Sample3_LogDataWithMaxConcurrencyAsync.md @@ -4,7 +4,7 @@ To use these samples, you'll first need to set up resources. See [getting starte ## Upload custom logs with max concurrency -You can create a client and call the client's `UploadAsync` method. Take note of the data ingestion [limits](https://docs.microsoft.com/azure/azure-monitor/service-limits#custom-logs). To upload multiple log requests in parallel, set the `UploadLogsOptions.MaxConcurrency` property. +You can create a client and call the client's `UploadAsync` method. Take note of the data ingestion [limits](https://learn.microsoft.com/azure/azure-monitor/service-limits#custom-logs). To upload multiple log requests in parallel, set the `UploadLogsOptions.MaxConcurrency` property. ```C# Snippet:UploadWithMaxConcurrencyAsync var endpoint = new Uri(""); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md index 0d68923c4035..6001a62654ab 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md @@ -7,8 +7,8 @@ The Azure Monitor Distro is a client library that sends telemetry data to Azure ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Monitor Distro, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- **Azure Application Insights Connection String:** To send telemetry data to the monitoring service you'll need connection string from Azure Application Insights. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [Create an Application Insights resource](https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource) and [copy the connection string](https://docs.microsoft.com/azure/azure-monitor/app/sdk-connection-string?tabs=net#find-your-connection-string). -- **ASP.NET Core App:** An ASP.NET Core application is required to instrument it with Azure Monitor Distro. You can either bring your own app or follow the [Get started with ASP.NET Core MVC](https://docs.microsoft.com/aspnet/core/tutorials/first-mvc-app/start-mvc) to create a new one. +- **Azure Application Insights Connection String:** To send telemetry data to the monitoring service you'll need connection string from Azure Application Insights. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [Create an Application Insights resource](https://learn.microsoft.com/azure/azure-monitor/app/create-new-resource) and [copy the connection string](https://learn.microsoft.com/azure/azure-monitor/app/sdk-connection-string?tabs=net#find-your-connection-string). +- **ASP.NET Core App:** An ASP.NET Core application is required to instrument it with Azure Monitor Distro. You can either bring your own app or follow the [Get started with ASP.NET Core MVC](https://learn.microsoft.com/aspnet/core/tutorials/first-mvc-app/start-mvc) to create a new one. ### What is Included in the Distro @@ -16,7 +16,7 @@ The Azure Monitor Distro is a distribution of the .NET OpenTelemetry SDK with in * Traces * **ASP.NET Core Instrumentation**: Provides automatic tracing for incoming HTTP requests to ASP.NET Core applications. - * **HTTP Client Instrumentation**: Provides automatic tracing for outgoing HTTP requests made using [System.Net.Http.HttpClient](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient). + * **HTTP Client Instrumentation**: Provides automatic tracing for outgoing HTTP requests made using [System.Net.Http.HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient). * **SQL Client Instrumentation** Provides automatic tracing for SQL queries executed using the [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) and [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) packages. (While the OpenTelemetry SqlClient instrumentation remains in its beta phase, we have taken the step to vendor it and include it in our Distro) * Metrics diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/README.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/README.md index 4cacda037570..ecda5961074d 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/README.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/README.md @@ -8,7 +8,7 @@ This project is the Integration tests using the [Azure SDK TestFramework](https: To run these tests locally you must first create your test resources. -1. Connect to an Azure Subscription. This command requires the [Azure PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps). +1. Connect to an Azure Subscription. This command requires the [Azure PowerShell module](https://learn.microsoft.com/powershell/azure/install-az-ps). ```powershell Connect-AzAccount -Subscription 'YOUR SUBSCRIPTION ID' diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/README.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/README.md index 3d33eaf64479..6e7457d33887 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/README.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/README.md @@ -1,13 +1,13 @@ # Azure Monitor Exporter client library for .NET -The [OpenTelemetry .NET](https://github.com/open-telemetry/opentelemetry-dotnet) exporters which send [telemetry data](https://docs.microsoft.com/azure/azure-monitor/app/data-model) to [Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview) following the [OpenTelemetry Specification](https://github.com/open-telemetry/opentelemetry-specification). +The [OpenTelemetry .NET](https://github.com/open-telemetry/opentelemetry-dotnet) exporters which send [telemetry data](https://learn.microsoft.com/azure/azure-monitor/app/data-model) to [Azure Monitor](https://learn.microsoft.com/azure/azure-monitor/app/app-insights-overview) following the [OpenTelemetry Specification](https://github.com/open-telemetry/opentelemetry-specification). ## Getting started ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Monitor Exporter for [OpenTelemetry .NET](https://github.com/open-telemetry/opentelemetry-dotnet), you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- **Azure Application Insights Connection String:** To send telemetry data to the monitoring service you'll need connection string from Azure Application Insights. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [Create an Application Insights resource](https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource) and [copy the connection string](https://docs.microsoft.com/azure/azure-monitor/app/sdk-connection-string?tabs=net#find-your-connection-string). +- **Azure Application Insights Connection String:** To send telemetry data to the monitoring service you'll need connection string from Azure Application Insights. If you are not familiar with creating Azure resources, you may wish to follow the step-by-step guide for [Create an Application Insights resource](https://learn.microsoft.com/azure/azure-monitor/app/create-new-resource) and [copy the connection string](https://learn.microsoft.com/azure/azure-monitor/app/sdk-connection-string?tabs=net#find-your-connection-string). ### Migrating from Application Insights SDK @@ -111,7 +111,7 @@ Some key concepts for .NET include: Some key concepts for Azure Monitor include: -- [IP Addresses used by Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/app/ip-addresses#outgoing-ports): +- [IP Addresses used by Azure Monitor](https://learn.microsoft.com/azure/azure-monitor/app/ip-addresses#outgoing-ports): This exporter sends traces to the configured Azure Monitor Resource using HTTPS. You might need to know IP addresses if the app or infrastructure that you're monitoring is hosted behind a firewall. diff --git a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md index 206c4a044a12..1c58323ef266 100644 --- a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md @@ -1,16 +1,22 @@ # Release History -## 1.6.0-beta.1 (Unreleased) +## 1.7.0-beta.1 (Unreleased) ### Features Added ### Breaking Changes ### Bugs Fixed -- Fix bug in 'MetricsClient' QueryResourceAsync method where the 'QueryTimeRange' parameter was incorrectly set ### Other Changes +## 1.6.0 (2024-12-03) + +### Features Added +- Add 'StartTime' and 'EndTime' parameters to 'MetricsQueryResourcesOptions' to allow for querying a specific time range +### Bugs Fixed +- Fix bug in 'MetricsClient' QueryResourceAsync method where the 'QueryTimeRange' parameter was incorrectly set + ## 1.5.0 (2024-08-21) ### Bugs Fixed - Fix bug in `LogsQueryClient` that defaulted to `Azure.PublicCloud`. `Audience` is now determined from the `endpoint` parameter. diff --git a/sdk/monitor/Azure.Monitor.Query/README.md b/sdk/monitor/Azure.Monitor.Query/README.md index a3f60cb420fb..8cb296386259 100644 --- a/sdk/monitor/Azure.Monitor.Query/README.md +++ b/sdk/monitor/Azure.Monitor.Query/README.md @@ -721,6 +721,34 @@ foreach (MetricsQueryResult value in metricsQueryResults.Values) } ``` +The `MetricsQueryResourcesOptions`-typed argument also has a `StartTime` and `EndTime` property to allow for querying a specific time range. If only the `StartTime` is set, the `EndTime` default becomes the current time. When the `EndTime` is specified, the `StartTime` is necessary as well. The following example demonstrates the use of these properties: +```C# Snippet:QueryResourcesMetricsWithOptionsStartTimeEndTime +string resourceId = + "/subscriptions//resourceGroups//providers//storageAccounts/"; +var client = new MetricsClient( + new Uri("https://.metrics.monitor.azure.com"), + new DefaultAzureCredential()); +var options = new MetricsQueryResourcesOptions +{ + StartTime = DateTimeOffset.Now.AddHours(-4), + EndTime = DateTimeOffset.Now.AddHours(-1), + OrderBy = "sum asc", + Size = 10 +}; + +Response result = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options).ConfigureAwait(false); + +MetricsQueryResourcesResult metricsQueryResults = result.Value; +foreach (MetricsQueryResult value in metricsQueryResults.Values) +{ + Console.WriteLine(value.Metrics.Count); +} +``` + #### Register the client with dependency injection To register a client with the dependency injection container, invoke the corresponding extension method. diff --git a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.net8.0.cs b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.net8.0.cs index 08fcb0530b75..4967ae55c43c 100644 --- a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.net8.0.cs +++ b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.net8.0.cs @@ -157,11 +157,14 @@ public partial class MetricsQueryResourcesOptions { public MetricsQueryResourcesOptions() { } public System.Collections.Generic.IList Aggregations { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } set { } } public string Filter { get { throw null; } set { } } public System.TimeSpan? Granularity { get { throw null; } set { } } public string OrderBy { get { throw null; } set { } } public System.Collections.Generic.IList RollUpBy { get { throw null; } } public int? Size { get { throw null; } set { } } + public System.DateTimeOffset? StartTime { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Monitor.Query.QueryTimeRange? TimeRange { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs index 41e38f81678e..c2e6edd340a1 100644 --- a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs +++ b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs @@ -157,11 +157,14 @@ public partial class MetricsQueryResourcesOptions { public MetricsQueryResourcesOptions() { } public System.Collections.Generic.IList Aggregations { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } set { } } public string Filter { get { throw null; } set { } } public System.TimeSpan? Granularity { get { throw null; } set { } } public string OrderBy { get { throw null; } set { } } public System.Collections.Generic.IList RollUpBy { get { throw null; } } public int? Size { get { throw null; } set { } } + public System.DateTimeOffset? StartTime { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Monitor.Query.QueryTimeRange? TimeRange { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/monitor/Azure.Monitor.Query/assets.json b/sdk/monitor/Azure.Monitor.Query/assets.json index 5f9a259c23f0..7a1eadcd757d 100644 --- a/sdk/monitor/Azure.Monitor.Query/assets.json +++ b/sdk/monitor/Azure.Monitor.Query/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/monitor/Azure.Monitor.Query", - "Tag": "net/monitor/Azure.Monitor.Query_26f5d5d32f" + "Tag": "net/monitor/Azure.Monitor.Query_3bd28d9e3d" } diff --git a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj index e6fcaa9dbbbf..a6b3d7a16d2e 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj +++ b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj @@ -2,9 +2,9 @@ A library for querying Azure Monitor's Logs and Metrics data sources. Azure Monitor Query client library - 1.6.0-beta.1 + 1.7.0-beta.1 - 1.5.0 + 1.6.0 Azure Monitor Query true $(RequiredTargetFrameworks) diff --git a/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs b/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs index 21d346f9926d..f8ec2277781f 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/MetricsClient.cs @@ -148,11 +148,24 @@ private async Task> ExecuteBatchAsync(IEnu if (options != null) { - if (options.TimeRange != null) + if (options.TimeRange.HasValue) { startTime = options.TimeRange.Value.Start.ToIsoString(); endTime = options.TimeRange.Value.End.ToIsoString(); } + else + { + // Use values from Start and End TimeRange properties if they are set + if (options.StartTime.HasValue) + { + startTime = options.StartTime.Value.ToIsoString(); + } + if (options.EndTime.HasValue) + { + endTime = options.EndTime.Value.ToIsoString(); + } + } + aggregations = MetricsClientExtensions.CommaJoin(options.Aggregations); top = options.Size; orderBy = options.OrderBy; diff --git a/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs b/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs index 9c52dff5845f..91d59b1a4e9b 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/MetricsQueryResourcesOptions.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using Azure.Core; using Azure.Monitor.Query.Models; @@ -16,10 +17,20 @@ public class MetricsQueryResourcesOptions /// /// Gets or sets the timespan over which the metric will be queried. If only the starttime is set, the endtime default becomes the current time. When the endtime is specified, the starttime is necessary as well. Duration is disregarded. /// + [EditorBrowsable(EditorBrowsableState.Never)] [CodeGenMember("TimeSpan")] - // TODO: https://github.com/Azure/azure-sdk-for-net/issues/46454 public QueryTimeRange? TimeRange { get; set; } + /// + /// Gets the of the query. If only the is set, the default becomes the current time. When the is specified, the is necessary as well. + /// + public DateTimeOffset? StartTime { get; set; } + + /// + /// Gets the of the query. If only the is set, the default becomes the current time. When the is specified, the is necessary as well. + /// + public DateTimeOffset? EndTime { get; set; } + /// /// /// Gets the list of metric aggregations to retrieve. diff --git a/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs b/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs index 41d8d8023450..56c020429bdf 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/MetricsClientLiveTests.cs @@ -173,5 +173,69 @@ public void MetricsQueryResourcesInvalid() metricNames: new List { "Ingress" }, metricNamespace: "Microsoft.Storage/storageAccounts")); } + + [RecordedTest] + public async Task MetricsQueryResourcesWithStartTimeRangeAsync() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + // If only starttime is specified, then endtime defaults to the current time. + DateTimeOffset start = Recording.UtcNow.Subtract(TimeSpan.FromHours(4)); + + Response metricsResultsResponse = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { StartTime = start }).ConfigureAwait(false); + + Assert.AreEqual(200, metricsResultsResponse.GetRawResponse().Status); + MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; + Assert.AreEqual(1, metricsQueryResults.Values.Count); + Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); + Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); + } + + [RecordedTest] + public async Task MetricsQueryResourcesWithStartTimeEndTimeRangeAsync() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + DateTimeOffset start = Recording.UtcNow.Subtract(TimeSpan.FromHours(4)); + DateTimeOffset end = Recording.UtcNow; + + Response metricsResultsResponse = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { StartTime = start, EndTime = end }).ConfigureAwait(false); + + Assert.AreEqual(200, metricsResultsResponse.GetRawResponse().Status); + MetricsQueryResourcesResult metricsQueryResults = metricsResultsResponse.Value; + Assert.AreEqual(1, metricsQueryResults.Values.Count); + Assert.AreEqual(TestEnvironment.StorageAccountId + "/providers/Microsoft.Insights/metrics/Ingress", metricsQueryResults.Values[0].Metrics[0].Id); + Assert.AreEqual("Microsoft.Storage/storageAccounts", metricsQueryResults.Values[0].Namespace); + } + + [Test] + [SyncOnly] + public void MetricsQueryResourcesWithEndTimeRange() + { + MetricsClient client = CreateMetricsClient(); + + var resourceId = TestEnvironment.StorageAccountId; + + // If only the endtime parameter is given, then the starttime parameter is required. + DateTimeOffset end = new DateTimeOffset(TestStartTime).Subtract(TimeSpan.FromHours(4)); + + Assert.Throws(() => + client.QueryResources( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options: new MetricsQueryResourcesOptions { EndTime = end })); + } } } diff --git a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs index 323e2985aa52..18a1c97a4c64 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs @@ -307,5 +307,47 @@ public void CreateClientsWithOptions() logsQueryClientOptions); #endregion } + + [Test] + public async Task QueryResourcesMetricsWithOptionsStartTimeEndTime() + { + #region Snippet:QueryResourcesMetricsWithOptionsStartTimeEndTime +#if SNIPPET + string resourceId = + "/subscriptions//resourceGroups//providers//storageAccounts/"; + var client = new MetricsClient( + new Uri("https://.metrics.monitor.azure.com"), + new DefaultAzureCredential()); +#else + string resourceId = TestEnvironment.StorageAccountId; + var client = new MetricsClient( + new Uri(TestEnvironment.ConstructMetricsClientUri()), + new DefaultAzureCredential(), + new MetricsClientOptions() + { + Audience = TestEnvironment.GetMetricsClientAudience() + }); +#endif + var options = new MetricsQueryResourcesOptions + { + StartTime = DateTimeOffset.Now.AddHours(-4), + EndTime = DateTimeOffset.Now.AddHours(-1), + OrderBy = "sum asc", + Size = 10 + }; + + Response result = await client.QueryResourcesAsync( + resourceIds: new List { new ResourceIdentifier(resourceId) }, + metricNames: new List { "Ingress" }, + metricNamespace: "Microsoft.Storage/storageAccounts", + options).ConfigureAwait(false); + + MetricsQueryResourcesResult metricsQueryResults = result.Value; + foreach (MetricsQueryResult value in metricsQueryResults.Values) + { + Console.WriteLine(value.Metrics.Count); + } + #endregion Snippet:QueryResourcesMetricsWithOptionsStartTimeEndTime + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md index 9511b2bf5478..af595aa6f220 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md @@ -147,4 +147,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/README.md b/sdk/monitor/Azure.ResourceManager.Monitor/README.md index dbdd46c83158..1a7626701822 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/README.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/mysql/Azure.ResourceManager.MySql/CHANGELOG.md b/sdk/mysql/Azure.ResourceManager.MySql/CHANGELOG.md index 7a680768f2c9..99a2f1a127e5 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/CHANGELOG.md +++ b/sdk/mysql/Azure.ResourceManager.MySql/CHANGELOG.md @@ -99,8 +99,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -131,4 +131,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mysql/Azure.ResourceManager.MySql/README.md b/sdk/mysql/Azure.ResourceManager.MySql/README.md index 732da6ed8413..0403359dd237 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/README.md +++ b/sdk/mysql/Azure.ResourceManager.MySql/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/CHANGELOG.md b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/CHANGELOG.md index 76f04b3c674d..1af5fd5f042a 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/CHANGELOG.md +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/CHANGELOG.md @@ -24,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/README.md b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/README.md index 9dc2f33b462f..f43fa50a7469 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/README.md +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/README.md @@ -41,7 +41,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md b/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md index c4d723d1ce4d..3c0b49ab3898 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md +++ b/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md @@ -169,8 +169,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -203,4 +203,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/README.md b/sdk/netapp/Azure.ResourceManager.NetApp/README.md index bc5e41269b32..e5f0ffe54b6b 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/README.md +++ b/sdk/netapp/Azure.ResourceManager.NetApp/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md b/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md index f1044c26805a..edce1536a2a1 100644 --- a/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md +++ b/sdk/network/Azure.ResourceManager.Network/CHANGELOG.md @@ -1,17 +1,27 @@ # Release History -## 1.10.0-beta.1 (Unreleased) +## 1.10.0-beta.2 (Unreleased) ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. - ### Breaking Changes ### Bugs Fixed +- Fixed an issue that the `AzureFirewallIPGroups` can't handle number type `ChangeNumber`. + ### Other Changes +## 1.10.0-beta.1 (2024-12-11) + +### Features Added + +- Exposed `JsonModelWriteCore` for model serialization procedure. +- Please use the properties in `LoadBalancingRuleData.Properties` to set the properties of the LoadBalancingRule, instead of using those properties at the root level of `LoadBalancingRuleData` class. +- Please use the properties in `LoadBalancerInboundNatPool.Properties` to set the properties of the LoadBalancerInboundNatPool, instead of using those properties at the root level of `LoadBalancerInboundNatPool` class. +- Added `LoadBalancingRuleProperties` which supports `AdditionalProperties` to send and receive private/internal properties supported by the service. +- Added `LoadBalancerInboundNatPoolProperties` which supports `AdditionalProperties` to send and receive private/internal properties supported by the service. + ## 1.9.0 (2024-09-12) ### Features Added @@ -205,8 +215,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -296,7 +306,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). ### Management Client Changes diff --git a/sdk/network/Azure.ResourceManager.Network/README.md b/sdk/network/Azure.ResourceManager.Network/README.md index df2b252ab5e1..edb0e7865757 100644 --- a/sdk/network/Azure.ResourceManager.Network/README.md +++ b/sdk/network/Azure.ResourceManager.Network/README.md @@ -44,7 +44,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs index 8cdf229d8f5e..1a526fb177c1 100644 --- a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs +++ b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.net8.0.cs @@ -2751,19 +2751,33 @@ protected LoadBalancingRuleCollection() { } public partial class LoadBalancingRuleData : Azure.ResourceManager.Network.Models.NetworkResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LoadBalancingRuleData() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier BackendAddressPoolId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IList BackendAddressPools { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? BackendPort { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? DisableOutboundSnat { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableFloatingIP { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableTcpReset { get { throw null; } set { } } public Azure.ETag? ETag { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? FrontendPort { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? IdleTimeoutInMinutes { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.LoadDistribution? LoadDistribution { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier ProbeId { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties Properties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? Protocol { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Network.LoadBalancingRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9576,8 +9590,14 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.Models.LearnedIPPrefixesListResult LearnedIPPrefixesListResult(System.Collections.Generic.IEnumerable ipPrefixes = null) { throw null; } public static Azure.ResourceManager.Network.Models.LoadBalancerBackendAddress LoadBalancerBackendAddress(string name = null, Azure.Core.ResourceIdentifier virtualNetworkId = null, Azure.Core.ResourceIdentifier subnetId = null, string ipAddress = null, Azure.Core.ResourceIdentifier networkInterfaceIPConfigurationId = null, Azure.Core.ResourceIdentifier loadBalancerFrontendIPConfigurationId = null, System.Collections.Generic.IEnumerable inboundNatRulesPortMapping = null, Azure.ResourceManager.Network.Models.LoadBalancerBackendAddressAdminState? adminState = default(Azure.ResourceManager.Network.Models.LoadBalancerBackendAddressAdminState?)) { throw null; } public static Azure.ResourceManager.Network.LoadBalancerData LoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, Azure.ResourceManager.Network.Models.LoadBalancerSku sku = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable frontendIPConfigurations = null, System.Collections.Generic.IEnumerable backendAddressPools = null, System.Collections.Generic.IEnumerable loadBalancingRules = null, System.Collections.Generic.IEnumerable probes = null, System.Collections.Generic.IEnumerable inboundNatRules = null, System.Collections.Generic.IEnumerable inboundNatPools = null, System.Collections.Generic.IEnumerable outboundRules = null, System.Guid? resourceGuid = default(System.Guid?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPool LoadBalancerInboundNatPool(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPool LoadBalancerInboundNatPool(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol?), int? frontendPortRangeStart = default(int?), int? frontendPortRangeEnd = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties LoadBalancerInboundNatPoolProperties(Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol), int frontendPortRangeStart = 0, int frontendPortRangeEnd = 0, int backendPort = 0, int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.ResourceManager.Network.LoadBalancingRuleData LoadBalancingRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.LoadBalancingRuleData LoadBalancingRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier backendAddressPoolId = null, System.Collections.Generic.IEnumerable backendAddressPools = null, Azure.Core.ResourceIdentifier probeId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol?), Azure.ResourceManager.Network.Models.LoadDistribution? loadDistribution = default(Azure.ResourceManager.Network.Models.LoadDistribution?), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties LoadBalancingRuleProperties(Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier backendAddressPoolId = null, System.Collections.Generic.IEnumerable backendAddressPools = null, Azure.Core.ResourceIdentifier probeId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol), Azure.ResourceManager.Network.Models.LoadDistribution? loadDistribution = default(Azure.ResourceManager.Network.Models.LoadDistribution?), int frontendPort = 0, int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } public static Azure.ResourceManager.Network.LocalNetworkGatewayData LocalNetworkGatewayData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable localNetworkAddressPrefixes = null, string gatewayIPAddress = null, string fqdn = null, Azure.ResourceManager.Network.Models.BgpSettings bgpSettings = null, System.Guid? resourceGuid = default(System.Guid?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.Models.MatchedRule MatchedRule(string ruleName = null, string action = null) { throw null; } public static Azure.ResourceManager.Network.Models.MigrateLoadBalancerToIPBasedResult MigrateLoadBalancerToIPBasedResult(System.Collections.Generic.IEnumerable migratedPools = null) { throw null; } @@ -13683,15 +13703,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class LoadBalancerInboundNatPool : Azure.ResourceManager.Network.Models.NetworkResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LoadBalancerInboundNatPool() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? BackendPort { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableFloatingIP { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableTcpReset { get { throw null; } set { } } public Azure.ETag? ETag { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? FrontendPortRangeEnd { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? FrontendPortRangeStart { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties Properties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? Protocol { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPool System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -13700,6 +13730,26 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LoadBalancerInboundNatPoolProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoadBalancerInboundNatPoolProperties(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public int BackendPort { get { throw null; } set { } } + public bool? EnableFloatingIP { get { throw null; } set { } } + public bool? EnableTcpReset { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + public int FrontendPortRangeEnd { get { throw null; } set { } } + public int FrontendPortRangeStart { get { throw null; } set { } } + public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol Protocol { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LoadBalancerOutboundRuleProtocol : System.IEquatable { @@ -13791,6 +13841,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LoadBalancingRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoadBalancingRuleProperties(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol, int frontendPort) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public Azure.Core.ResourceIdentifier BackendAddressPoolId { get { throw null; } set { } } + public System.Collections.Generic.IList BackendAddressPools { get { throw null; } } + public int? BackendPort { get { throw null; } set { } } + public bool? DisableOutboundSnat { get { throw null; } set { } } + public bool? EnableFloatingIP { get { throw null; } set { } } + public bool? EnableTcpReset { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + public int FrontendPort { get { throw null; } set { } } + public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadDistribution? LoadDistribution { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ProbeId { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol Protocol { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LoadBalancingTransportProtocol : System.IEquatable { diff --git a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs index 8cdf229d8f5e..1a526fb177c1 100644 --- a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs +++ b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs @@ -2751,19 +2751,33 @@ protected LoadBalancingRuleCollection() { } public partial class LoadBalancingRuleData : Azure.ResourceManager.Network.Models.NetworkResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LoadBalancingRuleData() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier BackendAddressPoolId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IList BackendAddressPools { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? BackendPort { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? DisableOutboundSnat { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableFloatingIP { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableTcpReset { get { throw null; } set { } } public Azure.ETag? ETag { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? FrontendPort { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? IdleTimeoutInMinutes { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.LoadDistribution? LoadDistribution { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier ProbeId { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties Properties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? Protocol { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Network.LoadBalancingRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9576,8 +9590,14 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.Models.LearnedIPPrefixesListResult LearnedIPPrefixesListResult(System.Collections.Generic.IEnumerable ipPrefixes = null) { throw null; } public static Azure.ResourceManager.Network.Models.LoadBalancerBackendAddress LoadBalancerBackendAddress(string name = null, Azure.Core.ResourceIdentifier virtualNetworkId = null, Azure.Core.ResourceIdentifier subnetId = null, string ipAddress = null, Azure.Core.ResourceIdentifier networkInterfaceIPConfigurationId = null, Azure.Core.ResourceIdentifier loadBalancerFrontendIPConfigurationId = null, System.Collections.Generic.IEnumerable inboundNatRulesPortMapping = null, Azure.ResourceManager.Network.Models.LoadBalancerBackendAddressAdminState? adminState = default(Azure.ResourceManager.Network.Models.LoadBalancerBackendAddressAdminState?)) { throw null; } public static Azure.ResourceManager.Network.LoadBalancerData LoadBalancerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, Azure.ResourceManager.Network.Models.LoadBalancerSku sku = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable frontendIPConfigurations = null, System.Collections.Generic.IEnumerable backendAddressPools = null, System.Collections.Generic.IEnumerable loadBalancingRules = null, System.Collections.Generic.IEnumerable probes = null, System.Collections.Generic.IEnumerable inboundNatRules = null, System.Collections.Generic.IEnumerable inboundNatPools = null, System.Collections.Generic.IEnumerable outboundRules = null, System.Guid? resourceGuid = default(System.Guid?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPool LoadBalancerInboundNatPool(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPool LoadBalancerInboundNatPool(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol?), int? frontendPortRangeStart = default(int?), int? frontendPortRangeEnd = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties LoadBalancerInboundNatPoolProperties(Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol), int frontendPortRangeStart = 0, int frontendPortRangeEnd = 0, int backendPort = 0, int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } + public static Azure.ResourceManager.Network.LoadBalancingRuleData LoadBalancingRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Network.LoadBalancingRuleData LoadBalancingRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier backendAddressPoolId = null, System.Collections.Generic.IEnumerable backendAddressPools = null, Azure.Core.ResourceIdentifier probeId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol?), Azure.ResourceManager.Network.Models.LoadDistribution? loadDistribution = default(Azure.ResourceManager.Network.Models.LoadDistribution?), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties LoadBalancingRuleProperties(Azure.Core.ResourceIdentifier frontendIPConfigurationId = null, Azure.Core.ResourceIdentifier backendAddressPoolId = null, System.Collections.Generic.IEnumerable backendAddressPools = null, Azure.Core.ResourceIdentifier probeId = null, Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol = default(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol), Azure.ResourceManager.Network.Models.LoadDistribution? loadDistribution = default(Azure.ResourceManager.Network.Models.LoadDistribution?), int frontendPort = 0, int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?), System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } public static Azure.ResourceManager.Network.LocalNetworkGatewayData LocalNetworkGatewayData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable localNetworkAddressPrefixes = null, string gatewayIPAddress = null, string fqdn = null, Azure.ResourceManager.Network.Models.BgpSettings bgpSettings = null, System.Guid? resourceGuid = default(System.Guid?), Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.Models.MatchedRule MatchedRule(string ruleName = null, string action = null) { throw null; } public static Azure.ResourceManager.Network.Models.MigrateLoadBalancerToIPBasedResult MigrateLoadBalancerToIPBasedResult(System.Collections.Generic.IEnumerable migratedPools = null) { throw null; } @@ -13683,15 +13703,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class LoadBalancerInboundNatPool : Azure.ResourceManager.Network.Models.NetworkResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LoadBalancerInboundNatPool() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? BackendPort { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableFloatingIP { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableTcpReset { get { throw null; } set { } } public Azure.ETag? ETag { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? FrontendPortRangeEnd { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? FrontendPortRangeStart { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties Properties { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol? Protocol { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPool System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -13700,6 +13730,26 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LoadBalancerInboundNatPoolProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoadBalancerInboundNatPoolProperties(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public int BackendPort { get { throw null; } set { } } + public bool? EnableFloatingIP { get { throw null; } set { } } + public bool? EnableTcpReset { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + public int FrontendPortRangeEnd { get { throw null; } set { } } + public int FrontendPortRangeStart { get { throw null; } set { } } + public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol Protocol { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancerInboundNatPoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LoadBalancerOutboundRuleProtocol : System.IEquatable { @@ -13791,6 +13841,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LoadBalancingRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoadBalancingRuleProperties(Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol protocol, int frontendPort) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public Azure.Core.ResourceIdentifier BackendAddressPoolId { get { throw null; } set { } } + public System.Collections.Generic.IList BackendAddressPools { get { throw null; } } + public int? BackendPort { get { throw null; } set { } } + public bool? DisableOutboundSnat { get { throw null; } set { } } + public bool? EnableFloatingIP { get { throw null; } set { } } + public bool? EnableTcpReset { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FrontendIPConfigurationId { get { throw null; } set { } } + public int FrontendPort { get { throw null; } set { } } + public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadDistribution? LoadDistribution { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ProbeId { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.LoadBalancingTransportProtocol Protocol { get { throw null; } set { } } + public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Network.Models.LoadBalancingRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LoadBalancingTransportProtocol : System.IEquatable { diff --git a/sdk/network/Azure.ResourceManager.Network/assets.json b/sdk/network/Azure.ResourceManager.Network/assets.json index 9938a3d7125b..803a213f1a28 100644 --- a/sdk/network/Azure.ResourceManager.Network/assets.json +++ b/sdk/network/Azure.ResourceManager.Network/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/network/Azure.ResourceManager.Network", - "Tag": "net/network/Azure.ResourceManager.Network_8dc108eec8" + "Tag": "net/network/Azure.ResourceManager.Network_a0e0fe636b" } diff --git a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_LoadBalancerCollection.cs b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_LoadBalancerCollection.cs index 72488d1f2278..38473dbdf08f 100644 --- a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_LoadBalancerCollection.cs +++ b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_LoadBalancerCollection.cs @@ -58,16 +58,17 @@ public async Task CreateOrUpdate_CreateLoadBalancer() }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, EnableTcpReset = false, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -149,15 +150,16 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithFrontendIPInZone1() }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -239,15 +241,16 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithGatewayLoadBalancerConsum }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -341,18 +344,19 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithGatewayLoadBalancerProvid }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.All, 0) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPools = {new WritableSubResource { Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), }}, ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.All, LoadDistribution = LoadDistribution.Default, -FrontendPort = 0, BackendPort = 0, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -426,6 +430,8 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithGatewayLoadBalancerProvid }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.All, 0) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPools = {new WritableSubResource { @@ -435,12 +441,11 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithGatewayLoadBalancerProvid Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"), }}, ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.All, LoadDistribution = LoadDistribution.Default, -FrontendPort = 0, BackendPort = 0, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -517,15 +522,16 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithGlobalTierAndOneRegionalL }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = false, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -594,15 +600,16 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithStandardSKU() }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -685,15 +692,16 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithSyncModePropertyOnPool() }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, +}, Name = "rulelb", }}, Probes = {new ProbeData @@ -777,14 +785,13 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithInboundNatPool() InboundNatRules = { }, InboundNatPools = {new LoadBalancerInboundNatPool { +Properties = new LoadBalancerInboundNatPoolProperties(LoadBalancingTransportProtocol.Tcp, 8080, 8085, 8888) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), -Protocol = LoadBalancingTransportProtocol.Tcp, -FrontendPortRangeStart = 8080, -FrontendPortRangeEnd = 8085, -BackendPort = 8888, IdleTimeoutInMinutes = 10, EnableFloatingIP = true, EnableTcpReset = true, +}, Id = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), Name = "test", }}, @@ -845,16 +852,17 @@ public async Task CreateOrUpdate_CreateLoadBalancerWithOutboundRules() }}, LoadBalancingRules = {new LoadBalancingRuleData { +Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) +{ FrontendIPConfigurationId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), BackendAddressPoolId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"), ProbeId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb"), -Protocol = LoadBalancingTransportProtocol.Tcp, LoadDistribution = LoadDistribution.Default, -FrontendPort = 80, BackendPort = 80, IdleTimeoutInMinutes = 15, EnableFloatingIP = true, DisableOutboundSnat = true, +}, Name = "rulelb", }}, Probes = {new ProbeData diff --git a/sdk/network/Azure.ResourceManager.Network/src/Azure.ResourceManager.Network.csproj b/sdk/network/Azure.ResourceManager.Network/src/Azure.ResourceManager.Network.csproj index d104b82cc8f4..e6f4ba00afd5 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Azure.ResourceManager.Network.csproj +++ b/sdk/network/Azure.ResourceManager.Network/src/Azure.ResourceManager.Network.csproj @@ -1,6 +1,6 @@ - 1.10.0-beta.1 + 1.10.0-beta.2 1.9.0 Azure.ResourceManager.Network diff --git a/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs b/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs index 9607da059fc1..9c79c7206782 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Customization/ArmNetworkModelFactory.cs @@ -313,5 +313,86 @@ public static InboundSecurityRule InboundSecurityRule(ResourceIdentifier id, str { return InboundSecurityRule(id: id, name: name, resourceType: resourceType, etag: etag, ruleType: default, rules: rules, provisioningState: provisioningState); } + + /// Initializes a new instance of . + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever the resource is updated. + /// A reference to frontend IP addresses. + /// The reference to the transport protocol used by the inbound NAT pool. + /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + /// The provisioning state of the inbound NAT pool resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static LoadBalancerInboundNatPool LoadBalancerInboundNatPool(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, ETag? etag = null, ResourceIdentifier frontendIPConfigurationId = null, LoadBalancingTransportProtocol? protocol = null, int? frontendPortRangeStart = null, int? frontendPortRangeEnd = null, int? backendPort = null, int? idleTimeoutInMinutes = null, bool? enableFloatingIP = null, bool? enableTcpReset = null, NetworkProvisioningState? provisioningState = null) + { + return LoadBalancerInboundNatPool( + id: id, + name: name, + resourceType: resourceType, + etag: etag, + properties: LoadBalancerInboundNatPoolProperties( + frontendIPConfigurationId: frontendIPConfigurationId, + protocol: protocol ?? default, + frontendPortRangeStart: frontendPortRangeStart ?? default, + frontendPortRangeEnd: frontendPortRangeEnd ?? default, + backendPort: backendPort ?? default, + idleTimeoutInMinutes: idleTimeoutInMinutes, + enableFloatingIP: enableFloatingIP, + enableTcpReset: enableTcpReset, + provisioningState: provisioningState) + ); + } + + + /// Initializes a new instance of . + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever the resource is updated. + /// A reference to frontend IP addresses. + /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + /// An array of references to pool of DIPs. + /// The reference to the load balancer probe used by the load balancing rule. + /// The reference to the transport protocol used by the load balancing rule. + /// The load distribution policy for this rule. + /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + /// The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + /// The provisioning state of the load balancing rule resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static LoadBalancingRuleData LoadBalancingRuleData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, ETag? etag = null, ResourceIdentifier frontendIPConfigurationId = null, ResourceIdentifier backendAddressPoolId = null, IEnumerable backendAddressPools = null, ResourceIdentifier probeId = null, LoadBalancingTransportProtocol? protocol = null, LoadDistribution? loadDistribution = null, int? frontendPort = null, int? backendPort = null, int? idleTimeoutInMinutes = null, bool? enableFloatingIP = null, bool? enableTcpReset = null, bool? disableOutboundSnat = null, NetworkProvisioningState? provisioningState = null) + { + return LoadBalancingRuleData( + id: id, + name: name, + resourceType: resourceType, + etag: etag, + properties: LoadBalancingRuleProperties( + frontendIPConfigurationId: frontendIPConfigurationId, + backendAddressPoolId: backendAddressPoolId, + backendAddressPools: backendAddressPools, + probeId: probeId, + protocol: protocol ?? default, + loadDistribution: loadDistribution ?? default, + frontendPort: frontendPort ?? default, + backendPort: backendPort ?? default, + idleTimeoutInMinutes: idleTimeoutInMinutes, + enableFloatingIP: enableFloatingIP, + enableTcpReset: enableTcpReset, + disableOutboundSnat: disableOutboundSnat, + provisioningState: provisioningState) + ); + } } } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Customization/LoadBalancingRuleData.cs b/sdk/network/Azure.ResourceManager.Network/src/Customization/LoadBalancingRuleData.cs new file mode 100644 index 000000000000..ea19aa453ace --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Customization/LoadBalancingRuleData.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.Core; +using Azure.ResourceManager.Network.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Network +{ + public partial class LoadBalancingRuleData : NetworkResourceData + { + /// Gets or sets Id. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceIdentifier FrontendIPConfigurationId + { + get => Properties?.FrontendIPConfigurationId; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.FrontendIPConfigurationId = value; + } + } + + /// Gets or sets Id. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceIdentifier BackendAddressPoolId + { + get => Properties?.BackendAddressPoolId; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.BackendAddressPoolId = value; + } + } + + /// An array of references to pool of DIPs. + [EditorBrowsable(EditorBrowsableState.Never)] + public IList BackendAddressPools => Properties?.BackendAddressPools; + + /// Gets or sets Id. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceIdentifier ProbeId + { + get => Properties?.ProbeId; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.ProbeId = value; + } + } + + /// The reference to the transport protocol used by the load balancing rule. + [EditorBrowsable(EditorBrowsableState.Never)] + public LoadBalancingTransportProtocol? Protocol + { + get => Properties?.Protocol; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.Protocol = value ?? default; + } + } + + /// The load distribution policy for this rule. + [EditorBrowsable(EditorBrowsableState.Never)] + public LoadDistribution? LoadDistribution + { + get => Properties?.LoadDistribution; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.LoadDistribution = value; + } + } + + /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + [EditorBrowsable(EditorBrowsableState.Never)] + public int? FrontendPort + { + get => Properties?.FrontendPort; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.FrontendPort = value ?? default; + } + } + + /// The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + [EditorBrowsable(EditorBrowsableState.Never)] + public int? BackendPort + { + get => Properties?.BackendPort; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.BackendPort = value; + } + } + + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? IdleTimeoutInMinutes + { + get => Properties?.IdleTimeoutInMinutes; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.IdleTimeoutInMinutes = value; + } + } + + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool? EnableFloatingIP + { + get => Properties?.EnableFloatingIP; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.EnableFloatingIP = value; + } + } + + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool? EnableTcpReset + { + get => Properties?.EnableTcpReset; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.EnableTcpReset = value; + } + } + + /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool? DisableOutboundSnat + { + get => Properties?.DisableOutboundSnat; + set + { + if (Properties is null) + { + Properties = new LoadBalancingRuleProperties(); + } + Properties.DisableOutboundSnat = value; + } + } + + /// The provisioning state of the load balancing rule resource. + [EditorBrowsable(EditorBrowsableState.Never)] + public NetworkProvisioningState? ProvisioningState => Properties?.ProvisioningState; + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Customization/Models/AzureFirewallIPGroups.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Customization/Models/AzureFirewallIPGroups.Serialization.cs new file mode 100644 index 000000000000..870cb1ace0ec --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Customization/Models/AzureFirewallIPGroups.Serialization.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.Runtime.CompilerServices; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Network.Models +{ + // This is a fix for issue: https://github.com/Azure/azure-sdk-for-net/issues/46767 + [CodeGenSerialization(nameof(ChangeNumber), DeserializationValueHook = nameof(DeserializeNumberValue))] + public partial class AzureFirewallIPGroups + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void DeserializeNumberValue(JsonProperty property, ref string changeNumber) + { + changeNumber = property.Value.ValueKind == JsonValueKind.Number ? property.Value.GetUInt64().ToString() : property.Value.GetString(); + } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Customization/Models/LoadBalancerInboundNatPool.cs b/sdk/network/Azure.ResourceManager.Network/src/Customization/Models/LoadBalancerInboundNatPool.cs new file mode 100644 index 000000000000..637e0f879298 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Customization/Models/LoadBalancerInboundNatPool.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; +using Azure.Core; + +namespace Azure.ResourceManager.Network.Models +{ + public partial class LoadBalancerInboundNatPool : NetworkResourceData + { + /// Gets or sets Id. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceIdentifier FrontendIPConfigurationId + { + get => Properties?.FrontendIPConfigurationId; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.FrontendIPConfigurationId = value; + } + } + + /// The reference to the transport protocol used by the inbound NAT pool. + [EditorBrowsable(EditorBrowsableState.Never)] + public LoadBalancingTransportProtocol? Protocol + { + get => Properties?.Protocol; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.Protocol = value ?? default; + } + } + + /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? FrontendPortRangeStart + { + get => Properties?.FrontendPortRangeStart; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.FrontendPortRangeStart = value ?? default; + } + } + + /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? FrontendPortRangeEnd + { + get => Properties?.FrontendPortRangeEnd; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.FrontendPortRangeEnd = value ?? default; + } + } + + /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? BackendPort + { + get => Properties?.BackendPort; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.BackendPort = value ?? default; + } + } + + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? IdleTimeoutInMinutes + { + get => Properties?.IdleTimeoutInMinutes; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.IdleTimeoutInMinutes = value; + } + } + + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool? EnableFloatingIP + { + get => Properties?.EnableFloatingIP; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.EnableFloatingIP = value; + } + } + + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool? EnableTcpReset + { + get => Properties?.EnableTcpReset; + set + { + if (Properties is null) + { + Properties = new LoadBalancerInboundNatPoolProperties(); + } + Properties.EnableTcpReset = value; + } + } + + /// The provisioning state of the inbound NAT pool resource. + [EditorBrowsable(EditorBrowsableState.Never)] + public NetworkProvisioningState? ProvisioningState => Properties?.ProvisioningState; + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs index dc998c8bbe9d..e907e48af83d 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs @@ -3773,7 +3773,21 @@ public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, st /// Resource ID. /// Resource name. /// Resource type. + /// Properties of load balancer load balancing rule. /// A unique read-only string that changes whenever the resource is updated. + /// A new instance for mocking. + public static LoadBalancingRuleData LoadBalancingRuleData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, LoadBalancingRuleProperties properties = null, ETag? etag = null) + { + return new LoadBalancingRuleData( + id, + name, + resourceType, + serializedAdditionalRawData: null, + properties, + etag); + } + + /// Initializes a new instance of . /// A reference to frontend IP addresses. /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. /// An array of references to pool of DIPs. @@ -3787,17 +3801,14 @@ public static LoadBalancerData LoadBalancerData(ResourceIdentifier id = null, st /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. /// The provisioning state of the load balancing rule resource. - /// A new instance for mocking. - public static LoadBalancingRuleData LoadBalancingRuleData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, ETag? etag = null, ResourceIdentifier frontendIPConfigurationId = null, ResourceIdentifier backendAddressPoolId = null, IEnumerable backendAddressPools = null, ResourceIdentifier probeId = null, LoadBalancingTransportProtocol? protocol = null, LoadDistribution? loadDistribution = null, int? frontendPort = null, int? backendPort = null, int? idleTimeoutInMinutes = null, bool? enableFloatingIP = null, bool? enableTcpReset = null, bool? disableOutboundSnat = null, NetworkProvisioningState? provisioningState = null) + /// Additional Properties. + /// A new instance for mocking. + public static LoadBalancingRuleProperties LoadBalancingRuleProperties(ResourceIdentifier frontendIPConfigurationId = null, ResourceIdentifier backendAddressPoolId = null, IEnumerable backendAddressPools = null, ResourceIdentifier probeId = null, LoadBalancingTransportProtocol protocol = default, LoadDistribution? loadDistribution = null, int frontendPort = default, int? backendPort = null, int? idleTimeoutInMinutes = null, bool? enableFloatingIP = null, bool? enableTcpReset = null, bool? disableOutboundSnat = null, NetworkProvisioningState? provisioningState = null, IDictionary additionalProperties = null) { backendAddressPools ??= new List(); + additionalProperties ??= new Dictionary(); - return new LoadBalancingRuleData( - id, - name, - resourceType, - serializedAdditionalRawData: null, - etag, + return new LoadBalancingRuleProperties( frontendIPConfigurationId != null ? ResourceManagerModelFactory.WritableSubResource(frontendIPConfigurationId) : null, backendAddressPoolId != null ? ResourceManagerModelFactory.WritableSubResource(backendAddressPoolId) : null, backendAddressPools?.ToList(), @@ -3810,7 +3821,8 @@ public static LoadBalancingRuleData LoadBalancingRuleData(ResourceIdentifier id enableFloatingIP, enableTcpReset, disableOutboundSnat, - provisioningState); + provisioningState, + additionalProperties); } /// Initializes a new instance of . @@ -3853,7 +3865,21 @@ public static ProbeData ProbeData(ResourceIdentifier id = null, string name = nu /// Resource ID. /// Resource name. /// Resource type. + /// Properties of load balancer inbound nat pool. /// A unique read-only string that changes whenever the resource is updated. + /// A new instance for mocking. + public static LoadBalancerInboundNatPool LoadBalancerInboundNatPool(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, LoadBalancerInboundNatPoolProperties properties = null, ETag? etag = null) + { + return new LoadBalancerInboundNatPool( + id, + name, + resourceType, + serializedAdditionalRawData: null, + properties, + etag); + } + + /// Initializes a new instance of . /// A reference to frontend IP addresses. /// The reference to the transport protocol used by the inbound NAT pool. /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. @@ -3863,15 +3889,13 @@ public static ProbeData ProbeData(ResourceIdentifier id = null, string name = nu /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. /// The provisioning state of the inbound NAT pool resource. - /// A new instance for mocking. - public static LoadBalancerInboundNatPool LoadBalancerInboundNatPool(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, ETag? etag = null, ResourceIdentifier frontendIPConfigurationId = null, LoadBalancingTransportProtocol? protocol = null, int? frontendPortRangeStart = null, int? frontendPortRangeEnd = null, int? backendPort = null, int? idleTimeoutInMinutes = null, bool? enableFloatingIP = null, bool? enableTcpReset = null, NetworkProvisioningState? provisioningState = null) + /// Additional Properties. + /// A new instance for mocking. + public static LoadBalancerInboundNatPoolProperties LoadBalancerInboundNatPoolProperties(ResourceIdentifier frontendIPConfigurationId = null, LoadBalancingTransportProtocol protocol = default, int frontendPortRangeStart = default, int frontendPortRangeEnd = default, int backendPort = default, int? idleTimeoutInMinutes = null, bool? enableFloatingIP = null, bool? enableTcpReset = null, NetworkProvisioningState? provisioningState = null, IDictionary additionalProperties = null) { - return new LoadBalancerInboundNatPool( - id, - name, - resourceType, - serializedAdditionalRawData: null, - etag, + additionalProperties ??= new Dictionary(); + + return new LoadBalancerInboundNatPoolProperties( frontendIPConfigurationId != null ? ResourceManagerModelFactory.WritableSubResource(frontendIPConfigurationId) : null, protocol, frontendPortRangeStart, @@ -3880,7 +3904,8 @@ public static LoadBalancerInboundNatPool LoadBalancerInboundNatPool(ResourceIden idleTimeoutInMinutes, enableFloatingIP, enableTcpReset, - provisioningState); + provisioningState, + additionalProperties); } /// Initializes a new instance of . diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.Serialization.cs index b601822565af..af0bd2e47298 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.Serialization.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.Serialization.cs @@ -11,7 +11,6 @@ using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Network.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Network { @@ -37,84 +36,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } if (options.Format != "W" && Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(FrontendIPConfiguration)) - { - writer.WritePropertyName("frontendIPConfiguration"u8); - JsonSerializer.Serialize(writer, FrontendIPConfiguration); - } - if (Optional.IsDefined(BackendAddressPool)) - { - writer.WritePropertyName("backendAddressPool"u8); - JsonSerializer.Serialize(writer, BackendAddressPool); - } - if (Optional.IsCollectionDefined(BackendAddressPools)) - { - writer.WritePropertyName("backendAddressPools"u8); - writer.WriteStartArray(); - foreach (var item in BackendAddressPools) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Probe)) - { - writer.WritePropertyName("probe"u8); - JsonSerializer.Serialize(writer, Probe); - } - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol.Value.ToString()); - } - if (Optional.IsDefined(LoadDistribution)) - { - writer.WritePropertyName("loadDistribution"u8); - writer.WriteStringValue(LoadDistribution.Value.ToString()); - } - if (Optional.IsDefined(FrontendPort)) - { - writer.WritePropertyName("frontendPort"u8); - writer.WriteNumberValue(FrontendPort.Value); - } - if (Optional.IsDefined(BackendPort)) - { - writer.WritePropertyName("backendPort"u8); - writer.WriteNumberValue(BackendPort.Value); - } - if (Optional.IsDefined(IdleTimeoutInMinutes)) - { - writer.WritePropertyName("idleTimeoutInMinutes"u8); - writer.WriteNumberValue(IdleTimeoutInMinutes.Value); - } - if (Optional.IsDefined(EnableFloatingIP)) - { - writer.WritePropertyName("enableFloatingIP"u8); - writer.WriteBooleanValue(EnableFloatingIP.Value); - } - if (Optional.IsDefined(EnableTcpReset)) - { - writer.WritePropertyName("enableTcpReset"u8); - writer.WriteBooleanValue(EnableTcpReset.Value); - } - if (Optional.IsDefined(DisableOutboundSnat)) - { - writer.WritePropertyName("disableOutboundSnat"u8); - writer.WriteBooleanValue(DisableOutboundSnat.Value); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); } LoadBalancingRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -137,27 +68,24 @@ internal static LoadBalancingRuleData DeserializeLoadBalancingRuleData(JsonEleme { return null; } + LoadBalancingRuleProperties properties = default; ETag? etag = default; ResourceIdentifier id = default; string name = default; ResourceType? type = default; - WritableSubResource frontendIPConfiguration = default; - WritableSubResource backendAddressPool = default; - IList backendAddressPools = default; - WritableSubResource probe = default; - LoadBalancingTransportProtocol? protocol = default; - LoadDistribution? loadDistribution = default; - int? frontendPort = default; - int? backendPort = default; - int? idleTimeoutInMinutes = default; - bool? enableFloatingIP = default; - bool? enableTcpReset = default; - bool? disableOutboundSnat = default; - NetworkProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = LoadBalancingRuleProperties.DeserializeLoadBalancingRuleProperties(property.Value, options); + continue; + } if (property.NameEquals("etag"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -190,140 +118,6 @@ internal static LoadBalancingRuleData DeserializeLoadBalancingRuleData(JsonEleme type = new ResourceType(property.Value.GetString()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("frontendIPConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - frontendIPConfiguration = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("backendAddressPool"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backendAddressPool = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("backendAddressPools"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - backendAddressPools = array; - continue; - } - if (property0.NameEquals("probe"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - probe = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("protocol"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - protocol = new LoadBalancingTransportProtocol(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("loadDistribution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - loadDistribution = new LoadDistribution(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("frontendPort"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - frontendPort = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("backendPort"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backendPort = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("idleTimeoutInMinutes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - idleTimeoutInMinutes = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("enableFloatingIP"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFloatingIP = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enableTcpReset"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableTcpReset = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("disableOutboundSnat"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - disableOutboundSnat = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -335,20 +129,8 @@ internal static LoadBalancingRuleData DeserializeLoadBalancingRuleData(JsonEleme name, type, serializedAdditionalRawData, - etag, - frontendIPConfiguration, - backendAddressPool, - backendAddressPools ?? new ChangeTrackingList(), - probe, - protocol, - loadDistribution, - frontendPort, - backendPort, - idleTimeoutInMinutes, - enableFloatingIP, - enableTcpReset, - disableOutboundSnat, - provisioningState); + properties, + etag); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.cs index 63ad3de845ed..068fdd870880 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancingRuleData.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.Network.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Network { @@ -22,7 +21,6 @@ public partial class LoadBalancingRuleData : NetworkResourceData /// Initializes a new instance of . public LoadBalancingRuleData() { - BackendAddressPools = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -30,101 +28,17 @@ public LoadBalancingRuleData() /// Resource name. /// Resource type. /// Keeps track of any properties unknown to the library. + /// Properties of load balancer load balancing rule. /// A unique read-only string that changes whenever the resource is updated. - /// A reference to frontend IP addresses. - /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. - /// An array of references to pool of DIPs. - /// The reference to the load balancer probe used by the load balancing rule. - /// The reference to the transport protocol used by the load balancing rule. - /// The load distribution policy for this rule. - /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - /// The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". - /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. - /// The provisioning state of the load balancing rule resource. - internal LoadBalancingRuleData(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, ETag? etag, WritableSubResource frontendIPConfiguration, WritableSubResource backendAddressPool, IList backendAddressPools, WritableSubResource probe, LoadBalancingTransportProtocol? protocol, LoadDistribution? loadDistribution, int? frontendPort, int? backendPort, int? idleTimeoutInMinutes, bool? enableFloatingIP, bool? enableTcpReset, bool? disableOutboundSnat, NetworkProvisioningState? provisioningState) : base(id, name, resourceType, serializedAdditionalRawData) + internal LoadBalancingRuleData(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, LoadBalancingRuleProperties properties, ETag? etag) : base(id, name, resourceType, serializedAdditionalRawData) { + Properties = properties; ETag = etag; - FrontendIPConfiguration = frontendIPConfiguration; - BackendAddressPool = backendAddressPool; - BackendAddressPools = backendAddressPools; - Probe = probe; - Protocol = protocol; - LoadDistribution = loadDistribution; - FrontendPort = frontendPort; - BackendPort = backendPort; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableFloatingIP = enableFloatingIP; - EnableTcpReset = enableTcpReset; - DisableOutboundSnat = disableOutboundSnat; - ProvisioningState = provisioningState; } + /// Properties of load balancer load balancing rule. + public LoadBalancingRuleProperties Properties { get; set; } /// A unique read-only string that changes whenever the resource is updated. public ETag? ETag { get; } - /// A reference to frontend IP addresses. - internal WritableSubResource FrontendIPConfiguration { get; set; } - /// Gets or sets Id. - public ResourceIdentifier FrontendIPConfigurationId - { - get => FrontendIPConfiguration is null ? default : FrontendIPConfiguration.Id; - set - { - if (FrontendIPConfiguration is null) - FrontendIPConfiguration = new WritableSubResource(); - FrontendIPConfiguration.Id = value; - } - } - - /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. - internal WritableSubResource BackendAddressPool { get; set; } - /// Gets or sets Id. - public ResourceIdentifier BackendAddressPoolId - { - get => BackendAddressPool is null ? default : BackendAddressPool.Id; - set - { - if (BackendAddressPool is null) - BackendAddressPool = new WritableSubResource(); - BackendAddressPool.Id = value; - } - } - - /// An array of references to pool of DIPs. - public IList BackendAddressPools { get; } - /// The reference to the load balancer probe used by the load balancing rule. - internal WritableSubResource Probe { get; set; } - /// Gets or sets Id. - public ResourceIdentifier ProbeId - { - get => Probe is null ? default : Probe.Id; - set - { - if (Probe is null) - Probe = new WritableSubResource(); - Probe.Id = value; - } - } - - /// The reference to the transport protocol used by the load balancing rule. - public LoadBalancingTransportProtocol? Protocol { get; set; } - /// The load distribution policy for this rule. - public LoadDistribution? LoadDistribution { get; set; } - /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - public int? FrontendPort { get; set; } - /// The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". - public int? BackendPort { get; set; } - /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - public int? IdleTimeoutInMinutes { get; set; } - /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - public bool? EnableFloatingIP { get; set; } - /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - public bool? EnableTcpReset { get; set; } - /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. - public bool? DisableOutboundSnat { get; set; } - /// The provisioning state of the load balancing rule resource. - public NetworkProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/AzureFirewallIPGroups.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/AzureFirewallIPGroups.Serialization.cs index 38cde19ba9c1..5c32065f6287 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/AzureFirewallIPGroups.Serialization.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/AzureFirewallIPGroups.Serialization.cs @@ -98,7 +98,7 @@ internal static AzureFirewallIPGroups DeserializeAzureFirewallIPGroups(JsonEleme } if (property.NameEquals("changeNumber"u8)) { - changeNumber = property.Value.GetString(); + DeserializeNumberValue(property, ref changeNumber); continue; } if (options.Format != "W") diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.Serialization.cs index 0813d5f74faf..b9dedcec4640 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.Serialization.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.Serialization.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Network.Models { @@ -36,59 +35,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } if (options.Format != "W" && Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(FrontendIPConfiguration)) - { - writer.WritePropertyName("frontendIPConfiguration"u8); - JsonSerializer.Serialize(writer, FrontendIPConfiguration); - } - if (Optional.IsDefined(Protocol)) - { - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol.Value.ToString()); - } - if (Optional.IsDefined(FrontendPortRangeStart)) - { - writer.WritePropertyName("frontendPortRangeStart"u8); - writer.WriteNumberValue(FrontendPortRangeStart.Value); - } - if (Optional.IsDefined(FrontendPortRangeEnd)) - { - writer.WritePropertyName("frontendPortRangeEnd"u8); - writer.WriteNumberValue(FrontendPortRangeEnd.Value); - } - if (Optional.IsDefined(BackendPort)) - { - writer.WritePropertyName("backendPort"u8); - writer.WriteNumberValue(BackendPort.Value); - } - if (Optional.IsDefined(IdleTimeoutInMinutes)) - { - writer.WritePropertyName("idleTimeoutInMinutes"u8); - writer.WriteNumberValue(IdleTimeoutInMinutes.Value); - } - if (Optional.IsDefined(EnableFloatingIP)) - { - writer.WritePropertyName("enableFloatingIP"u8); - writer.WriteBooleanValue(EnableFloatingIP.Value); - } - if (Optional.IsDefined(EnableTcpReset)) - { - writer.WritePropertyName("enableTcpReset"u8); - writer.WriteBooleanValue(EnableTcpReset.Value); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); } LoadBalancerInboundNatPool IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -111,23 +67,24 @@ internal static LoadBalancerInboundNatPool DeserializeLoadBalancerInboundNatPool { return null; } + LoadBalancerInboundNatPoolProperties properties = default; ETag? etag = default; ResourceIdentifier id = default; string name = default; ResourceType? type = default; - WritableSubResource frontendIPConfiguration = default; - LoadBalancingTransportProtocol? protocol = default; - int? frontendPortRangeStart = default; - int? frontendPortRangeEnd = default; - int? backendPort = default; - int? idleTimeoutInMinutes = default; - bool? enableFloatingIP = default; - bool? enableTcpReset = default; - NetworkProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = LoadBalancerInboundNatPoolProperties.DeserializeLoadBalancerInboundNatPoolProperties(property.Value, options); + continue; + } if (property.NameEquals("etag"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -160,99 +117,6 @@ internal static LoadBalancerInboundNatPool DeserializeLoadBalancerInboundNatPool type = new ResourceType(property.Value.GetString()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("frontendIPConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - frontendIPConfiguration = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("protocol"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - protocol = new LoadBalancingTransportProtocol(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("frontendPortRangeStart"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - frontendPortRangeStart = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("frontendPortRangeEnd"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - frontendPortRangeEnd = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("backendPort"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backendPort = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("idleTimeoutInMinutes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - idleTimeoutInMinutes = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("enableFloatingIP"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFloatingIP = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enableTcpReset"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableTcpReset = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,16 +128,8 @@ internal static LoadBalancerInboundNatPool DeserializeLoadBalancerInboundNatPool name, type, serializedAdditionalRawData, - etag, - frontendIPConfiguration, - protocol, - frontendPortRangeStart, - frontendPortRangeEnd, - backendPort, - idleTimeoutInMinutes, - enableFloatingIP, - enableTcpReset, - provisioningState); + properties, + etag); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.cs index ee0e20bdf4b6..79decc2e0fe0 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPool.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Network.Models { @@ -25,61 +24,17 @@ public LoadBalancerInboundNatPool() /// Resource name. /// Resource type. /// Keeps track of any properties unknown to the library. + /// Properties of load balancer inbound nat pool. /// A unique read-only string that changes whenever the resource is updated. - /// A reference to frontend IP addresses. - /// The reference to the transport protocol used by the inbound NAT pool. - /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. - /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - /// The provisioning state of the inbound NAT pool resource. - internal LoadBalancerInboundNatPool(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, ETag? etag, WritableSubResource frontendIPConfiguration, LoadBalancingTransportProtocol? protocol, int? frontendPortRangeStart, int? frontendPortRangeEnd, int? backendPort, int? idleTimeoutInMinutes, bool? enableFloatingIP, bool? enableTcpReset, NetworkProvisioningState? provisioningState) : base(id, name, resourceType, serializedAdditionalRawData) + internal LoadBalancerInboundNatPool(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, LoadBalancerInboundNatPoolProperties properties, ETag? etag) : base(id, name, resourceType, serializedAdditionalRawData) { + Properties = properties; ETag = etag; - FrontendIPConfiguration = frontendIPConfiguration; - Protocol = protocol; - FrontendPortRangeStart = frontendPortRangeStart; - FrontendPortRangeEnd = frontendPortRangeEnd; - BackendPort = backendPort; - IdleTimeoutInMinutes = idleTimeoutInMinutes; - EnableFloatingIP = enableFloatingIP; - EnableTcpReset = enableTcpReset; - ProvisioningState = provisioningState; } + /// Properties of load balancer inbound nat pool. + public LoadBalancerInboundNatPoolProperties Properties { get; set; } /// A unique read-only string that changes whenever the resource is updated. public ETag? ETag { get; } - /// A reference to frontend IP addresses. - internal WritableSubResource FrontendIPConfiguration { get; set; } - /// Gets or sets Id. - public ResourceIdentifier FrontendIPConfigurationId - { - get => FrontendIPConfiguration is null ? default : FrontendIPConfiguration.Id; - set - { - if (FrontendIPConfiguration is null) - FrontendIPConfiguration = new WritableSubResource(); - FrontendIPConfiguration.Id = value; - } - } - - /// The reference to the transport protocol used by the inbound NAT pool. - public LoadBalancingTransportProtocol? Protocol { get; set; } - /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - public int? FrontendPortRangeStart { get; set; } - /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - public int? FrontendPortRangeEnd { get; set; } - /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. - public int? BackendPort { get; set; } - /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - public int? IdleTimeoutInMinutes { get; set; } - /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - public bool? EnableFloatingIP { get; set; } - /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - public bool? EnableTcpReset { get; set; } - /// The provisioning state of the inbound NAT pool resource. - public NetworkProvisioningState? ProvisioningState { get; } } } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPoolProperties.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPoolProperties.Serialization.cs new file mode 100644 index 000000000000..e505b93265a1 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPoolProperties.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Network.Models +{ + public partial class LoadBalancerInboundNatPoolProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadBalancerInboundNatPoolProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FrontendIPConfiguration)) + { + writer.WritePropertyName("frontendIPConfiguration"u8); + JsonSerializer.Serialize(writer, FrontendIPConfiguration); + } + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.ToString()); + writer.WritePropertyName("frontendPortRangeStart"u8); + writer.WriteNumberValue(FrontendPortRangeStart); + writer.WritePropertyName("frontendPortRangeEnd"u8); + writer.WriteNumberValue(FrontendPortRangeEnd); + writer.WritePropertyName("backendPort"u8); + writer.WriteNumberValue(BackendPort); + if (Optional.IsDefined(IdleTimeoutInMinutes)) + { + writer.WritePropertyName("idleTimeoutInMinutes"u8); + writer.WriteNumberValue(IdleTimeoutInMinutes.Value); + } + if (Optional.IsDefined(EnableFloatingIP)) + { + writer.WritePropertyName("enableFloatingIP"u8); + writer.WriteBooleanValue(EnableFloatingIP.Value); + } + if (Optional.IsDefined(EnableTcpReset)) + { + writer.WritePropertyName("enableTcpReset"u8); + writer.WriteBooleanValue(EnableTcpReset.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + LoadBalancerInboundNatPoolProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadBalancerInboundNatPoolProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadBalancerInboundNatPoolProperties(document.RootElement, options); + } + + internal static LoadBalancerInboundNatPoolProperties DeserializeLoadBalancerInboundNatPoolProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource frontendIPConfiguration = default; + LoadBalancingTransportProtocol protocol = default; + int frontendPortRangeStart = default; + int frontendPortRangeEnd = default; + int backendPort = default; + int? idleTimeoutInMinutes = default; + bool? enableFloatingIP = default; + bool? enableTcpReset = default; + NetworkProvisioningState? provisioningState = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("frontendIPConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frontendIPConfiguration = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("protocol"u8)) + { + protocol = new LoadBalancingTransportProtocol(property.Value.GetString()); + continue; + } + if (property.NameEquals("frontendPortRangeStart"u8)) + { + frontendPortRangeStart = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("frontendPortRangeEnd"u8)) + { + frontendPortRangeEnd = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("backendPort"u8)) + { + backendPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("idleTimeoutInMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + idleTimeoutInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enableFloatingIP"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableFloatingIP = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableTcpReset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableTcpReset = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkProvisioningState(property.Value.GetString()); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new LoadBalancerInboundNatPoolProperties( + frontendIPConfiguration, + protocol, + frontendPortRangeStart, + frontendPortRangeEnd, + backendPort, + idleTimeoutInMinutes, + enableFloatingIP, + enableTcpReset, + provisioningState, + additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LoadBalancerInboundNatPoolProperties)} does not support writing '{options.Format}' format."); + } + } + + LoadBalancerInboundNatPoolProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLoadBalancerInboundNatPoolProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadBalancerInboundNatPoolProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPoolProperties.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPoolProperties.cs new file mode 100644 index 000000000000..cc546b911b64 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancerInboundNatPoolProperties.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Network.Models +{ + /// Properties of Inbound NAT pool. + public partial class LoadBalancerInboundNatPoolProperties + { + /// Initializes a new instance of . + /// The reference to the transport protocol used by the inbound NAT pool. + /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + public LoadBalancerInboundNatPoolProperties(LoadBalancingTransportProtocol protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort) + { + Protocol = protocol; + FrontendPortRangeStart = frontendPortRangeStart; + FrontendPortRangeEnd = frontendPortRangeEnd; + BackendPort = backendPort; + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// A reference to frontend IP addresses. + /// The reference to the transport protocol used by the inbound NAT pool. + /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + /// The provisioning state of the inbound NAT pool resource. + /// Additional Properties. + internal LoadBalancerInboundNatPoolProperties(WritableSubResource frontendIPConfiguration, LoadBalancingTransportProtocol protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, int? idleTimeoutInMinutes, bool? enableFloatingIP, bool? enableTcpReset, NetworkProvisioningState? provisioningState, IDictionary additionalProperties) + { + FrontendIPConfiguration = frontendIPConfiguration; + Protocol = protocol; + FrontendPortRangeStart = frontendPortRangeStart; + FrontendPortRangeEnd = frontendPortRangeEnd; + BackendPort = backendPort; + IdleTimeoutInMinutes = idleTimeoutInMinutes; + EnableFloatingIP = enableFloatingIP; + EnableTcpReset = enableTcpReset; + ProvisioningState = provisioningState; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal LoadBalancerInboundNatPoolProperties() + { + } + + /// A reference to frontend IP addresses. + internal WritableSubResource FrontendIPConfiguration { get; set; } + /// Gets or sets Id. + public ResourceIdentifier FrontendIPConfigurationId + { + get => FrontendIPConfiguration is null ? default : FrontendIPConfiguration.Id; + set + { + if (FrontendIPConfiguration is null) + FrontendIPConfiguration = new WritableSubResource(); + FrontendIPConfiguration.Id = value; + } + } + + /// The reference to the transport protocol used by the inbound NAT pool. + public LoadBalancingTransportProtocol Protocol { get; set; } + /// The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. + public int FrontendPortRangeStart { get; set; } + /// The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. + public int FrontendPortRangeEnd { get; set; } + /// The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + public int BackendPort { get; set; } + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + public int? IdleTimeoutInMinutes { get; set; } + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + public bool? EnableFloatingIP { get; set; } + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + public bool? EnableTcpReset { get; set; } + /// The provisioning state of the inbound NAT pool resource. + public NetworkProvisioningState? ProvisioningState { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancingRuleProperties.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancingRuleProperties.Serialization.cs new file mode 100644 index 000000000000..23f03d4bd50c --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancingRuleProperties.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Network.Models +{ + public partial class LoadBalancingRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadBalancingRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FrontendIPConfiguration)) + { + writer.WritePropertyName("frontendIPConfiguration"u8); + JsonSerializer.Serialize(writer, FrontendIPConfiguration); + } + if (Optional.IsDefined(BackendAddressPool)) + { + writer.WritePropertyName("backendAddressPool"u8); + JsonSerializer.Serialize(writer, BackendAddressPool); + } + if (Optional.IsCollectionDefined(BackendAddressPools)) + { + writer.WritePropertyName("backendAddressPools"u8); + writer.WriteStartArray(); + foreach (var item in BackendAddressPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Probe)) + { + writer.WritePropertyName("probe"u8); + JsonSerializer.Serialize(writer, Probe); + } + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.ToString()); + if (Optional.IsDefined(LoadDistribution)) + { + writer.WritePropertyName("loadDistribution"u8); + writer.WriteStringValue(LoadDistribution.Value.ToString()); + } + writer.WritePropertyName("frontendPort"u8); + writer.WriteNumberValue(FrontendPort); + if (Optional.IsDefined(BackendPort)) + { + writer.WritePropertyName("backendPort"u8); + writer.WriteNumberValue(BackendPort.Value); + } + if (Optional.IsDefined(IdleTimeoutInMinutes)) + { + writer.WritePropertyName("idleTimeoutInMinutes"u8); + writer.WriteNumberValue(IdleTimeoutInMinutes.Value); + } + if (Optional.IsDefined(EnableFloatingIP)) + { + writer.WritePropertyName("enableFloatingIP"u8); + writer.WriteBooleanValue(EnableFloatingIP.Value); + } + if (Optional.IsDefined(EnableTcpReset)) + { + writer.WritePropertyName("enableTcpReset"u8); + writer.WriteBooleanValue(EnableTcpReset.Value); + } + if (Optional.IsDefined(DisableOutboundSnat)) + { + writer.WritePropertyName("disableOutboundSnat"u8); + writer.WriteBooleanValue(DisableOutboundSnat.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + LoadBalancingRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadBalancingRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadBalancingRuleProperties(document.RootElement, options); + } + + internal static LoadBalancingRuleProperties DeserializeLoadBalancingRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource frontendIPConfiguration = default; + WritableSubResource backendAddressPool = default; + IList backendAddressPools = default; + WritableSubResource probe = default; + LoadBalancingTransportProtocol protocol = default; + LoadDistribution? loadDistribution = default; + int frontendPort = default; + int? backendPort = default; + int? idleTimeoutInMinutes = default; + bool? enableFloatingIP = default; + bool? enableTcpReset = default; + bool? disableOutboundSnat = default; + NetworkProvisioningState? provisioningState = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("frontendIPConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frontendIPConfiguration = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("backendAddressPool"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backendAddressPool = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("backendAddressPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + backendAddressPools = array; + continue; + } + if (property.NameEquals("probe"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probe = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("protocol"u8)) + { + protocol = new LoadBalancingTransportProtocol(property.Value.GetString()); + continue; + } + if (property.NameEquals("loadDistribution"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadDistribution = new LoadDistribution(property.Value.GetString()); + continue; + } + if (property.NameEquals("frontendPort"u8)) + { + frontendPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("backendPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backendPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("idleTimeoutInMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + idleTimeoutInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enableFloatingIP"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableFloatingIP = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableTcpReset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableTcpReset = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("disableOutboundSnat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disableOutboundSnat = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkProvisioningState(property.Value.GetString()); + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new LoadBalancingRuleProperties( + frontendIPConfiguration, + backendAddressPool, + backendAddressPools ?? new ChangeTrackingList(), + probe, + protocol, + loadDistribution, + frontendPort, + backendPort, + idleTimeoutInMinutes, + enableFloatingIP, + enableTcpReset, + disableOutboundSnat, + provisioningState, + additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LoadBalancingRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + LoadBalancingRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLoadBalancingRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadBalancingRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancingRuleProperties.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancingRuleProperties.cs new file mode 100644 index 000000000000..71bc21f568dd --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/LoadBalancingRuleProperties.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Network.Models +{ + /// Properties of the load balancer. + public partial class LoadBalancingRuleProperties + { + /// Initializes a new instance of . + /// The reference to the transport protocol used by the load balancing rule. + /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + public LoadBalancingRuleProperties(LoadBalancingTransportProtocol protocol, int frontendPort) + { + BackendAddressPools = new ChangeTrackingList(); + Protocol = protocol; + FrontendPort = frontendPort; + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// A reference to frontend IP addresses. + /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + /// An array of references to pool of DIPs. + /// The reference to the load balancer probe used by the load balancing rule. + /// The reference to the transport protocol used by the load balancing rule. + /// The load distribution policy for this rule. + /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + /// The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + /// The provisioning state of the load balancing rule resource. + /// Additional Properties. + internal LoadBalancingRuleProperties(WritableSubResource frontendIPConfiguration, WritableSubResource backendAddressPool, IList backendAddressPools, WritableSubResource probe, LoadBalancingTransportProtocol protocol, LoadDistribution? loadDistribution, int frontendPort, int? backendPort, int? idleTimeoutInMinutes, bool? enableFloatingIP, bool? enableTcpReset, bool? disableOutboundSnat, NetworkProvisioningState? provisioningState, IDictionary additionalProperties) + { + FrontendIPConfiguration = frontendIPConfiguration; + BackendAddressPool = backendAddressPool; + BackendAddressPools = backendAddressPools; + Probe = probe; + Protocol = protocol; + LoadDistribution = loadDistribution; + FrontendPort = frontendPort; + BackendPort = backendPort; + IdleTimeoutInMinutes = idleTimeoutInMinutes; + EnableFloatingIP = enableFloatingIP; + EnableTcpReset = enableTcpReset; + DisableOutboundSnat = disableOutboundSnat; + ProvisioningState = provisioningState; + AdditionalProperties = additionalProperties; + } + + /// Initializes a new instance of for deserialization. + internal LoadBalancingRuleProperties() + { + } + + /// A reference to frontend IP addresses. + internal WritableSubResource FrontendIPConfiguration { get; set; } + /// Gets or sets Id. + public ResourceIdentifier FrontendIPConfigurationId + { + get => FrontendIPConfiguration is null ? default : FrontendIPConfiguration.Id; + set + { + if (FrontendIPConfiguration is null) + FrontendIPConfiguration = new WritableSubResource(); + FrontendIPConfiguration.Id = value; + } + } + + /// A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + internal WritableSubResource BackendAddressPool { get; set; } + /// Gets or sets Id. + public ResourceIdentifier BackendAddressPoolId + { + get => BackendAddressPool is null ? default : BackendAddressPool.Id; + set + { + if (BackendAddressPool is null) + BackendAddressPool = new WritableSubResource(); + BackendAddressPool.Id = value; + } + } + + /// An array of references to pool of DIPs. + public IList BackendAddressPools { get; } + /// The reference to the load balancer probe used by the load balancing rule. + internal WritableSubResource Probe { get; set; } + /// Gets or sets Id. + public ResourceIdentifier ProbeId + { + get => Probe is null ? default : Probe.Id; + set + { + if (Probe is null) + Probe = new WritableSubResource(); + Probe.Id = value; + } + } + + /// The reference to the transport protocol used by the load balancing rule. + public LoadBalancingTransportProtocol Protocol { get; set; } + /// The load distribution policy for this rule. + public LoadDistribution? LoadDistribution { get; set; } + /// The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + public int FrontendPort { get; set; } + /// The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + public int? BackendPort { get; set; } + /// The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + public int? IdleTimeoutInMinutes { get; set; } + /// Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + public bool? EnableFloatingIP { get; set; } + /// Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + public bool? EnableTcpReset { get; set; } + /// Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + public bool? DisableOutboundSnat { get; set; } + /// The provisioning state of the load balancing rule resource. + public NetworkProvisioningState? ProvisioningState { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/autorest.md b/sdk/network/Azure.ResourceManager.Network/src/autorest.md index a5064459d5ce..7da09265cf8e 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/autorest.md +++ b/sdk/network/Azure.ResourceManager.Network/src/autorest.md @@ -113,6 +113,7 @@ rename-mapping: Hub: ConnectivityHub IdpsQueryObject: IdpsQueryContent InboundNatPool: LoadBalancerInboundNatPool + InboundNatPoolPropertiesFormat: LoadBalancerInboundNatPoolProperties IpAllocation.properties.type: IPAllocationType IpAllocationListResult: NetworkIPAllocationListResult IPAllocationMethod: NetworkIPAllocationMethod @@ -209,6 +210,7 @@ rename-mapping: VpnPacketCaptureStartParameters: VpnPacketCaptureStartContent VpnPacketCaptureStopParameters: VpnPacketCaptureStopContent VpnPolicyMemberAttributeType.AADGroupId: AadGroupId + LoadBalancingRulePropertiesFormat: LoadBalancingRuleProperties keep-plural-resource-data: - PolicySignaturesOverridesForIdps @@ -598,6 +600,14 @@ directive: { delete $[path]; } + # disable the flatten and add additional properties to its properties object + - from: loadBalancer.json + where: $.definitions + transform: > + $.LoadBalancingRule.properties.properties["x-ms-client-flatten"] = false; + $.LoadBalancingRulePropertiesFormat.additionalProperties = true; + $.InboundNatPool.properties.properties["x-ms-client-flatten"] = false; + $.InboundNatPoolPropertiesFormat.additionalProperties = true; # - from: vmssPublicIpAddress.json # where: $.paths # transform: > diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Azure.ResourceManager.Network.Tests.csproj b/sdk/network/Azure.ResourceManager.Network/tests/Azure.ResourceManager.Network.Tests.csproj index db9f0a4656c6..9a587085a854 100644 --- a/sdk/network/Azure.ResourceManager.Network/tests/Azure.ResourceManager.Network.Tests.csproj +++ b/sdk/network/Azure.ResourceManager.Network/tests/Azure.ResourceManager.Network.Tests.csproj @@ -17,6 +17,9 @@ Always + + Always + diff --git a/sdk/network/Azure.ResourceManager.Network/tests/TestData/ServiceTags.json b/sdk/network/Azure.ResourceManager.Network/tests/TestData/ServiceTags.json new file mode 100644 index 000000000000..a1cd4320509d --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/tests/TestData/ServiceTags.json @@ -0,0 +1,383 @@ +{ + "changeNumber": 336, + "cloud": "Public", + "values": [ + { + "name": "ActionGroup", + "id": "ActionGroup", + "properties": { + "changeNumber": 46, + "region": "", + "regionId": 0, + "platform": "Azure", + "systemService": "ActionGroup", + "addressPrefixes": [ + "4.145.74.52/30", + "4.149.254.68/30", + "4.150.239.212/30", + "4.151.103.92/30", + "4.171.31.152/30", + "4.190.136.180/30", + "4.200.251.84/30", + "4.202.253.100/30", + "4.206.229.96/30", + "4.207.242.64/30", + "4.216.204.200/30", + "4.218.236.160/30", + "4.219.249.220/30", + "4.220.138.104/30", + "4.232.48.104/30", + "4.232.106.88/30", + "4.240.148.92/30", + "4.243.28.116/30", + "4.248.83.192/30", + "9.160.80.24/30", + "9.205.75.32/30", + "13.66.143.220/30", + "13.67.10.124/30", + "13.69.109.132/30", + "13.71.199.112/30", + "13.77.53.216/30", + "13.78.109.156/30", + "13.86.221.220/30", + "13.106.38.142/32", + "13.106.38.148/32", + "13.106.54.3/32", + "13.106.54.19/32", + "13.106.57.181/32", + "13.106.57.196/31", + "20.7.239.202/32", + "20.10.122.64/32", + "20.17.63.212/30", + "20.17.66.88/30", + "20.17.124.64/30", + "20.17.130.24/30", + "20.21.42.88/30", + "20.38.133.4/30", + "20.38.149.132/30", + "20.42.64.36/30", + "20.43.121.124/30", + "20.44.17.220/30", + "20.45.123.236/30", + "20.47.194.50/32", + "20.47.194.102/32", + "20.52.95.254/31", + "20.52.214.122/32", + "20.52.214.191/32", + "20.53.1.68/30", + "20.53.62.100/31", + "20.69.8.102/31", + "20.72.27.152/30", + "20.85.194.70/32", + "20.85.194.220/32", + "20.88.72.40/30", + "20.90.38.38/31", + "20.91.100.232/30", + "20.92.5.114/31", + "20.99.31.224/30", + "20.105.215.20/31", + "20.111.76.188/30", + "20.116.43.108/31", + "20.117.193.34/31", + "20.118.78.36/31", + "20.119.28.220/31", + "20.125.4.168/31", + "20.125.199.59/32", + "20.135.70.51/32", + "20.135.74.3/32", + "20.150.172.228/30", + "20.164.158.200/30", + "20.167.131.224/30", + "20.168.188.36/30", + "20.170.175.8/30", + "20.192.238.124/30", + "20.193.96.28/30", + "20.193.202.4/30", + "20.195.87.54/31", + "20.199.201.66/31", + "20.199.207.184/30", + "20.203.88.62/31", + "20.203.93.200/30", + "20.204.192.216/31", + "20.204.199.124/30", + "20.207.175.176/30", + "20.208.157.48/30", + "20.210.69.140/31", + "20.213.228.120/30", + "20.215.74.56/30", + "20.215.154.88/30", + "20.217.8.56/30", + "20.217.58.88/30", + "20.221.192.80/32", + "20.225.21.250/32", + "20.225.22.84/32", + "20.228.34.17/32", + "20.228.34.19/32", + "20.240.1.100/31", + "20.244.66.175/32", + "20.244.67.158/32", + "20.252.215.0/30", + "23.97.93.60/30", + "23.100.222.168/30", + "40.64.15.124/30", + "40.65.72.174/32", + "40.65.72.253/32", + "40.69.111.196/30", + "40.74.102.24/30", + "40.83.170.64/32", + "40.83.173.147/32", + "40.121.67.30/32", + "48.216.8.24/30", + "48.219.232.24/30", + "51.4.160.24/30", + "51.12.101.172/30", + "51.12.204.244/30", + "51.53.40.144/30", + "51.53.106.88/30", + "51.53.139.92/30", + "51.53.186.88/30", + "51.104.9.100/30", + "51.107.193.28/30", + "51.138.160.220/30", + "51.140.215.184/30", + "52.147.98.52/30", + "52.160.97.65/32", + "52.172.33.114/32", + "52.172.87.0/30", + "52.183.31.0/32", + "52.184.145.166/32", + "52.240.244.140/30", + "68.154.136.24/30", + "68.210.152.24/30", + "68.211.152.24/30", + "68.218.131.40/30", + "68.221.44.44/30", + "68.221.98.88/30", + "70.153.176.24/30", + "74.7.80.24/30", + "74.249.127.180/30", + "98.66.132.188/30", + "98.67.183.188/30", + "104.47.217.71/32", + "104.47.217.87/32", + "104.47.217.151/32", + "104.47.240.167/32", + "104.47.240.215/32", + "104.211.231.103/32", + "104.214.165.80/30", + "108.140.5.168/30", + "158.23.10.88/30", + "158.23.119.232/30", + "168.61.142.52/30", + "168.61.239.12/30", + "172.160.216.24/30", + "172.164.208.220/30", + "172.182.164.108/30", + "172.183.4.112/30", + "172.187.32.16/30", + "172.187.67.44/30", + "172.191.219.248/30", + "172.201.232.60/30", + "172.202.80.168/30", + "172.204.177.28/30", + "172.209.8.40/30", + "172.215.202.24/30", + "191.233.50.4/30", + "191.233.207.64/26", + "2603:1000:4::10c/126", + "2603:1000:4:402::178/125", + "2603:1000:104:3::1ec/126", + "2603:1000:104:402::178/125", + "2603:1010:6:1::10c/126", + "2603:1010:6:402::178/125", + "2603:1010:101::10c/126", + "2603:1010:101:402::178/125", + "2603:1010:304::10c/126", + "2603:1010:304:402::178/125", + "2603:1010:404::10c/126", + "2603:1010:404:402::178/125", + "2603:1010:502:400::80/125", + "2603:1020:5:1::114/126", + "2603:1020:5:402::178/125", + "2603:1020:104:800::40/125", + "2603:1020:206:b::fc/126", + "2603:1020:206:402::178/125", + "2603:1020:206:403::78/125", + "2603:1020:305:402::178/125", + "2603:1020:405:402::178/125", + "2603:1020:605::128/126", + "2603:1020:605:402::178/125", + "2603:1020:705:3::234/126", + "2603:1020:705:402::178/125", + "2603:1020:805:1::130/126", + "2603:1020:805:402::178/125", + "2603:1020:905::10c/126", + "2603:1020:905:402::178/125", + "2603:1020:a04:1::10c/126", + "2603:1020:a04:402::178/125", + "2603:1020:b04:2::5b4/126", + "2603:1020:b04:402::178/125", + "2603:1020:c04:1::130/126", + "2603:1020:c04:402::178/125", + "2603:1020:d04::10c/126", + "2603:1020:d04:402::178/125", + "2603:1020:e04:1::128/126", + "2603:1020:e04:402::178/125", + "2603:1020:f04::10c/126", + "2603:1020:f04:402::178/125", + "2603:1020:1004::130/126", + "2603:1020:1004:800::f8/125", + "2603:1020:1104:1::79c/126", + "2603:1020:1104:400::178/125", + "2603:1020:1204:3::56c/126", + "2603:1020:1204:400::c0/125", + "2603:1020:1302:2::5a0/126", + "2603:1020:1302:400::180/125", + "2603:1020:1403:1::2a8/126", + "2603:1020:1403:400::100/125", + "2603:1020:1502:400::40/125", + "2603:1020:1602:400::1c8/125", + "2603:1030:f:4::39c/126", + "2603:1030:f:400::978/125", + "2603:1030:10:1::118/126", + "2603:1030:10:402::178/125", + "2603:1030:104:2::ec/126", + "2603:1030:104:402::178/125", + "2603:1030:107:1::3b0/126", + "2603:1030:107:400::f0/125", + "2603:1030:210:1::118/126", + "2603:1030:210:402::178/125", + "2603:1030:302:1::90/126", + "2603:1030:40b:1::114/126", + "2603:1030:40b:400::978/125", + "2603:1030:40c:1::118/126", + "2603:1030:40c:402::178/125", + "2603:1030:504:1::10c/126", + "2603:1030:504:802::f8/125", + "2603:1030:608::130/126", + "2603:1030:608:402::178/125", + "2603:1030:702:1::2a8/126", + "2603:1030:702:400::100/125", + "2603:1030:807:1::138/126", + "2603:1030:807:402::178/125", + "2603:1030:902:400::40/125", + "2603:1030:a07::138/126", + "2603:1030:a07:402::8f8/125", + "2603:1030:b04:1::4cc/126", + "2603:1030:b04:402::178/125", + "2603:1030:b04:800::40/125", + "2603:1030:c06:c::194/126", + "2603:1030:c06:400::978/125", + "2603:1030:f05:1::120/126", + "2603:1030:f05:402::178/125", + "2603:1030:1005::10c/126", + "2603:1030:1005:402::178/125", + "2603:1030:1102:400::40/125", + "2603:1030:1202:400::40/125", + "2603:1030:1302:400::40/125", + "2603:1040:5:3::5fc/126", + "2603:1040:5:402::178/125", + "2603:1040:207::114/126", + "2603:1040:207:402::178/125", + "2603:1040:407:1::114/126", + "2603:1040:407:402::178/125", + "2603:1040:606::10c/126", + "2603:1040:606:402::178/125", + "2603:1040:806::10c/126", + "2603:1040:806:402::178/125", + "2603:1040:904:1::114/126", + "2603:1040:904:402::178/125", + "2603:1040:a06:1::128/126", + "2603:1040:a06:402::178/125", + "2603:1040:b04::10c/126", + "2603:1040:b04:402::178/125", + "2603:1040:c06::10c/126", + "2603:1040:c06:402::178/125", + "2603:1040:d04::10c/126", + "2603:1040:d04:800::f8/125", + "2603:1040:e05:5::4ac/126", + "2603:1040:e05:402::180/125", + "2603:1040:f05:1::10c/126", + "2603:1040:f05:402::178/125", + "2603:1040:1002:5::30c/126", + "2603:1040:1002:400::180/125", + "2603:1040:1104::10c/126", + "2603:1040:1104:400::178/125", + "2603:1040:1202:1::1a4/126", + "2603:1040:1202:400::180/125", + "2603:1040:1302:1::22c/126", + "2603:1040:1302:400::180/125", + "2603:1040:1402:2::520/126", + "2603:1040:1402:400::180/125", + "2603:1040:1503:1::1c4/126", + "2603:1040:1503:400::180/125", + "2603:1040:1602:1::2e8/126", + "2603:1040:1602:400::40/125", + "2603:1040:1702:400::40/125", + "2603:1040:1802:400::40/125", + "2603:1050:6:2::6f0/126", + "2603:1050:6:402::178/125", + "2603:1050:301:400::40/125", + "2603:1050:403::10c/126", + "2603:1050:403:400::1f8/125" + ], + "networkFeatures": [ + "API", + "NSG", + "UDR", + "FW" + ] + } + }, + { + "name": "ApplicationInsightsAvailability", + "id": "ApplicationInsightsAvailability", + "properties": { + "changeNumber": 3, + "region": "", + "regionId": 0, + "platform": "Azure", + "systemService": "ApplicationInsightsAvailability", + "addressPrefixes": [ + "13.86.97.224/28", + "20.37.156.64/27", + "20.37.192.80/29", + "20.38.80.80/28", + "20.40.104.96/28", + "20.40.124.176/28", + "20.40.129.32/28", + "20.40.129.96/28", + "20.42.4.64/27", + "20.42.35.32/28", + "20.42.129.32/27", + "20.43.40.80/28", + "20.43.64.80/29", + "20.43.128.96/29", + "20.45.5.160/28", + "20.189.106.64/29", + "23.100.224.16/28", + "40.74.24.80/28", + "40.80.186.128/26", + "40.91.82.48/28", + "40.119.8.96/27", + "51.104.24.80/29", + "51.105.9.128/28", + "51.137.160.80/29", + "51.144.56.96/28", + "52.139.250.96/28", + "52.140.232.160/28", + "52.158.28.64/28", + "52.229.216.48/28", + "191.233.26.176/28", + "191.235.224.80/29" + ], + "networkFeatures": [ + "API", + "NSG", + "UDR", + "FW" + ] + } + } + ] +} \ No newline at end of file diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Tests/LoadBalancerTests.cs b/sdk/network/Azure.ResourceManager.Network/tests/Tests/LoadBalancerTests.cs index 6ecae7cae9d3..edde58c28591 100644 --- a/sdk/network/Azure.ResourceManager.Network/tests/Tests/LoadBalancerTests.cs +++ b/sdk/network/Azure.ResourceManager.Network/tests/Tests/LoadBalancerTests.cs @@ -87,25 +87,14 @@ public async Task LoadBalancerApiTest() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPort: 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - IdleTimeoutInMinutes = 15, - BackendAddressPool = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName) - }, - Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "probes", probeName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + IdleTimeoutInMinutes = 15, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName), + ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "probes", probeName) } } }, @@ -174,7 +163,7 @@ public async Task LoadBalancerApiTest() Assert.AreEqual(15, getLoadBalancer.Value.Data.LoadBalancingRules[0].IdleTimeoutInMinutes); Assert.AreEqual(probeName, getLoadBalancer.Value.Data.Probes[0].Name); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.Probes[0].ProvisioningState.ToString()); - Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Probe.Id.ToString()); + Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Properties.ProbeId.ToString()); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.InboundNatRules[0].ProvisioningState.ToString()); Assert.AreEqual(inboundNatRule1Name, getLoadBalancer.Value.Data.InboundNatRules[0].Name); Assert.AreEqual("Tcp", getLoadBalancer.Value.Data.InboundNatRules[0].Protocol.ToString()); @@ -363,26 +352,15 @@ public async Task LoadBalancerApiTestWithDynamicIp() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(LoadBalancingTransportProtocol.Tcp, 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + IdleTimeoutInMinutes = 15, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName), + ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "probes", probeName) }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - IdleTimeoutInMinutes = 15, - BackendAddressPool = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName) - }, - Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "probes", probeName) - } } }, Probes = { @@ -451,7 +429,7 @@ public async Task LoadBalancerApiTestWithDynamicIp() Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.LoadBalancingRules[0].ProvisioningState.ToString()); Assert.AreEqual(probeName, getLoadBalancer.Value.Data.Probes[0].Name); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.Probes[0].ProvisioningState.ToString()); - Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Probe.Id.ToString()); + Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Properties.ProbeId.ToString()); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.InboundNatRules[0].ProvisioningState.ToString()); Assert.AreEqual(inboundNatRule1Name, getLoadBalancer.Value.Data.InboundNatRules[0].Name); Assert.AreEqual("Tcp", getLoadBalancer.Value.Data.InboundNatRules[0].Protocol.ToString()); @@ -533,24 +511,13 @@ public async Task LoadBalancerApiTestWithStaticIp() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - BackendAddressPool = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPort: 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName) - }, - Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "probes", probeName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName), + ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "probes", probeName) } } }, @@ -621,7 +588,7 @@ public async Task LoadBalancerApiTestWithStaticIp() Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.LoadBalancingRules[0].ProvisioningState.ToString()); Assert.AreEqual(probeName, getLoadBalancer.Value.Data.Probes[0].Name); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.Probes[0].ProvisioningState.ToString()); - Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Probe.Id.ToString()); + Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Properties.ProbeId.ToString()); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.InboundNatRules[0].ProvisioningState.ToString()); Assert.AreEqual(inboundNatRule1Name, getLoadBalancer.Value.Data.InboundNatRules[0].Name); Assert.AreEqual("Tcp", getLoadBalancer.Value.Data.InboundNatRules[0].Protocol.ToString()); @@ -705,24 +672,13 @@ public async Task LoadBalancerApiTestWithDistributionPolicy() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - BackendAddressPool = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPort: 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName) - }, - Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "probes", probeName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName), + ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "probes", probeName) } } }, @@ -741,11 +697,7 @@ public async Task LoadBalancerApiTestWithDistributionPolicy() new InboundNatRuleData() { Name = inboundNatRule1Name, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), Protocol = LoadBalancingTransportProtocol.Tcp, FrontendPort = 3389, BackendPort = 3389, @@ -754,11 +706,7 @@ public async Task LoadBalancerApiTestWithDistributionPolicy() new InboundNatRuleData() { Name = inboundNatRule2Name, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), Protocol = LoadBalancingTransportProtocol.Tcp, FrontendPort = 3390, BackendPort = 3389, @@ -792,7 +740,7 @@ public async Task LoadBalancerApiTestWithDistributionPolicy() Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.LoadBalancingRules[0].ProvisioningState.ToString()); Assert.AreEqual(probeName, getLoadBalancer.Value.Data.Probes[0].Name); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.Probes[0].ProvisioningState.ToString()); - Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Probe.Id.ToString()); + Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Properties.ProbeId.ToString()); Assert.AreEqual("Succeeded", getLoadBalancer.Value.Data.InboundNatRules[0].ProvisioningState.ToString()); Assert.AreEqual(inboundNatRule1Name, getLoadBalancer.Value.Data.InboundNatRules[0].Name); Assert.AreEqual("Tcp", getLoadBalancer.Value.Data.InboundNatRules[0].Protocol.ToString()); @@ -918,19 +866,12 @@ public async Task UpdateLoadBalancerRule() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPort: 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbname, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - BackendAddressPool = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbname, "backendAddressPools", backEndAddressPoolName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbname, "frontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbname, "backendAddressPools", backEndAddressPoolName) } } }, @@ -963,10 +904,7 @@ public async Task UpdateLoadBalancerRule() } ); - getLoadBalancer.Value.Data.LoadBalancingRules[0].Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbname, "probes", probeName) - }; + getLoadBalancer.Value.Data.LoadBalancingRules[0].Properties.ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbname, "probes", probeName); // update load balancer var putLoadBalancerOperation = await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, lbname, getLoadBalancer.Value.Data); @@ -981,7 +919,7 @@ public async Task UpdateLoadBalancerRule() Assert.AreEqual(1, getLoadBalancer.Value.Data.BackendAddressPools.Count); Assert.AreEqual(1, getLoadBalancer.Value.Data.LoadBalancingRules.Count); Assert.AreEqual(1, getLoadBalancer.Value.Data.Probes.Count); - Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Probe.Id.ToString()); + Assert.AreEqual(getLoadBalancer.Value.Data.Probes[0].Id, getLoadBalancer.Value.Data.LoadBalancingRules[0].Properties.ProbeId.ToString()); Assert.False(getLoadBalancer.Value.Data.InboundNatRules.Any()); // Delete LoadBalancer @@ -1061,25 +999,14 @@ public async Task LoadBalancerApiNicAssociationTest() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPort: 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - IdleTimeoutInMinutes = 15, - BackendAddressPool = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName) - }, - Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "probes", probeName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + IdleTimeoutInMinutes = 15, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName), + ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "probes", probeName) } } }, @@ -1223,15 +1150,10 @@ public async Task LoadBalancerNatPoolTest() new LoadBalancerInboundNatPool() { Name = inboundNatPool1Name, - BackendPort = 81, - FrontendPortRangeStart = 100, - FrontendPortRangeEnd = 105, - FrontendIPConfiguration = new WritableSubResource() + Properties = new LoadBalancerInboundNatPoolProperties(LoadBalancingTransportProtocol.Tcp, frontendPortRangeStart: 100, frontendPortRangeEnd: 105, backendPort: 81) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) + } } } }; @@ -1254,18 +1176,17 @@ public async Task LoadBalancerNatPoolTest() Assert.AreEqual(100, getLoadBalancer.Value.Data.InboundNatPools[0].FrontendPortRangeStart); Assert.AreEqual(105, getLoadBalancer.Value.Data.InboundNatPools[0].FrontendPortRangeEnd); Assert.AreEqual(LoadBalancingTransportProtocol.Tcp, getLoadBalancer.Value.Data.InboundNatPools[0].Protocol); - Assert.AreEqual(GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), getLoadBalancer.Value.Data.InboundNatPools[0].FrontendIPConfiguration.Id.ToString()); + Assert.AreEqual(GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), getLoadBalancer.Value.Data.InboundNatPools[0].Properties.FrontendIPConfigurationId.ToString()); Assert.AreEqual(getLoadBalancer.Value.Data.InboundNatPools[0].Id, getLoadBalancer.Value.Data.FrontendIPConfigurations[0].InboundNatPools[0].Id.ToString()); // Add a new nat pool LoadBalancerInboundNatPool natpool2 = new LoadBalancerInboundNatPool() { Name = inboundNatPool2Name, - BackendPort = 81, - FrontendPortRangeStart = 107, - FrontendPortRangeEnd = 110, - FrontendIPConfiguration = new WritableSubResource() { Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) }, - Protocol = LoadBalancingTransportProtocol.Tcp + Properties = new LoadBalancerInboundNatPoolProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPortRangeStart: 107, frontendPortRangeEnd: 110, backendPort: 81) + { + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) + } }; getLoadBalancer.Value.Data.InboundNatPools.Add(natpool2); await loadBalancerCollection.CreateOrUpdateAsync(WaitUntil.Completed, lbName, getLoadBalancer.Value.Data); @@ -1372,25 +1293,14 @@ public async Task ExpandResourceTest() new LoadBalancingRuleData() { Name = loadBalancingRuleName, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "FrontendIPConfigurations", frontendIpConfigName) - }, - Protocol = LoadBalancingTransportProtocol.Tcp, - FrontendPort = 80, - BackendPort = 80, - EnableFloatingIP = false, - IdleTimeoutInMinutes = 15, - BackendAddressPool = new WritableSubResource() + Properties = new LoadBalancingRuleProperties(protocol: LoadBalancingTransportProtocol.Tcp, frontendPort: 80) { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName) - }, - Probe = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "probes", probeName) + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "FrontendIPConfigurations", frontendIpConfigName), + BackendPort = 80, + EnableFloatingIP = false, + IdleTimeoutInMinutes = 15, + BackendAddressPoolId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "backendAddressPools", backEndAddressPoolName), + ProbeId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "probes", probeName) } } }, @@ -1409,11 +1319,7 @@ public async Task ExpandResourceTest() new InboundNatRuleData() { Name = inboundNatRule1Name, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "FrontendIPConfigurations", frontendIpConfigName) - }, + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "FrontendIPConfigurations", frontendIpConfigName), Protocol = LoadBalancingTransportProtocol.Tcp, FrontendPort = 3389, BackendPort = 3389, @@ -1423,11 +1329,7 @@ public async Task ExpandResourceTest() new InboundNatRuleData() { Name = inboundNatRule2Name, - FrontendIPConfiguration = new WritableSubResource() - { - Id = GetChildLbResourceId(TestEnvironment.SubscriptionId, - resourceGroupName, lbName, "FrontendIPConfigurations", frontendIpConfigName) - }, + FrontendIPConfigurationId = GetChildLbResourceId(TestEnvironment.SubscriptionId, resourceGroupName, lbName, "FrontendIPConfigurations", frontendIpConfigName), Protocol = LoadBalancingTransportProtocol.Tcp, FrontendPort = 3390, BackendPort = 3389, diff --git a/sdk/network/Azure.ResourceManager.Network/tests/Tests/UnitTest.cs b/sdk/network/Azure.ResourceManager.Network/tests/Tests/UnitTest.cs new file mode 100644 index 000000000000..e8416ea767dd --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/tests/Tests/UnitTest.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.IO; +using System.Text.Json; +using Azure.ResourceManager.Network.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Network.Tests +{ + public class UnitTest + { + // This is the test for fix of issue: https://github.com/Azure/azure-sdk-for-net/issues/46767 + [Test] + public void DeserializeChangeNumber() + { + using var sr = new StreamReader(Path.Combine("TestData", "ServiceTags.json")); + using var jsonContent = JsonDocument.Parse(sr.BaseStream); + var data = AzureFirewallIPGroups.DeserializeAzureFirewallIPGroups(jsonContent.RootElement); + Assert.NotNull(data.ChangeNumber); + } + } +} diff --git a/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/CHANGELOG.md b/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/CHANGELOG.md index 04a743099ad2..9ce9b3fe57ef 100644 --- a/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/CHANGELOG.md +++ b/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/CHANGELOG.md @@ -50,4 +50,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/README.md b/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/README.md index b9319fcff080..ebbbd7d090a7 100644 --- a/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/README.md +++ b/sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md index 540d211ac5c1..5ed758fc439c 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.1.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.1.0-beta.1 (2024-11-06) ### Features Added @@ -59,8 +69,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -93,4 +103,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/README.md b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/README.md index 60765f49d5df..ad4ecece6fec 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/README.md +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj index ba6d57e86a80..88991f8452de 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Azure.ResourceManager.NetworkCloud.csproj @@ -1,6 +1,6 @@ - 1.1.0-beta.1 + 1.1.0-beta.2 1.0.1 Azure.ResourceManager.NetworkCloud diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/CHANGELOG.md b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/CHANGELOG.md index 55f4d4f27a95..338b2543bc91 100644 --- a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/CHANGELOG.md +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/CHANGELOG.md @@ -61,4 +61,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/README.md b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/README.md index 8482518917c8..1a424b6eeb37 100644 --- a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/README.md +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md index 5755bc951111..60466c0aa54e 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/CHANGELOG.md @@ -74,4 +74,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/README.md b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/README.md index 21f74bde6c46..3243c611ded2 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/README.md +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md b/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md index 23f4d7831dbe..9e6468ee3a51 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md +++ b/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md @@ -75,4 +75,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/README.md b/sdk/nginx/Azure.ResourceManager.Nginx/README.md index 57001eeecab8..c1a1cca1f83a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/README.md +++ b/sdk/nginx/Azure.ResourceManager.Nginx/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/CHANGELOG.md b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/CHANGELOG.md index 58380f6a6b28..a987b5be2f21 100644 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/CHANGELOG.md +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/CHANGELOG.md @@ -73,8 +73,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -105,4 +105,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/README.md b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/README.md index 35b01aeda10a..ca9c511a7279 100644 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/README.md +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/README.md b/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/README.md index b28bdf27a327..546d5ec38f4e 100644 --- a/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/README.md +++ b/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/README.md @@ -38,7 +38,7 @@ Add a package reference: ### Prerequisites - You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/). -- You must have an [Azure Object Anchors](https://review.docs.microsoft.com/azure/object-anchors/) account. +- You must have an [Azure Object Anchors](https://review.learn.microsoft.com/azure/object-anchors/) account. ### Authenticate the client @@ -54,7 +54,7 @@ Mixed Reality services support a few different forms of authentication: - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this method for production applications because it allows you to avoid embedding the credentials for access to the Object Anchors asset conversion service in your client application. -See [here](https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information. +See [here](https://learn.microsoft.com/azure/spatial-anchors/concepts/authentication) for detailed instructions and information. ## Key concepts @@ -131,7 +131,7 @@ using (FileStream file = File.OpenWrite(localFileDownloadPath)) ## Next steps -- Read the [Product documentation](https://review.docs.microsoft.com/azure/object-anchors/) +- Read the [Product documentation](https://review.learn.microsoft.com/azure/object-anchors/) ## Contributing diff --git a/sdk/openai/Azure.AI.OpenAI.Assistants/README.md b/sdk/openai/Azure.AI.OpenAI.Assistants/README.md index 845e52e81293..48e1dad10e13 100644 --- a/sdk/openai/Azure.AI.OpenAI.Assistants/README.md +++ b/sdk/openai/Azure.AI.OpenAI.Assistants/README.md @@ -359,7 +359,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_identity_dac]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [msdocs_openai_completion]: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/completions [msdocs_openai_embedding]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide [openai_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs [openai_rest]: https://learn.microsoft.com/azure/cognitive-services/openai/reference diff --git a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md index 758347301e2c..dc9f08665cad 100644 --- a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md +++ b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md @@ -1,22 +1,43 @@ # Release History -## 2.1.0-beta.3 (Unreleased) +## 2.1.0 (2024-12-05) + +This GA library release aligns functionality with the latest `2024-10-21` stable service API label. + +> [!NOTE] +> For consistency and reliability, GA releases of the `Azure.AI.OpenAI` library will always map to stable Azure OpenAI service API versions. Because stable service API versions omit volatile surfaces such as beta features, GA library releases will also not contain the full set of preview functionality. To use beta and preview features, please use the latest prerelease version of the library. ### Features Added -### Breaking Changes +**Chat** -### Bugs Fixed +- [GA] The `2024-10-21` API version brings GA AOAI support for streaming token usage in chat completions; `Usage` is now automatically populated in `StreamingChatCompletionUpdate` instances. + - Note 1: this feature is not yet compatible when using On Your Data features (after invoking the `.AddDataSource()` extension method on `ChatCompletionOptions`) + - Note 2: this feature is not yet compatible when using image input (a `ChatMessageContentPart` of `Kind` `Image`) +- [GA] The `AllowParalllelToolCalls` property on `ChatCompletionOptions`, which can be set to `false` to disable the invocation of multiple tools on a single chat completion response, is now supported. +- [GA] Structured outputs, via the use of `ChatResponseFormat.CreateJsonSchemaFormat()`, is now supported. +- When using `o1-preview` and `o1-mini` models, `max_completion_tokens` may now be configured by calling the `[Experimental] SetNewMaxCompletionTokensPropertyEnabled()` extension method on `ChatCompletionOptions`. + - This extension method will be removed in a future service API version, when it becomes unnecessary once all models support the `max_completion_tokens` property -### Other Changes +**Batch** -## 2.1.0-beta.2 (2024-11-04) +The `2024-10-21` service API label introduces stable support for batch chat completions to Azure OpenAI. This library release exposes low-level support for batch: -This update brings compatibility with the Azure OpenAI `2024-10-01-preview` service API version as well as the `2.1.0-beta.2` release of the `OpenAI` library. +- `AzureOpenAIClient`'s `GetOpenAIFileClient()` will now return a valid, configured instance of `FileClient` that supports uploading files with `FileUploadPurpose.Batch`. This can be used to upload the contents of a valid `.jsonl` file for batch processing. +- `AzureOpenAIClient`'s `GetBatchClient()` will now return a valid, configured instance of `BatchClient` that can produce a `CreateBatchOperation` given an uploaded file ID using protocol methods. +- Strongly typed convenience surfaces for `BatchClient` will arrive in a future update. ### Breaking Changes -- `[Experimental]` `ChatCitation` and `ChatRetrievedDocument` have each replaced the `Uri` property of type `System.Uri` with a `string` property named `Url`. This aligns with the REST specification and accounts for the wire value of `url` not always providing a valid RFC 3986 identifier [[azure-sdk-for-net \#46793](https://github.com/Azure/azure-sdk-for-net/issues/46793)] +> [!NOTE] +> GA library releases only permit breaking changes to items marked with an `[Experimental]` attribute and these changes will be minimized whenever possible. + +- `[Experimental]` `GetBatchClient(string deploymentName)` on `AzureOpenAIClient` is removed, as the Azure OpenAI batch API now aligns with OpenAI's in not using a deployment-based request URI path. Please use `GetBatchClient()`, instead. +- `[Expermental]` the `Uri` property of type `System.Uri` in `ChatCitation` and `ChatRetrivedDocument` has been replaced by a `Url` property of type `string`. This contains the same information but properly handles document paths that don't conform to a valid RFC 3986 identifier. + +## 2.1.0-beta.2 (2024-11-04) + +This update brings compatibility with the Azure OpenAI `2024-10-01-preview` service API version as well as the `2.1.0-beta.2` release of the `OpenAI` library. ### Features Added @@ -25,21 +46,14 @@ This update brings compatibility with the Azure OpenAI `2024-10-01-preview` serv - Note 2: this feature is not yet compatible when using image input (a `ChatMessageContentPart` of `Kind` `Image`) - `2024-10-01-preview` further adds support for ungrounded content detection in chat completion content filter results via the `UngroundedMaterial` property on `ResponseContentFilterResult`, as retrieved from a chat completion via the `GetResponseContentFilterResult()` extension method. -Via `OpenAI 2.0.0-beta.2`: +## Breaking Changes -- Made improvements to the experimental Realtime API. Please note this features area is currently under rapid development and not all changes may be reflected here. - - Several types have been renamed for consistency and clarity. - - ConversationRateLimitsUpdate (previously ConversationRateLimitsUpdatedUpdate) now includes named RequestDetails and TokenDetails properties, mapping to the corresponding named items in the underlying rate_limits command payload. +- `[Experimental]` `ChatCitation` and `ChatRetrievedDocument` have each replaced the `Uri` property of type `System.Uri` with a `string` property named `Url`. This aligns with the REST specification and accounts for the wire value of `url` not always providing a valid RFC 3986 identifier [[azure-sdk-for-net \#46793](https://github.com/Azure/azure-sdk-for-net/issues/46793)] -### Bugs Fixed +## Bugs Fixed -- Addressed an HTTP 401 issue that caused certain connection retry attempts, such as those triggered for HTTP 429 rate limiting errors, to sometimes generate a malformed request with multiple `Authorization` headers that would then be rejected. [#46401](https://github.com/Azure/azure-sdk-for-net/pull/46401) - Addressed an issue that caused `ChatCitation` and `ChatRetrievedDocument` to sometimes throw on deserialization, specifically when a returned value in the `url` JSON field was not populated with an RFC 3986 compliant identifier for `System.Uri` [[azure-sdk-for-net \#46793](https://github.com/Azure/azure-sdk-for-net/issues/46793)] -Via `OpenAI 2.0.0-beta.2`: - -- Fixed serialization and deserialization of ConversationToolChoice literal values (such as "required"). - ## 2.1.0-beta.1 (2024-10-01) Relative to the prior GA release, this update restores preview surfaces, retargeting to the latest `2024-08-01-preview` service `api-version` label. It also brings early support for the newly-announced `/realtime` capabilities with `gpt-4o-realtime-preview`. You can read more about Azure OpenAI support for `/realtime` in the annoucement post here: https://azure.microsoft.com/blog/announcing-new-products-and-features-for-azure-openai-service-including-gpt-4o-realtime-preview-with-audio-and-speech-capabilities/ diff --git a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props index 6ab82214b04a..5304268972e9 100644 --- a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props +++ b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props @@ -1,13 +1,13 @@  - 2.1.0-beta.2 + 2.1.0 + 2024_10_21 true $(RequiredTargetFrameworks) true @@ -27,8 +25,16 @@ AZURE_OPENAI_GA + 2.1.0 + + + + 2.2.0 + beta.1 + + diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs index 2ecba45bb9fe..d374d0923c92 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs @@ -12,7 +12,6 @@ global using OpenAI.Images; global using OpenAI.Models; global using OpenAI.Moderations; -global using OpenAI.RealtimeConversation; global using OpenAI.VectorStores; using System.ClientModel; @@ -20,15 +19,16 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using Azure.AI.OpenAI.Audio; +using Azure.AI.OpenAI.Batch; using Azure.AI.OpenAI.Chat; using Azure.AI.OpenAI.Embeddings; +using Azure.AI.OpenAI.Files; using Azure.AI.OpenAI.Images; using Azure.Core; #if !AZURE_OPENAI_GA +global using OpenAI.RealtimeConversation; using Azure.AI.OpenAI.Assistants; -using Azure.AI.OpenAI.Batch; -using Azure.AI.OpenAI.Files; using Azure.AI.OpenAI.FineTuning; using Azure.AI.OpenAI.RealtimeConversation; using Azure.AI.OpenAI.VectorStores; @@ -173,26 +173,10 @@ public override AudioClient GetAudioClient(string deploymentName) /// /// Gets a new instance configured for batch operation use with the Azure OpenAI service. /// - /// The model deployment name to use for the new client's audio operations. /// A new instance. -#if AZURE_OPENAI_GA - [EditorBrowsable(EditorBrowsableState.Never)] -#endif [Experimental("OPENAI001")] - public BatchClient GetBatchClient(string deploymentName) -#if !AZURE_OPENAI_GA - => new AzureBatchClient(Pipeline, deploymentName, _endpoint, _options); -#else - => throw new InvalidOperationException($"The preview Batch feature area is not available in this GA release of the Azure OpenAI Service. To use this capability, please use a preview version of the library."); -#endif - - /// - /// This method is unsupported for Azure OpenAI. Please use the alternate - /// method that accepts a model deployment name, instead. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Experimental("OPENAI001")] - public override BatchClient GetBatchClient() => GetBatchClient(deploymentName: null); + public override BatchClient GetBatchClient() + => new AzureBatchClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for chat completion operation use with the Azure OpenAI service. @@ -214,15 +198,9 @@ public override EmbeddingClient GetEmbeddingClient(string deploymentName) /// Gets a new instance configured for file operation use with the Azure OpenAI service. /// /// A new instance. -#if AZURE_OPENAI_GA - [EditorBrowsable(EditorBrowsableState.Never)] -#endif + [Experimental("AOAI001")] public override OpenAIFileClient GetOpenAIFileClient() -#if !AZURE_OPENAI_GA => new AzureFileClient(Pipeline, _endpoint, _options); -#else - => throw new InvalidOperationException($"FileClient is not supported in this GA version of the library. To use Files and related capabilities, please use a preview version of the library."); -#endif /// /// Gets a new instance configured for fine-tuning operation use with the Azure OpenAI service. @@ -280,13 +258,10 @@ public override VectorStoreClient GetVectorStoreClient() => throw new InvalidOperationException($"VectorStoreClient is not supported with this GA version of the library. Please use a preview version of the library for this functionality."); #endif -#if AZURE_OPENAI_GA - [EditorBrowsable(EditorBrowsableState.Never)] -#endif +#if !AZURE_OPENAI_GA [Experimental("OPENAI002")] public override RealtimeConversationClient GetRealtimeConversationClient(string deploymentName) { -#if !AZURE_OPENAI_GA if (_tokenCredential is not null) { return new AzureRealtimeConversationClient(_endpoint, deploymentName, _tokenCredential, _options); @@ -295,10 +270,10 @@ public override RealtimeConversationClient GetRealtimeConversationClient(string { return new AzureRealtimeConversationClient(_endpoint, deploymentName, _keyCredential, _options); } + } #else - throw new InvalidOperationException($"{nameof(RealtimeConversationClient)} is not supported with this GA version of the library. Please use a preview version of the library for this functionality."); + // Not yet present in OpenAI GA dependency #endif - } private static ClientPipeline CreatePipeline(PipelinePolicy authenticationPolicy, AzureOpenAIClientOptions options) => ClientPipeline.Create( diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs index 54838af00b03..f6443876a9bf 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs @@ -60,6 +60,7 @@ public AzureOpenAIClientOptions(ServiceVersion version = LatestVersion) ServiceVersion.V2024_10_01_Preview => "2024-10-01-preview", #endif ServiceVersion.V2024_06_01 => "2024-06-01", + ServiceVersion.V2024_10_21 => "2024-10-21", _ => throw new NotSupportedException() }; RetryPolicy = new RetryWithDelaysPolicy(); @@ -74,6 +75,7 @@ public enum ServiceVersion V2024_09_01_Preview = 2, V2024_10_01_Preview = 3, #endif + V2024_10_21 = 4, } internal class RetryWithDelaysPolicy : ClientRetryPolicy @@ -107,6 +109,6 @@ protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) #if !AZURE_OPENAI_GA private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_01_Preview; #else - private const ServiceVersion LatestVersion = ServiceVersion.V2024_06_01; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_21; #endif } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.Protocol.cs index c0a0ca084b67..9426b20a5f5a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.Protocol.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#if !AZURE_OPENAI_GA - using System.ClientModel; using System.ClientModel.Primitives; using System.Text.Json; @@ -23,7 +21,7 @@ public override async Task CreateBatchAsync(BinaryContent string batchId = doc.RootElement.GetProperty("id"u8).GetString(); string status = doc.RootElement.GetProperty("status"u8).GetString(); - CreateBatchOperation operation = new(Pipeline, _endpoint, batchId, status, response); + CreateBatchOperation operation = CreateCreateBatchOperation(batchId, status, response); return await operation.WaitUntilAsync(waitUntilCompleted, options).ConfigureAwait(false); } @@ -38,7 +36,7 @@ public override CreateBatchOperation CreateBatch(BinaryContent content, bool wai string batchId = doc.RootElement.GetProperty("id"u8).GetString(); string status = doc.RootElement.GetProperty("status"u8).GetString(); - CreateBatchOperation operation = new(Pipeline, _endpoint, batchId, status, response); + CreateBatchOperation operation = CreateCreateBatchOperation(batchId, status, response); return operation.WaitUntil(waitUntilCompleted, options); } @@ -69,7 +67,7 @@ internal override ClientResult GetBatch(string batchId, RequestOptions options) } internal override PipelineMessage CreateCreateBatchRequest(BinaryContent content, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, _deploymentName) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, null) .WithMethod("POST") .WithPath("batches") .WithContent(content, "application/json") @@ -78,7 +76,7 @@ internal override PipelineMessage CreateCreateBatchRequest(BinaryContent content .Build(); internal override PipelineMessage CreateGetBatchesRequest(string after, int? limit, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, _deploymentName) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, null) .WithMethod("GET") .WithPath("batches") .WithOptionalQueryParameter("after", after) @@ -88,7 +86,7 @@ internal override PipelineMessage CreateGetBatchesRequest(string after, int? lim .Build(); internal override PipelineMessage CreateRetrieveBatchRequest(string batchId, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, _deploymentName) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, null) .WithMethod("GET") .WithPath("batches", batchId) .WithAccept("application/json") @@ -96,12 +94,10 @@ internal override PipelineMessage CreateRetrieveBatchRequest(string batchId, Req .Build(); internal override PipelineMessage CreateCancelBatchRequest(string batchId, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, _deploymentName) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion, null) .WithMethod("POST") .WithPath("batches", batchId, "cancel") .WithAccept("application/json") .WithOptions(options) .Build(); -} - -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs index 34950c9d7724..6c058c23ba28 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#if !AZURE_OPENAI_GA - using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace Azure.AI.OpenAI.Batch; @@ -14,21 +13,19 @@ namespace Azure.AI.OpenAI.Batch; /// /// To retrieve an instance of this type, use the matching method on . /// +[Experimental("AOAI001")] internal partial class AzureBatchClient : BatchClient { private readonly Uri _endpoint; - private readonly string _deploymentName; private readonly string _apiVersion; - internal AzureBatchClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + internal AzureBatchClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { Argument.AssertNotNull(pipeline, nameof(pipeline)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); - _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; } @@ -38,8 +35,6 @@ protected AzureBatchClient() internal override CreateBatchOperation CreateCreateBatchOperation(string batchId, string status, PipelineResponse response) { - return new AzureCreateBatchOperation(Pipeline, _endpoint, batchId, status, response, _deploymentName, _apiVersion); + return new AzureCreateBatchOperation(Pipeline, _endpoint, batchId, status, response, _apiVersion); } -} - -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureCreateBatchOperation.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureCreateBatchOperation.Protocol.cs index 986f2c59f700..220e09fc5e57 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureCreateBatchOperation.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureCreateBatchOperation.Protocol.cs @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#if !AZURE_OPENAI_GA - using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; #nullable enable @@ -13,13 +12,12 @@ namespace Azure.AI.OpenAI.Batch; /// /// A long-running operation for executing a batch from an uploaded file of requests. /// +[Experimental("AOAI001")] internal partial class AzureCreateBatchOperation : CreateBatchOperation { private readonly ClientPipeline _pipeline; private readonly Uri _endpoint; private readonly string _batchId; - - private readonly string _deploymentName; private readonly string _apiVersion; internal AzureCreateBatchOperation( @@ -28,19 +26,17 @@ internal AzureCreateBatchOperation( string batchId, string status, PipelineResponse response, - string deploymentName, string apiVersion) : base(pipeline, endpoint, batchId, status, response) { _pipeline = pipeline; _endpoint = endpoint; _batchId = batchId; - _deploymentName = deploymentName; _apiVersion = apiVersion; } internal override PipelineMessage CreateRetrieveBatchRequest(string batchId, RequestOptions? options) - => new AzureOpenAIPipelineMessageBuilder(_pipeline, _endpoint, _apiVersion, _deploymentName) + => new AzureOpenAIPipelineMessageBuilder(_pipeline, _endpoint, _apiVersion, null) .WithMethod("GET") .WithPath("batches", batchId) .WithAccept("application/json") @@ -48,7 +44,7 @@ internal override PipelineMessage CreateRetrieveBatchRequest(string batchId, Req .Build(); internal override PipelineMessage CreateCancelBatchRequest(string batchId, RequestOptions? options) - => new AzureOpenAIPipelineMessageBuilder(_pipeline, _endpoint, _apiVersion, _deploymentName) + => new AzureOpenAIPipelineMessageBuilder(_pipeline, _endpoint, _apiVersion, null) .WithMethod("POST") .WithPath("batches", batchId, "cancel") .WithAccept("application/json") @@ -58,5 +54,3 @@ internal override PipelineMessage CreateCancelBatchRequest(string batchId, Reque private static PipelineMessageClassifier? _pipelineMessageClassifier200; private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 ??= PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); } - -#endif diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ContentFilterTextSpanResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ContentFilterTextSpanResult.cs index d1edc581f276..430e8208cece 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ContentFilterTextSpanResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ContentFilterTextSpanResult.cs @@ -7,5 +7,9 @@ namespace Azure.AI.OpenAI; [Experimental("AOAI001")] [CodeGenModel("AzureContentFilterCompletionTextSpanDetectionResult")] +#if !AZURE_OPENAI_GA public partial class ContentFilterTextSpanResult +#else +internal partial class ContentFilterTextSpanResult +#endif { } \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs index ff66fd09eb87..4347c9b75c6e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs @@ -8,4 +8,6 @@ namespace Azure.AI.OpenAI; [Experimental("AOAI001")][CodeGenModel("AzureContentFilterDetectionResult")] public partial class ContentFilterDetectionResult { } [Experimental("AOAI001")][CodeGenModel("AzureContentFilterResultForChoiceProtectedMaterialCode")] public partial class ContentFilterProtectedMaterialResult { } [Experimental("AOAI001")][CodeGenModel("AzureContentFilterSeverityResultSeverity")] public readonly partial struct ContentFilterSeverity { } +#if !AZURE_OPENAI_GA [Experimental("AOAI001")][CodeGenModel("AzureContentFilterCompletionTextSpan")] public partial class ContentFilterTextSpan { } +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/Internal/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/Internal/GeneratorStubs.cs index fa6e1b05db9f..befcbe59ac72 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/Internal/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/Internal/GeneratorStubs.cs @@ -10,3 +10,6 @@ namespace Azure.AI.OpenAI; [Experimental("AOAI001")][CodeGenModel("AzureContentFilterBlocklistResultDetail")] internal partial class InternalAzureContentFilterBlocklistResultDetail { } [Experimental("AOAI001")][CodeGenModel("AzureContentFilterResultForPromptContentFilterResults")] internal partial class InternalAzureContentFilterResultForPromptContentFilterResults { } [Experimental("AOAI001")][CodeGenModel("AzureContentFilterResultForPromptContentFilterResultsError")] internal partial class InternalAzureContentFilterResultForPromptContentFilterResultsError { } +#if AZURE_OPENAI_GA +[Experimental("AOAI001")][CodeGenModel("AzureContentFilterCompletionTextSpan")] internal partial class ContentFilterTextSpan { } +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ResponseContentFilterResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ResponseContentFilterResult.cs index c118d9d0463c..c73b08da32b5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ResponseContentFilterResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/ResponseContentFilterResult.cs @@ -10,4 +10,10 @@ namespace Azure.AI.OpenAI; public partial class ResponseContentFilterResult { internal InternalAzureContentFilterResultForPromptContentFilterResultsError Error { get; } + +#if !AZURE_OPENAI_GA + public ContentFilterTextSpanResult UngroundedMaterial { get; } +#else + internal ContentFilterTextSpanResult UngroundedMaterial { get; } +#endif } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs index ac902176616f..468f349032cd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs @@ -1,8 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#if !AZURE_OPENAI_GA - +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; @@ -99,6 +98,58 @@ public override async Task UploadFileAsync(BinaryContent content, return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); } + public override async Task CreateUploadAsync(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateCreateUploadRequestMessage(content, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + public override ClientResult CreateUpload(BinaryContent content, RequestOptions options = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using PipelineMessage message = CreateCreateUploadRequestMessage(content, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + public override async Task AddUploadPartAsync(string uploadId, BinaryContent content, string contentType, RequestOptions options = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(contentType, nameof(contentType)); + + using PipelineMessage message = CreateAddUploadPartRequestMessage(uploadId, content, contentType, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + public override ClientResult AddUploadPart(string uploadId, BinaryContent content, string contentType, RequestOptions options = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(contentType, nameof(contentType)); + + using PipelineMessage message = CreateAddUploadPartRequestMessage(uploadId, content, contentType, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + public override async Task CancelUploadAsync(string uploadId, RequestOptions options = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + + using PipelineMessage message = CreateCancelUploadRequest(uploadId, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + public override ClientResult CancelUpload(string uploadId, RequestOptions options = null) + { + Argument.AssertNotNullOrEmpty(uploadId, nameof(uploadId)); + + using PipelineMessage message = CreateCancelUploadRequest(uploadId, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + private PipelineMessage CreateDeleteRequestMessage(string fileId, RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) .WithMethod("DELETE") @@ -140,6 +191,39 @@ private PipelineMessage CreateUploadRequestMessage(BinaryContent content, string .WithAccept("application/json") .WithOptions(options) .Build(); -} -#endif \ No newline at end of file + private PipelineMessage CreateCreateUploadRequestMessage(BinaryContent content, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithMethod("POST") + .WithPath("uploads") + .WithContent(content, "application/json") + .WithAccept("application/json") + .WithOptions(options) + .Build(); + + internal PipelineMessage CreateAddUploadPartRequestMessage(string uploadId, BinaryContent content, string contentType, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithMethod("POST") + .WithPath($"uploads/{uploadId}/parts") + .WithContent(content, contentType) + .WithAccept("application/json") + .WithOptions(options) + .Build(); + + internal PipelineMessage CreateCompleteUploadRequestMessage(string uploadId, BinaryContent content, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithMethod("POST") + .WithPath($"uploads/{uploadId}/complete") + .WithContent(content, "application/json") + .WithAccept("application/json") + .WithOptions(options) + .Build(); + + internal PipelineMessage CreateCancelUploadRequest(string uploadId, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithMethod("POST") + .WithPath($"uploads/{uploadId}/cancel") + .WithAccept("application/json") + .WithOptions(options) + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs index edd3f4bc92b9..c50add3b1ad0 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#if !AZURE_OPENAI_GA - using OpenAI.Files; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; namespace Azure.AI.OpenAI.Files; @@ -15,6 +15,7 @@ namespace Azure.AI.OpenAI.Files; /// /// To retrieve an instance of this type, use the matching method on . /// +[Experimental("AOAI001")] internal partial class AzureFileClient : OpenAIFileClient { private readonly Uri _endpoint; @@ -37,7 +38,7 @@ protected AzureFileClient() /// public override ClientResult UploadFile(Stream file, string filename, FileUploadPurpose purpose, CancellationToken cancellationToken = default) { - if (purpose != FileUploadPurpose.FineTune) + if (purpose != FileUploadPurpose.FineTune && purpose != FileUploadPurpose.Batch) { return base.UploadFile(file, filename, purpose, cancellationToken); } @@ -48,13 +49,14 @@ public override ClientResult UploadFile(Stream file, string filename using MultipartFormDataBinaryContent content = CreateMultiPartContentWithMimeType(file, filename, purpose); ClientResult clientResult = UploadFile(content, content.ContentType, new() { CancellationToken = cancellationToken }); - return ClientResult.FromValue(OpenAIFile.FromResponse(clientResult.GetRawResponse()), clientResult.GetRawResponse()); + + return GetAzureFileResult(clientResult); } /// public override async Task> UploadFileAsync(Stream file, string filename, FileUploadPurpose purpose, CancellationToken cancellationToken = default) { - if (purpose != FileUploadPurpose.FineTune) + if (purpose != FileUploadPurpose.FineTune && purpose != FileUploadPurpose.Batch) { return await base.UploadFileAsync(file, filename, purpose, cancellationToken) .ConfigureAwait(false); @@ -67,16 +69,69 @@ public override async Task> UploadFileAsync(Stream file using MultipartFormDataBinaryContent content = CreateMultiPartContentWithMimeType(file, filename, purpose); ClientResult result = await UploadFileAsync(content, content.ContentType, new() { CancellationToken = cancellationToken }) .ConfigureAwait(continueOnCapturedContext: false); - return ClientResult.FromValue(OpenAIFile.FromResponse(result.GetRawResponse()), result.GetRawResponse()); + return GetAzureFileResult(result); + } + + public override async Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default) + { + ClientResult protocolResult = await GetFileAsync(fileId, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + return GetAzureFileResult(protocolResult); + } + + public override ClientResult GetFile(string fileId, CancellationToken cancellationToken = default) + { + ClientResult protocolResult = GetFile(fileId, cancellationToken.ToRequestOptions()); + return GetAzureFileResult(protocolResult); + } + + public override async Task> GetFilesAsync(CancellationToken cancellationToken = default) + { + ClientResult protocolResult = await GetFilesAsync(null, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + return GetTypedResult(protocolResult, AzureOpenAIFileCollection.FromResponse); + } + + public override ClientResult GetFiles(CancellationToken cancellationToken = default) + { + ClientResult protocolResult = GetFiles(null, cancellationToken.ToRequestOptions()); + return GetTypedResult(protocolResult, AzureOpenAIFileCollection.FromResponse); + } + + public override async Task> GetFilesAsync(FilePurpose purpose, CancellationToken cancellationToken = default) + { + ClientResult protocolResult = await GetFilesAsync(purpose.ToSerialString(), cancellationToken.ToRequestOptions()).ConfigureAwait(false); + return GetTypedResult(protocolResult, AzureOpenAIFileCollection.FromResponse); + } + + public override ClientResult GetFiles(FilePurpose purpose, CancellationToken cancellationToken = default) + { + ClientResult protocolResult = GetFiles(purpose.ToSerialString(), cancellationToken.ToRequestOptions()); + return GetTypedResult(protocolResult, AzureOpenAIFileCollection.FromResponse); } private MultipartFormDataBinaryContent CreateMultiPartContentWithMimeType(Stream file, string filename, FileUploadPurpose purpose) { MultipartFormDataBinaryContent multipartFormDataBinaryContent = new MultipartFormDataBinaryContent(); - multipartFormDataBinaryContent.Add(file, "file", filename, "text/plain"); + string contentType = "text/plain"; + if (purpose == FileUploadPurpose.Batch) + { + contentType = "application/json"; + } + multipartFormDataBinaryContent.Add(file, "file", filename, contentType); multipartFormDataBinaryContent.Add(purpose.ToString(), "purpose"); return multipartFormDataBinaryContent; } -} -#endif \ No newline at end of file + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static ClientResult GetTypedResult(ClientResult result, Func fromResponseFunc) + where T : class + where U : T + { + PipelineResponse rawResponse = result.GetRawResponse(); + U compatibleInstance = fromResponseFunc.Invoke(rawResponse); + return ClientResult.FromValue(compatibleInstance as T, rawResponse); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static ClientResult GetAzureFileResult(ClientResult protocolResult) + => GetTypedResult(protocolResult, AzureOpenAIFile.FromResponse); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileExtensions.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileExtensions.cs new file mode 100644 index 000000000000..862cbc0ebadf --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileExtensions.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +using Azure.AI.OpenAI.Files; + +namespace Azure.AI.OpenAI; + +#pragma warning disable CS0618 + +[Experimental("AOAI001")] +public static partial class AzureFileExtensions +{ + [Experimental("AOAI001")] + public static FileStatus ToFileStatus(this AzureOpenAIFileStatus azureStatus) + { + return azureStatus switch + { + AzureOpenAIFileStatus.Uploaded => FileStatus.Uploaded, + AzureOpenAIFileStatus.Processed => FileStatus.Processed, + AzureOpenAIFileStatus.Error => FileStatus.Error, + _ => (FileStatus)(-1 * Math.Abs(azureStatus.ToSerialString().GetHashCode())) + }; + } + + [Experimental("AOAI001")] + public static AzureOpenAIFileStatus ToAzureOpenAIFileStatus(this FileStatus fileStatus) + { + if (fileStatus == FileStatus.Uploaded) return AzureOpenAIFileStatus.Uploaded; + if (fileStatus == FileStatus.Processed) return AzureOpenAIFileStatus.Processed; + if (fileStatus == FileStatus.Error) return AzureOpenAIFileStatus.Error; + + List otherEncodedStatuses = + [ + AzureOpenAIFileStatus.Pending, + AzureOpenAIFileStatus.Running, + AzureOpenAIFileStatus.Deleting, + AzureOpenAIFileStatus.Deleted, + ]; + + foreach (AzureOpenAIFileStatus otherEncodedStatus in otherEncodedStatuses) + { + if ((int)fileStatus == -1 * Math.Abs(otherEncodedStatus.ToSerialString().GetHashCode())) + { + return otherEncodedStatus; + } + } + + throw new ArgumentOutOfRangeException(nameof(fileStatus), (int)fileStatus, "Unknown AzureOpenAIFileStatus value."); + } +} \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs new file mode 100644 index 000000000000..a354b6909db8 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.AI.OpenAI.Files; + +internal partial class AzureOpenAIFile : IJsonModel +{ + internal static void SerializeAzureOpenAIFile(AzureOpenAIFile instance, Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + if (instance.SerializedAdditionalRawData?.ContainsKey("id") != true) + { + if (Optional.IsDefined(instance.Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(instance.Id); + } + } + if (instance.SerializedAdditionalRawData?.ContainsKey("bytes") != true) + { + if (instance.SizeInBytes != null) + { + writer.WritePropertyName("bytes"u8); + writer.WriteNumberValue(instance.SizeInBytes.Value); + } + else + { + writer.WriteNull("bytes"); + } + } + if (instance.SerializedAdditionalRawData?.ContainsKey("created_at") != true) + { + writer.WritePropertyName("created_at"u8); + writer.WriteNumberValue(instance.CreatedAt, "U"); + } + if (instance.SerializedAdditionalRawData?.ContainsKey("filename") != true) + { + writer.WritePropertyName("filename"u8); + writer.WriteStringValue(instance.Filename); + } + if (instance.SerializedAdditionalRawData?.ContainsKey("object") != true) + { + writer.WritePropertyName("object"u8); + writer.WriteStringValue(instance._object); + } + if (instance.SerializedAdditionalRawData?.ContainsKey("purpose") != true) + { + writer.WritePropertyName("purpose"u8); + writer.WriteStringValue(instance._purpose); + } + if (instance.SerializedAdditionalRawData?.ContainsKey("status_details") != true && Optional.IsDefined(instance.StatusDetails)) + { + writer.WritePropertyName("status_details"u8); + writer.WriteStringValue(instance.StatusDetails); + } + if (instance.SerializedAdditionalRawData?.ContainsKey("status") != true) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(instance._azureStatus.ToSerialString()); + } + if (instance.SerializedAdditionalRawData != null) + { + foreach (var item in instance.SerializedAdditionalRawData) + { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + // CUSTOM: Recovered the deserialization of SerializedAdditionalRawData. See https://github.com/Azure/autorest.csharp/issues/4636. + internal static AzureOpenAIFile DeserializeAzureOpenAIFile(JsonElement element, ModelReaderWriterOptions options = null) + { + string id = default; + int? bytes = default; + DateTimeOffset createdAt = default; + string filename = default; + string @object = default; + string purpose = default; + string statusDetails = default; + AzureOpenAIFileStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("bytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + bytes = null; + continue; + } + bytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("created_at"u8)) + { + createdAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64()); + continue; + } + if (property.NameEquals("filename"u8)) + { + filename = property.Value.GetString(); + continue; + } + if (property.NameEquals("object"u8)) + { + @object = property.Value.GetString(); + continue; + } + if (property.NameEquals("purpose"u8)) + { + purpose = property.Value.GetString(); + continue; + } + if (property.NameEquals("status_details"u8)) + { + statusDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString().ToAzureOpenAIFileStatus(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary ??= new Dictionary(); + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAIFile( + id, + bytes, + createdAt, + filename, + @object, + purpose, + statusDetails, + status, + serializedAdditionalRawData); + } + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + => CustomSerializationHelpers.SerializeInstance(this, SerializeAzureOpenAIFile, writer, options); + + AzureOpenAIFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + => CustomSerializationHelpers.DeserializeNewInstance(this, DeserializeAzureOpenAIFile, ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + => CustomSerializationHelpers.SerializeInstance(this, options); + + AzureOpenAIFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + => CustomSerializationHelpers.DeserializeNewInstance(this, DeserializeAzureOpenAIFile, data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The result to deserialize the model from. + internal static new AzureOpenAIFile FromResponse(PipelineResponse response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureOpenAIFile(document.RootElement); + } + + /// Convert into a . + internal override BinaryContent ToBinaryContent() + { + return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs new file mode 100644 index 000000000000..ce5c4a1424d1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics.CodeAnalysis; + +namespace Azure.AI.OpenAI.Files; + +#pragma warning disable CS0618 + +/// +/// The scenario client used for Files operations with the Azure OpenAI service. +/// +/// +/// To retrieve an instance of this type, use the matching method on . +/// +[CodeGenModel("AzureOpenAIFile")] +[Experimental("AOAI001")] +internal partial class AzureOpenAIFile : OpenAIFile +{ + public new string Id => base.Id; + + public new DateTimeOffset CreatedAt => base.CreatedAt; + + public new string Filename => base.Filename; + + public new string StatusDetails => base.StatusDetails; + + [CodeGenMember("Bytes")] + public new int? SizeInBytes => base.SizeInBytes; + + [CodeGenMember("Status")] + private readonly AzureOpenAIFileStatus _azureStatus; + + public new FileStatus Status => AzureFileExtensions.ToFileStatus(_azureStatus); + + [CodeGenMember("Purpose")] + private string _purpose; + + public new FilePurpose Purpose + { + get => base.Purpose; + set => _purpose = value.ToSerialString(); + } + + [CodeGenMember("Object")] + internal string _object; + + internal InternalOpenAIFileObject Object => _object; + + internal new IDictionary SerializedAdditionalRawData { get; } + + /// Initializes a new instance of . + /// The file identifier, which can be referenced in the API endpoints. + /// The size of the file, in bytes. + /// The Unix timestamp (in seconds) for when the file was created. + /// The name of the file. + /// The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`. + /// + /// , or is null. + internal AzureOpenAIFile(string id, int? bytes, DateTimeOffset createdAt, string filename, string purpose, AzureOpenAIFileStatus azureStatus) + : base(id, bytes, createdAt, filename, purpose.ToFilePurpose(), azureStatus.ToFileStatus()) + { + _object = InternalListFilesResponseObject.List.ToString(); + _purpose = purpose; + _azureStatus = azureStatus; + } + + /// Initializes a new instance of . + /// The file identifier, which can be referenced in the API endpoints. + /// The size of the file, in bytes. + /// The Unix timestamp (in seconds) for when the file was created. + /// The name of the file. + /// The object type, which is always `file`. + /// The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`. + /// Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + /// + /// Keeps track of any properties unknown to the library. + internal AzureOpenAIFile(string id, int? bytes, DateTimeOffset createdAt, string filename, InternalOpenAIFileObject @object, string purpose, string statusDetails, AzureOpenAIFileStatus azureStatus, IDictionary serializedAdditionalRawData) + : base(id, bytes, createdAt, filename, @object, purpose.ToFilePurpose(), azureStatus.ToFileStatus(), statusDetails, serializedAdditionalRawData) + { + _object = @object.ToString(); + _purpose = purpose; + _azureStatus = azureStatus; + } + + /// Initializes a new instance of for deserialization. + internal AzureOpenAIFile() + { + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileCollection.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileCollection.Serialization.cs new file mode 100644 index 000000000000..436cf25940df --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileCollection.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.AI.OpenAI.Files; + +internal partial class AzureOpenAIFileCollection : IJsonModel +{ + internal static void SerializeAzureOpenAIFileCollection(AzureOpenAIFileCollection instance, Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName("data"u8); + writer.WriteStartArray(); + foreach (var item in instance.Items) + { + writer.WriteObjectValue(item as AzureOpenAIFile, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("object"u8); + writer.WriteStringValue(instance.Object.ToString()); + writer.WriteSerializedAdditionalRawData(instance.SerializedAdditionalRawData, options); + writer.WriteEndObject(); + } + + // CUSTOM: Recovered the deserialization of SerializedAdditionalRawData. See https://github.com/Azure/autorest.csharp/issues/4636. + internal static AzureOpenAIFileCollection DeserializeAzureOpenAIFileCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList data = default; + InternalListFilesResponseObject @object = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("data"u8)) + { + List array = []; + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureOpenAIFile.DeserializeAzureOpenAIFile(item, options)); + } + data = array; + continue; + } + if (property.NameEquals("object"u8)) + { + @object = new InternalListFilesResponseObject(property.Value.GetString()); + continue; + } + if (true) + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAIFileCollection(data, @object, serializedAdditionalRawData); + } + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + => CustomSerializationHelpers.SerializeInstance(this, SerializeAzureOpenAIFileCollection, writer, options); + + AzureOpenAIFileCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + => CustomSerializationHelpers.DeserializeNewInstance(this, DeserializeAzureOpenAIFileCollection, ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + => CustomSerializationHelpers.SerializeInstance(this, options); + + AzureOpenAIFileCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + => CustomSerializationHelpers.DeserializeNewInstance(this, DeserializeAzureOpenAIFileCollection, data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + internal static new AzureOpenAIFileCollection FromResponse(PipelineResponse response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureOpenAIFileCollection(document.RootElement); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileCollection.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileCollection.cs new file mode 100644 index 000000000000..de883b6dd505 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileCollection.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +namespace Azure.AI.OpenAI.Files; + +[Experimental("AOAI001")] +internal partial class AzureOpenAIFileCollection : OpenAIFileCollection +{ + internal IDictionary SerializedAdditionalRawData { get; } + = new ChangeTrackingDictionary(); + + internal InternalListFilesResponseObject Object { get; } + + internal AzureOpenAIFileCollection() + : this( + new ChangeTrackingList(), + InternalListFilesResponseObject.List, + new ChangeTrackingDictionary()) + { } + + internal AzureOpenAIFileCollection( + IEnumerable files, + InternalListFilesResponseObject @object, + IDictionary serializedAdditionalRawData) + : base(files.Cast().ToList(), @object, serializedAdditionalRawData) + { } +} \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileStatus.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileStatus.Serialization.cs new file mode 100644 index 000000000000..e2e7bb60376d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileStatus.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +using Azure.AI.OpenAI.Files; + +namespace Azure.AI.OpenAI; + +internal static partial class AzureOpenAIFileStatusExtensions +{ + public static string ToSerialString(this AzureOpenAIFileStatus value) => value switch + { + AzureOpenAIFileStatus.Uploaded => "uploaded", + AzureOpenAIFileStatus.Pending => "pending", + AzureOpenAIFileStatus.Running => "running", + AzureOpenAIFileStatus.Processed => "processed", + AzureOpenAIFileStatus.Error => "error", + AzureOpenAIFileStatus.Deleting => "deleting", + AzureOpenAIFileStatus.Deleted => "deleted", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureOpenAIFileStatus value.") + }; + + public static AzureOpenAIFileStatus ToAzureOpenAIFileStatus(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "uploaded")) return AzureOpenAIFileStatus.Uploaded; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "pending")) return AzureOpenAIFileStatus.Pending; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "running")) return AzureOpenAIFileStatus.Running; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "processed")) return AzureOpenAIFileStatus.Processed; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "error")) return AzureOpenAIFileStatus.Error; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deleting")) return AzureOpenAIFileStatus.Deleting; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "deleted")) return AzureOpenAIFileStatus.Deleted; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureOpenAIFileStatus value."); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileStatus.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileStatus.cs new file mode 100644 index 000000000000..149ade3108a5 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFileStatus.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.AI.OpenAI.Files; + +public enum AzureOpenAIFileStatus +{ + Unknown, + Uploaded, + Pending, + Running, + Processed, + Error, + Deleting, + Deleted +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.Protocol.cs index 038fed4cca28..48c88e154c19 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.Protocol.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#if !AZURE_OPENAI_GA + using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; @@ -37,3 +39,5 @@ public override async Task StartConversationSession } } } + +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.cs index 029a7f9ac8d9..ba5fc3608df9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationClient.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#if !AZURE_OPENAI_GA + using Azure.Core; using OpenAI.RealtimeConversation; using System.ClientModel; @@ -76,3 +78,5 @@ private static Uri GetEndpoint(Uri endpoint, string deploymentName, string apiVe return uriBuilder.Uri; } } + +#endif diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.Protocol.cs index 38953624b0ba..10e1054fd9da 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.Protocol.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#if !AZURE_OPENAI_GA + using Azure.Core; using System.ClientModel.Primitives; using System.ComponentModel; @@ -84,3 +86,5 @@ private async Task CreateAzureWebSocketAsync(RequestOptions opt return clientWebSocket; } } + +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.cs index 0fe51b40d754..bc045c17184f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/RealtimeConversation/AzureRealtimeConversationSession.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#if !AZURE_OPENAI_GA + using System.ClientModel; using System.ClientModel.Primitives; using System.Diagnostics.CodeAnalysis; @@ -48,3 +50,5 @@ private AzureRealtimeConversationSession(AzureRealtimeConversationClient parentC _userAgent = userAgent; } } + +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs deleted file mode 100644 index 98a048d35539..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ContentFilterTextSpan : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterTextSpan)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("completion_start_offset") != true) - { - writer.WritePropertyName("completion_start_offset"u8); - writer.WriteNumberValue(CompletionStartOffset); - } - if (SerializedAdditionalRawData?.ContainsKey("completion_end_offset") != true) - { - writer.WritePropertyName("completion_end_offset"u8); - writer.WriteNumberValue(CompletionEndOffset); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContentFilterTextSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterTextSpan)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContentFilterTextSpan(document.RootElement, options); - } - - internal static ContentFilterTextSpan DeserializeContentFilterTextSpan(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int completionStartOffset = default; - int completionEndOffset = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("completion_start_offset"u8)) - { - completionStartOffset = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("completion_end_offset"u8)) - { - completionEndOffset = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterTextSpan(completionStartOffset, completionEndOffset, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContentFilterTextSpan)} does not support writing '{options.Format}' format."); - } - } - - ContentFilterTextSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContentFilterTextSpan(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContentFilterTextSpan)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterTextSpan FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterTextSpan(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs deleted file mode 100644 index 2b04de8d0121..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs +++ /dev/null @@ -1,74 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.OpenAI -{ - /// A representation of a span of completion text as used by Azure OpenAI content filter results. - public partial class ContentFilterTextSpan - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Offset of the UTF32 code point which begins the span. - /// Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. - internal ContentFilterTextSpan(int completionStartOffset, int completionEndOffset) - { - CompletionStartOffset = completionStartOffset; - CompletionEndOffset = completionEndOffset; - } - - /// Initializes a new instance of . - /// Offset of the UTF32 code point which begins the span. - /// Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. - /// Keeps track of any properties unknown to the library. - internal ContentFilterTextSpan(int completionStartOffset, int completionEndOffset, IDictionary serializedAdditionalRawData) - { - CompletionStartOffset = completionStartOffset; - CompletionEndOffset = completionEndOffset; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterTextSpan() - { - } - - /// Offset of the UTF32 code point which begins the span. - public int CompletionStartOffset { get; } - /// Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. - public int CompletionEndOffset { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs deleted file mode 100644 index 4e7e99ab7caf..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs +++ /dev/null @@ -1,168 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; - -namespace Azure.AI.OpenAI -{ - public partial class ContentFilterTextSpanResult : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterTextSpanResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) - { - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - } - if (SerializedAdditionalRawData?.ContainsKey("detected") != true) - { - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - } - if (SerializedAdditionalRawData?.ContainsKey("details") != true) - { - writer.WritePropertyName("details"u8); - writer.WriteStartArray(); - foreach (var item in Details) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData != null) - { - foreach (var item in SerializedAdditionalRawData) - { - if (ModelSerializationExtensions.IsSentinelValue(item.Value)) - { - continue; - } - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ContentFilterTextSpanResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ContentFilterTextSpanResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeContentFilterTextSpanResult(document.RootElement, options); - } - - internal static ContentFilterTextSpanResult DeserializeContentFilterTextSpanResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool filtered = default; - bool detected = default; - IReadOnlyList details = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("filtered"u8)) - { - filtered = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("detected"u8)) - { - detected = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("details"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContentFilterTextSpan.DeserializeContentFilterTextSpan(item, options)); - } - details = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterTextSpanResult(filtered, detected, details, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(ContentFilterTextSpanResult)} does not support writing '{options.Format}' format."); - } - } - - ContentFilterTextSpanResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeContentFilterTextSpanResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ContentFilterTextSpanResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterTextSpanResult FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterTextSpanResult(document.RootElement); - } - - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs deleted file mode 100644 index 9f7a3dba1e0f..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs +++ /dev/null @@ -1,84 +0,0 @@ -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.OpenAI -{ - /// The AzureContentFilterCompletionTextSpanDetectionResult. - public partial class ContentFilterTextSpanResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// Detailed information about the detected completion text spans. - /// is null. - internal ContentFilterTextSpanResult(bool filtered, bool detected, IEnumerable details) - { - Argument.AssertNotNull(details, nameof(details)); - - Filtered = filtered; - Detected = detected; - Details = details.ToList(); - } - - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// Detailed information about the detected completion text spans. - /// Keeps track of any properties unknown to the library. - internal ContentFilterTextSpanResult(bool filtered, bool detected, IReadOnlyList details, IDictionary serializedAdditionalRawData) - { - Filtered = filtered; - Detected = detected; - Details = details; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterTextSpanResult() - { - } - - /// Whether the content detection resulted in a content filtering action. - public bool Filtered { get; } - /// Whether the labeled content category was detected in the content. - public bool Detected { get; } - /// Detailed information about the detected completion text spans. - public IReadOnlyList Details { get; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs index 344aed0274a7..e8c214ce91ac 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs @@ -145,4 +145,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs index 73fc1546e469..53b7f23f8c73 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs @@ -39,4 +39,3 @@ internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions() internal string AccessToken { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs index 4d448e27cf9e..2dcb1342683a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs @@ -145,4 +145,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs index 1d92c00c05f7..1a4a6f838576 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs @@ -39,4 +39,3 @@ internal InternalAzureChatDataSourceApiKeyAuthenticationOptions() internal string Key { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs index 87563d7c14b9..71afd3915803 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs @@ -145,4 +145,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs index 86a7f544bd27..f50be4aea567 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs @@ -39,4 +39,3 @@ internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions() internal string ConnectionString { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs index a322da00a07b..c4adb5301c7f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs @@ -160,4 +160,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs index e413a85711ef..f900a3451948 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs @@ -62,4 +62,3 @@ internal InternalAzureChatDataSourceDeploymentNameVectorizationSource() public int? Dimensions { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs index b24dfb4f4137..1f5b75133597 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs @@ -145,4 +145,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs index 36c145320c34..2a4b3ff8c987 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs @@ -39,4 +39,3 @@ internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions() internal string EncodedApiKey { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs index e984e66bca8a..0a3bc0f5c9fe 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs @@ -171,4 +171,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs index 38b036485065..c66ca6f7380e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs @@ -77,4 +77,3 @@ internal InternalAzureChatDataSourceEndpointVectorizationSource() public int? Dimensions { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs index 92c61b0e631a..7880eecc84fe 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs @@ -134,4 +134,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs index 08fa29e39635..d72e6eda8f48 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs @@ -24,4 +24,3 @@ internal InternalAzureChatDataSourceIntegratedVectorizationSource(string type, I } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs index 3d1b11f308cc..8bbae28863af 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs @@ -156,4 +156,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs index 528d5880483e..426de4609525 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs @@ -46,4 +46,3 @@ internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions() internal string KeyId { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs index cbbae8276b91..0cac82ddd684 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs @@ -145,4 +145,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs index b4bf391b5bf6..5db5e3c5e523 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs @@ -42,4 +42,3 @@ internal InternalAzureChatDataSourceModelIdVectorizationSource() internal string ModelId { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 3d97453fcfd2..db765e8d174d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -134,4 +134,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs index 6b64f501d4d7..52d75514184f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs @@ -24,4 +24,3 @@ internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationO } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 92a62ed8c6bb..dceed3714c4a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -145,4 +145,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs index 97f938b2bd14..dafba9a8ec27 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs @@ -39,4 +39,3 @@ internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOpt internal string ManagedIdentityResourceId { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs index 4fa05a6eb3b8..13dc6a14a391 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs @@ -156,4 +156,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs index c72d02a0de9b..d47f5a241c45 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs @@ -46,4 +46,3 @@ internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions() internal string Password { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs index e00fc19ccf89..7ad7d81738a4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs @@ -145,4 +145,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs index 1950182689c4..6a0b6caccf3d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs @@ -78,4 +78,3 @@ internal InternalAzureContentFilterBlocklistIdResult() internal bool Filtered { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs index 02ac4d99cbe9..48a2417a5707 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs @@ -145,4 +145,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs index d0726035c32b..57e5e5ea6570 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs @@ -75,4 +75,3 @@ internal InternalAzureContentFilterBlocklistResultDetail() internal string Id { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs index c2378dd52216..936b782da8cd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs @@ -260,4 +260,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs index 8c654f48774d..b45626184ea2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs @@ -166,4 +166,3 @@ internal InternalAzureContentFilterResultForPromptContentFilterResults() internal ContentFilterDetectionResult IndirectAttack { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs index 24d22365ed03..48b505fb8b41 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs @@ -145,4 +145,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs index af8b8a13fe2a..212b8c2844e4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs @@ -75,4 +75,3 @@ internal InternalAzureContentFilterResultForPromptContentFilterResultsError() internal string Message { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs index 677a0355da0b..7f959c4214e5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs @@ -302,4 +302,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs index 90c5774584cc..766b29fbd6dd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs @@ -150,4 +150,3 @@ internal InternalAzureCosmosDBChatDataSourceParameters() internal string IndexName { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs index 0a58496a1938..add450e67f4f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs @@ -164,4 +164,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs index 2209ed339feb..94f1da0eb40e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs @@ -67,4 +67,3 @@ internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInne internal RequestContentFilterResult ContentFilterResults { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs index 1e1ab2f0c352..155e4eb0189c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs @@ -43,4 +43,3 @@ public InternalAzureOpenAIChatErrorInnerErrorCode(string value) public override string ToString() => _value; } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs index 36e2e5564ba2..2fce6545c60a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs @@ -164,4 +164,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs index 415434fba3a0..d600b81cfcf1 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs @@ -67,4 +67,3 @@ internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorIn internal RequestImageContentFilterResult ContentFilterResults { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs index 35cf2d97866f..95c39267783c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs @@ -43,4 +43,3 @@ public InternalAzureOpenAIDalleErrorInnerErrorCode(string value) public override string ToString() => _value; } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs index 49694aa0a5ec..88577c1676c5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs @@ -338,4 +338,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs index f46714e50404..cbd3f5dcca50 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs @@ -149,4 +149,3 @@ internal InternalAzureSearchChatDataSourceParameters() public string Filter { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs index 90e6d867660d..f8290caaec9d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs @@ -49,4 +49,3 @@ public InternalAzureSearchChatDataSourceParametersIncludeContext(string value) public override string ToString() => _value; } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs index f526b7d19d4e..058247fcf132 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs @@ -314,4 +314,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs index dcd3601dd9f7..f82b1889d191 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs @@ -137,4 +137,3 @@ internal InternalElasticsearchChatDataSourceParameters() internal string IndexName { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs index b692f22a29c8..4b033c4facfa 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs @@ -326,4 +326,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs index 52ccc319dc6f..5b79c3c25d33 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs @@ -178,4 +178,3 @@ internal InternalMongoDBChatDataSourceParameters() internal string IndexName { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs index 9e985538ecb7..245e5f4ce33d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs @@ -290,4 +290,3 @@ internal virtual BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs index c886686b184b..a559fbb2e9ce 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs @@ -157,4 +157,3 @@ internal InternalPineconeChatDataSourceParameters() internal string IndexName { get; set; } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs index bb4da7e040a3..712e1700496e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs @@ -134,4 +134,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs index 7b93d69910d6..4d8d34f5dd76 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs @@ -23,4 +23,3 @@ internal InternalUnknownAzureChatDataSource() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs index a852533c4a82..80d03d0db336 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs @@ -134,4 +134,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs index 1833688883e8..4bd41a7041f4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs @@ -23,4 +23,3 @@ internal InternalUnknownAzureChatDataSourceAuthenticationOptions() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs index ed6bccf0c5ad..be1a50c9d1dd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs @@ -134,4 +134,3 @@ internal override BinaryContent ToBinaryContent() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs index 56560cf74c1f..6b9910a124ee 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs @@ -23,4 +23,3 @@ internal InternalUnknownAzureChatDataSourceVectorizationSource() } } } - diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs index 7d03d6540b2d..5e9da43d62eb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs @@ -66,11 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("protected_material_code"u8); writer.WriteObjectValue(ProtectedMaterialCode, options); } - if (SerializedAdditionalRawData?.ContainsKey("ungrounded_material") != true && Optional.IsDefined(UngroundedMaterial)) - { - writer.WritePropertyName("ungrounded_material"u8); - writer.WriteObjectValue(UngroundedMaterial, options); - } if (SerializedAdditionalRawData != null) { foreach (var item in SerializedAdditionalRawData) @@ -122,7 +117,6 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu InternalAzureContentFilterResultForPromptContentFilterResultsError error = default; ContentFilterDetectionResult protectedMaterialText = default; ContentFilterProtectedMaterialResult protectedMaterialCode = default; - ContentFilterTextSpanResult ungroundedMaterial = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -208,15 +202,6 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu protectedMaterialCode = ContentFilterProtectedMaterialResult.DeserializeContentFilterProtectedMaterialResult(property.Value, options); continue; } - if (property.NameEquals("ungrounded_material"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ungroundedMaterial = ContentFilterTextSpanResult.DeserializeContentFilterTextSpanResult(property.Value, options); - continue; - } if (options.Format != "W") { rawDataDictionary ??= new Dictionary(); @@ -234,7 +219,6 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu error, protectedMaterialText, protectedMaterialCode, - ungroundedMaterial, serializedAdditionalRawData); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs index 87fda89bae54..be77b4567b3d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs @@ -75,9 +75,8 @@ internal ResponseContentFilterResult() /// If present, details about an error that prevented content filtering from completing its evaluation. /// A detection result that describes a match against text protected under copyright or other status. /// A detection result that describes a match against licensed code or other protected source material. - /// /// Keeps track of any properties unknown to the library. - internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForPromptContentFilterResultsError error, ContentFilterDetectionResult protectedMaterialText, ContentFilterProtectedMaterialResult protectedMaterialCode, ContentFilterTextSpanResult ungroundedMaterial, IDictionary serializedAdditionalRawData) + internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForPromptContentFilterResultsError error, ContentFilterDetectionResult protectedMaterialText, ContentFilterProtectedMaterialResult protectedMaterialCode, IDictionary serializedAdditionalRawData) { Sexual = sexual; Hate = hate; @@ -88,7 +87,6 @@ internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, Content Error = error; ProtectedMaterialText = protectedMaterialText; ProtectedMaterialCode = protectedMaterialCode; - UngroundedMaterial = ungroundedMaterial; SerializedAdditionalRawData = serializedAdditionalRawData; } @@ -127,7 +125,5 @@ internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, Content public ContentFilterDetectionResult ProtectedMaterialText { get; } /// A detection result that describes a match against licensed code or other protected source material. public ContentFilterProtectedMaterialResult ProtectedMaterialCode { get; } - /// Gets the ungrounded material. - public ContentFilterTextSpanResult UngroundedMaterial { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs index 23fc567fa203..f6b912fc20af 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs @@ -128,4 +128,27 @@ internal static void WriteSerializedAdditionalRawData(this Utf8JsonWriter writer } } } + + internal static void WriteOptionalProperty(this Utf8JsonWriter writer, ReadOnlySpan name, T value, ModelReaderWriterOptions options) + { + if (Optional.IsDefined(value)) + { + writer.WritePropertyName(name); + writer.WriteObjectValue(value, options); + } + } + + internal static void WriteOptionalCollection(this Utf8JsonWriter writer, ReadOnlySpan name, IEnumerable values, ModelReaderWriterOptions options) + { + if (Optional.IsCollectionDefined(values)) + { + writer.WritePropertyName(name); + writer.WriteStartArray(); + foreach (T item in values) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json b/sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json index 289d009e85c1..85ca9bef7fe5 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json +++ b/sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json @@ -12,6 +12,11 @@ "audio": { "deployment": "whisper" }, + "batch": { + "endpoint": "https://Sanitized.openai.azure.com/", + "key": "Sanitized", + "deployment": "gpt-4o-mini-global-batch" + }, "chat": { "endpoint": "https://Sanitized.openai.azure.com/", "key": "Sanitized", diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs index 6a4e591914ed..81055af57fd6 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs @@ -417,8 +417,8 @@ public async Task BasicRunStepFunctionalityWorks() Assert.Multiple(() => { Assert.That(details?.ToolCalls.Count, Is.GreaterThan(0)); - Assert.That(details.ToolCalls[0].ToolKind, Is.EqualTo(RunStepToolCallKind.CodeInterpreter)); - Assert.That(details.ToolCalls[0].ToolCallId, Is.Not.Null.Or.Empty); + Assert.That(details.ToolCalls[0].Kind, Is.EqualTo(RunStepToolCallKind.CodeInterpreter)); + Assert.That(details.ToolCalls[0].Id, Is.Not.Null.Or.Empty); Assert.That(details.ToolCalls[0].CodeInterpreterInput, Is.Not.Null.Or.Empty); Assert.That(details.ToolCalls[0].CodeInterpreterOutputs?.Count, Is.GreaterThan(0)); Assert.That(details.ToolCalls[0].CodeInterpreterOutputs[0].ImageFileId, Is.Not.Null.Or.Empty); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj index aa5c6fc2c002..c3fae7d17b62 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj +++ b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj @@ -15,6 +15,14 @@ + + + diff --git a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs index 40a5836bce4d..0999e43bcb52 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; @@ -9,7 +9,9 @@ using System.Linq; using System.Net.Http; using System.Text.Json; +using System.Text.RegularExpressions; using System.Threading.Tasks; +using Azure.AI.OpenAI.Files; using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; @@ -23,207 +25,253 @@ namespace Azure.AI.OpenAI.Tests; +#pragma warning disable CS0618 + public class BatchTests : AoaiTestBase { public BatchTests(bool isAsync) : base(isAsync) { } -#if !AZURE_OPENAI_GA [Test] [Category("Smoke")] public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); [RecordedTest] - [Ignore("Azure OpenAI does not yet support batch file uploads")] - public async Task SimpleBatchCompletionsTest() + public async Task CanUploadFileForBatch() { - BatchClient batchClient = GetTestClient(new TestClientOptions(AzureOpenAIClientOptions.ServiceVersion.V2024_06_01)); - await using BatchOperations ops = new(this, batchClient); + BatchClient batchClient = GetTestClient(); + OpenAIFileClient fileClient = GetTestClientFrom(batchClient); + + OpenAIFile newFile = await fileClient.UploadFileAsync( + BinaryData.FromString("this isn't valid input for batch"), + "intentionally-bad-batch-input.jsonl", + FileUploadPurpose.Batch); + Validate(newFile); + + AzureOpenAIFileStatus azureStatus = newFile.Status.ToAzureOpenAIFileStatus(); + Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Pending)); - // Create the batch operations to send and upload them - ops.ChatClient.CompleteChat([new SystemChatMessage("You are a saccharine AI"), new UserChatMessage("Tell me about yourself")]); - ops.ChatClient.CompleteChat([new UserChatMessage("Give me a large random number")]); - Assert.That(ops.Operations, Has.Count.EqualTo(2)); - string inputFileId = await ops.UploadBatchFileAsync(); + TimeSpan filePollingInterval = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(5); - // Create the batch operation - using var requestContent = new BatchOptions() + for (int i = 0; i < 10 && azureStatus == AzureOpenAIFileStatus.Pending; i++) { - InputFileId = inputFileId, - Endpoint = ops.Operations.Select(o => o.Url).Distinct().First(), - Metadata = - { - [ "description" ] = "Azure OpenAI .Net SDK integration test framework " + nameof(SimpleBatchCompletionsTest), - } - }.ToBinaryContent(); + await Task.Delay(filePollingInterval); + newFile = await fileClient.GetFileAsync(newFile.Id); + azureStatus = newFile.Status.ToAzureOpenAIFileStatus(); + } - CreateBatchOperation operation = await batchClient.CreateBatchAsync(requestContent, true); + Assert.That(azureStatus, Is.EqualTo(AzureOpenAIFileStatus.Error)); + Assert.That(newFile.StatusDetails, Does.Contain("valid json")); + } + + [RecordedTest] + public async Task CanCancelBatch() + { + BatchClient batchClient = GetTestClient(); + OpenAIFileClient fileClient = GetTestClientFrom(batchClient); + string deploymentName = TestConfig.GetConfig()!.Deployment!; - // Poll until we've completed, failed, or were canceled - operation.WaitForCompletion(); + TimeSpan pollingInterval = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(15); - ClientResult response = operation.GetBatch(null); - BatchObject batchObj = ExtractAndValidateBatchObj(response); + BinaryData jsonlInputBytes = BinaryData.FromString($$$""" + {"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "{{{deploymentName}}}", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 1000}} + {"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "{{{deploymentName}}}", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 1000}} + """); + OpenAIFile batchInputFile = await fileClient.UploadFileAsync(jsonlInputBytes, "temp-test-batch-input.jsonl", FileUploadPurpose.Batch); + Validate(batchInputFile); - Assert.That(batchObj.OutputFileID, Is.Not.Null.Or.Empty); - BinaryData outputData = await ops.DownloadAndValidateResultAsync(batchObj.OutputFileID!); - var parsedOutput = BatchResult.From(outputData); - Assert.That(parsedOutput, Is.Not.Null); - Assert.That(parsedOutput, Has.Count.EqualTo(ops.Operations.Count)); - for (int i = 0; i < parsedOutput.Count; i++) + while (batchInputFile.Status.ToAzureOpenAIFileStatus() == AzureOpenAIFileStatus.Pending) { - Assert.That(parsedOutput[i].CustomId, Is.EqualTo(ops.Operations[i].CustomId), "Wrong custom ID at index {0}", i); - var completion = parsedOutput[i].Response!; - Assert.That(completion, Is.Not.Null); - Assert.That(completion.Role, Is.EqualTo(ChatMessageRole.Assistant)); - Assert.That(completion.Content, Has.Count.EqualTo(1)); - Assert.That(completion.Content[0].Kind, Is.EqualTo(ChatMessageContentPartKind.Text)); - Assert.That(completion.Content[0].Text, Is.Not.Null.Or.Empty); + await Task.Delay(pollingInterval); + batchInputFile = await fileClient.GetFileAsync(batchInputFile.Id); } + Assert.That(batchInputFile.Status, Is.EqualTo(FileStatus.Processed)); - } -#else - [Test] - [SyncOnly] - public void UnsupportedVersionBatchClientThrows() - { - Assert.Throws(() => GetTestClient()); - } -#endif + BinaryData createBatchRequestBytes = BinaryData.FromString($$""" + { + "input_file_id": "{{batchInputFile.Id}}", + "endpoint": "/v1/chat/completions", + "completion_window": "24h" + } + """); + CreateBatchOperation createBatchOperation = await batchClient.CreateBatchAsync(BinaryContent.Create(createBatchRequestBytes), waitUntilCompleted: false); + Validate(createBatchOperation); - #region helper methods + _ = await createBatchOperation.CancelAsync(default); + _ = await createBatchOperation.UpdateStatusAsync(); - private BinaryData ValidateHasRawJsonResponse(ClientResult result) - { - Assert.That(result, Is.Not.Null); - PipelineResponse response = result.GetRawResponse(); - Assert.That(response, Is.Not.Null); - Assert.That(response.Status, Is.GreaterThanOrEqualTo(200).And.LessThan(300)); - Assert.That(response.Headers.GetFirstOrDefault("Content-Type"), Does.StartWith("application/json")); + Assert.That(createBatchOperation!.GetRawResponse()!.Content.ToString().Replace(" ", ""), Does.Contain(@"""status"":""cancelling""")); - return response.Content; - } + while (!createBatchOperation.HasCompleted) + { + await Task.Delay(pollingInterval); + _ = await createBatchOperation.UpdateStatusAsync(); + } - private void ValidateBatchResult(BatchObject batchObj) - { - Assert.That(batchObj, Is.Not.Null); - Assert.That(batchObj.Id, Is.Not.Null.Or.Empty); - Assert.That(batchObj.Status, Is.Not.Null); - Assert.That(batchObj.Status, Is.AnyOf("validating", "in_progress", "finalizing", "completed")); + Assert.That(createBatchOperation!.GetRawResponse()!.Content.ToString().Replace(" ", ""), Does.Contain(@"""status"":""cancelled""")); } - private BatchObject ExtractAndValidateBatchObj(ClientResult result) + [RecordedTest] + [Category("LongRunning")] // observed live runtime typically varies from 6 - 15 minutes + public async Task SimpleBatchCompletionsTest() { - var binaryData = ValidateHasRawJsonResponse(result); - var batchObj = BatchObject.From(binaryData); - ValidateBatchResult(batchObj); - return batchObj; - } + BatchClient batchClient = GetTestClient(); + OpenAIFileClient fileClient = GetTestClientFrom(batchClient); + string deploymentName = TestConfig.GetConfig()!.Deployment!; - #endregion + TimeSpan pollingInterval = Recording!.Mode == RecordedTestMode.Playback ? TimeSpan.FromMilliseconds(1) : TimeSpan.FromSeconds(15); - #region helper classes + BinaryData jsonlInputBytes = BinaryData.FromString($$$""" + {"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "{{{deploymentName}}}", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 1000}} + {"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "{{{deploymentName}}}", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 1000}} + """); + OpenAIFile batchInputFile = await fileClient.UploadFileAsync(jsonlInputBytes, "temp-test-batch-input.jsonl", FileUploadPurpose.Batch); + Validate(batchInputFile); - private class BatchOperations : IAsyncDisposable - { - private MockHttpMessageHandler _handler; - private List _operations; - private string? _uploadId; - private OpenAIFileClient _fileClient; - - public BatchOperations(AoaiTestBase testBase, BatchClient batchClient) + while (batchInputFile.Status.ToAzureOpenAIFileStatus() == AzureOpenAIFileStatus.Pending) { - _handler = new(MockHttpMessageHandler.ReturnEmptyJson); - _handler.OnRequest += HandleRequest; - _operations = new(); - - BatchFileName = "batch-" + Guid.NewGuid().ToString("D") + ".json"; + await Task.Delay(pollingInterval); + batchInputFile = await fileClient.GetFileAsync(batchInputFile.Id); + } + Assert.That(batchInputFile.Status, Is.EqualTo(FileStatus.Processed)); - _fileClient = testBase.GetTestClientFrom(batchClient); + BinaryData createBatchRequestBytes = BinaryData.FromString($$""" + { + "input_file_id": "{{batchInputFile.Id}}", + "endpoint": "/v1/chat/completions", + "completion_window": "24h" + } + """); + CreateBatchOperation createBatchOperation = await batchClient.CreateBatchAsync(BinaryContent.Create(createBatchRequestBytes), waitUntilCompleted: false); + Validate(createBatchOperation); - // Generate the fake pipeline to capture requests and save them to a file later - AzureOpenAIClient fakeTopLevel = new AzureOpenAIClient( - new Uri("https://not.a.real.endpoint.fake"), - new ApiKeyCredential("not.a.real.key"), - new() { Transport = _handler.Transport }); + BinaryData latestProtocolBatchBytes = createBatchOperation!.GetRawResponse()!.Content; - ChatClient = fakeTopLevel.GetChatClient(testBase.TestConfig.GetConfig().DeploymentOrThrow("chat client")); - EmbeddingClient = fakeTopLevel.GetEmbeddingClient(testBase.TestConfig.GetConfig().DeploymentOrThrow("embedding client")); + while (!createBatchOperation.HasCompleted) + { + await Task.Delay(pollingInterval); + _ = await createBatchOperation.UpdateStatusAsync(); + latestProtocolBatchBytes = createBatchOperation.GetRawResponse()!.Content; + Assert.That(latestProtocolBatchBytes, Is.Not.Null); } - public string BatchFileName { get; } - public IReadOnlyList Operations => _operations; - public ChatClient ChatClient { get; } - public EmbeddingClient EmbeddingClient { get; } + string? resultBatchId = null; + string? resultInputFileId = null; + string? resultOutputFileId = null; + string? resultStatus = null; - public async Task UploadBatchFileAsync() + using JsonDocument batchJsonDocument = JsonDocument.Parse(latestProtocolBatchBytes); + foreach (JsonProperty batchJsonProperty in batchJsonDocument.RootElement.EnumerateObject()) { - if (Operations.Count == 0) + if (batchJsonProperty.NameEquals("id"u8)) { - throw new InvalidOperationException(); + resultBatchId = batchJsonProperty.Value.GetString(); + continue; } + if (batchJsonProperty.NameEquals("input_file_id"u8)) + { + resultInputFileId = batchJsonProperty.Value.GetString(); + continue; + } + if (batchJsonProperty.NameEquals("output_file_id"u8)) + { + resultOutputFileId = batchJsonProperty.Value.GetString(); + continue; + } + if (batchJsonProperty.NameEquals("status"u8)) + { + resultStatus = batchJsonProperty.Value.GetString(); + continue; + } + } - using MemoryStream stream = new MemoryStream(); - JsonSerializer.Serialize(stream, _operations, JsonOptions.OpenAIJsonOptions); - stream.Seek(0, SeekOrigin.Begin); - var data = BinaryData.FromStream(stream); + Assert.That(resultBatchId, Is.EqualTo(createBatchOperation.BatchId)); + Assert.That(resultInputFileId, Is.EqualTo(batchInputFile.Id)); + Assert.That(resultOutputFileId, Is.Not.Null.And.Not.Empty); + Assert.That(resultStatus, Is.EqualTo("completed")); - using var content = BinaryContent.Create(data); + BinaryData batchOutputBytes = await fileClient.DownloadFileAsync(resultOutputFileId); + Assert.That(batchOutputBytes, Is.Not.Null); - OpenAIFile file = await _fileClient.UploadFileAsync(data, BatchFileName, FileUploadPurpose.Batch); - _uploadId = file.Id; - Assert.That(_uploadId, Is.Not.Null.Or.Empty); - return _uploadId; - } + List batchCompletions = GetVerifiedBatchOutputsOf( + batchOutputBytes, + ["request-1", "request-2"]); - public async Task DownloadAndValidateResultAsync(string outputId) + foreach (ChatCompletion batchCompletion in batchCompletions) { - ClientResult response = await _fileClient.DownloadFileAsync(outputId); - Assert.That(response, Is.Not.Null); - Assert.That(response.Value, Is.Not.Null); - return response.Value; + Assert.That(batchCompletion, Is.Not.Null); + Assert.That(batchCompletion.Role, Is.EqualTo(ChatMessageRole.Assistant)); + Assert.That(batchCompletion.Content, Has.Count.EqualTo(1)); + Assert.That(batchCompletion.Content[0].Kind, Is.EqualTo(ChatMessageContentPartKind.Text)); + Assert.That(batchCompletion.Content[0].Text, Is.Not.Null.Or.Empty); } + } - public async ValueTask DisposeAsync() - { - // clean up any files - if (_uploadId != null) - { - await _fileClient.DeleteFileAsync(_uploadId); - } + private List GetVerifiedBatchOutputsOf( + BinaryData downloadBytes, + IList expectedCustomIds) + where T : IJsonModel + { + using Stream outputStream = downloadBytes.ToStream(); + using StreamReader outputReader = new(outputStream); - _handler.OnRequest -= HandleRequest; - _handler.Dispose(); - _operations.Clear(); - } + List deserializedBodyOutputs = []; - private void HandleRequest(object? sender, CapturedRequest request) + for (string? line = outputReader.ReadLine(); !string.IsNullOrEmpty(line); line = outputReader.ReadLine()) { - JsonElement? element = null; - if (request.Content != null) + string? customId = null; + bool foundNullError = false; + string? requestId = null; + int? statusCode = null; + T? deserializedResponseBody = default; + + using JsonDocument resultDocument = JsonDocument.Parse(line); + foreach (JsonProperty documentProperty in resultDocument.RootElement.EnumerateObject()) { - using var json = JsonDocument.Parse(request.Content.ToMemory()); - element = json.RootElement.Clone(); + if (documentProperty.NameEquals("custom_id"u8)) + { + customId = documentProperty.Value.GetString(); + } + if (documentProperty.NameEquals("error"u8)) + { + Assert.IsTrue(documentProperty.Value.ValueKind == JsonValueKind.Null); + foundNullError = true; + } + if (documentProperty.NameEquals("response"u8)) + { + foreach (JsonProperty responseProperty in documentProperty.Value.EnumerateObject()) + { + if (responseProperty.NameEquals("request_id"u8)) + { + requestId = responseProperty.Value.GetString(); + } + if (responseProperty.NameEquals("status_code"u8)) + { + statusCode = responseProperty.Value.GetInt32(); + } + if (responseProperty.NameEquals("body"u8)) + { + BinaryData responseBodyBytes = BinaryData.FromObjectAsJson(responseProperty.Value); + deserializedResponseBody = ModelReaderWriter.Read(responseBodyBytes); + } + } + } } - - BatchOperation operation = new() + Assert.That(customId, Is.Not.Null.And.Not.Empty); + if (expectedCustomIds is not null) { - Method = request.Method, - Url = request.Uri?.AbsolutePath ?? string.Empty, - Body = element - }; - - _operations.Add(operation); + Assert.That(expectedCustomIds.Any(expectedId => expectedId == customId)); + } + Assert.True(foundNullError); + Assert.That(requestId, Is.Not.Null.And.Not.Empty); + Assert.That(statusCode, Is.EqualTo(200)); + Assert.That(deserializedResponseBody, Is.Not.Null); + deserializedBodyOutputs.Add(deserializedResponseBody!); } - - public class BatchOperation + if (expectedCustomIds is not null) { - public string CustomId { get; } = Guid.NewGuid().ToString(); - public HttpMethod Method { get; init; } = HttpMethod.Get; - public string Url { get; init; } = string.Empty; - public JsonElement? Body { get; init; } + Assert.That(deserializedBodyOutputs, Has.Count.EqualTo(expectedCustomIds.Count)); } + return deserializedBodyOutputs; } - - #endregion } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs index 83105dd0dddb..3f3d7486cd12 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs @@ -142,7 +142,6 @@ public void DataSourceSerializationWorks() Assert.That(sourcesFromOptions[1], Is.InstanceOf()); } -#if !AZURE_OPENAI_GA [Test] [Category("Smoke")] public async Task MaxTokensSerializationConfigurationWorks() @@ -203,7 +202,6 @@ async Task AssertExpectedSerializationAsync(bool hasOldMaxTokens, bool hasNewMax options.MaxOutputTokenCount = 42; await AssertExpectedSerializationAsync(true, false); } -#endif [RecordedTest] public async Task ChatCompletionBadKeyGivesHelpfulError() diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs index 01eaefcc0ba5..e489f1922714 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ConversationProtocolTests.cs @@ -9,6 +9,8 @@ namespace Azure.AI.OpenAI.Tests; +#if !AZURE_OPENAI_GA + #nullable disable #pragma warning disable OPENAI002 @@ -81,3 +83,5 @@ public async Task ProtocolCanConfigureSession() } #endif } + +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ConversationSmokeTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ConversationSmokeTests.cs index a3a319435713..b0d59ac6a2bd 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ConversationSmokeTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ConversationSmokeTests.cs @@ -9,6 +9,7 @@ namespace Azure.AI.OpenAI.Tests; #nullable disable #pragma warning disable OPENAI002 +#if !AZURE_OPENAI_GA [TestFixture(false)] [Category("Smoke")] public class ConversationSmokeTests : ConversationTestFixtureBase @@ -183,3 +184,4 @@ public void UnknownCommandSerializationWorks() Assert.That(deserializedUpdate, Is.Not.Null); } } +#endif \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs index 89cbeda0c686..d9ecf1b2fa2b 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ConversationTests.cs @@ -21,6 +21,7 @@ public class ConversationTests : ConversationTestFixtureBase public ConversationTests(bool isAsync) : base(isAsync) { } +#if !AZURE_OPENAI_GA [Test] public async Task CanConfigureSession() { @@ -415,4 +416,12 @@ await session.SendCommandAsync( Assert.That(gotErrorUpdate, Is.True); } +#else + [Test] + [Category("Smoke")] + public void VersionNotSupportedThrows() + { + Assert.Throws(() => GetTestClient()); + } +#endif } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs index d42450363f2e..710405889b3c 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs @@ -13,8 +13,6 @@ public class FileTests : AoaiTestBase public FileTests(bool isAsync) : base(isAsync) { } -#if !AZURE_OPENAI_GA - [Test] [Category("Smoke")] public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); @@ -40,15 +38,4 @@ public async Task CanListFiles() OpenAIFileCollection files = await client.GetFilesAsync(); Assert.That(files, Has.Count.GreaterThan(0)); } - -#else - - [Test] - [SyncOnly] - public void UnsupportedVersionFileClientThrows() - { - Assert.Throws(() => GetTestClient()); - } - -#endif } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs deleted file mode 100644 index 9d36d8d1884a..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.Json; -using Azure.AI.OpenAI.Tests.Utils; - -namespace Azure.AI.OpenAI.Tests.Models; - -public class BatchResult -{ - public string? ID { get; init; } - public string? CustomId { get; init; } - public T? Response { get; init; } - public JsonElement? Error { get; init; } - - public static IReadOnlyList> From(BinaryData data) - { - List> list = new(); - using var reader = new StreamReader(data.ToStream(), Encoding.UTF8, false); - string? line; - while ((line = reader.ReadLine()) != null) - { - if (string.IsNullOrWhiteSpace(line)) - { - break; - } - - var entry = JsonSerializer.Deserialize>(line, JsonOptions.OpenAIJsonOptions); - if (entry != null) - { - list.Add(entry); - } - } - - return list; - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs index ec8da9616db1..5953cd41870a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs @@ -43,7 +43,8 @@ public void UseAzureGovernment() }; AzureOpenAIClient azureClient = new( new Uri("https://your-azure-openai-resource.com"), - new DefaultAzureCredential()); + new DefaultAzureCredential(), + options); ChatClient chatClient = azureClient.GetChatClient("my-gpt-4o-mini-deployment"); #endregion } @@ -58,8 +59,9 @@ public void UseCustomAuthorizationScope() #endregion AzureOpenAIClient azureClient = new( - new Uri("https://your-azure-openai-resource.com"), - new DefaultAzureCredential()); - ChatClient chatClient = azureClient.GetChatClient("my-gpt-4o-mini-deployment"); + new Uri("https://your-azure-openai-resource.com"), + new DefaultAzureCredential(), + optionsWithCustomAudience); + ChatClient chatClient = azureClient.GetChatClient("my-gpt-4o-mini-deployment"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs index deb66b7efda2..6a3b3118e6c5 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs @@ -389,7 +389,7 @@ protected virtual TExplicitClient GetTestClient(AzureOpenAIClie clientObject = topLevelClient.GetAudioClient(getDeployment()); break; case nameof(BatchClient): - clientObject = topLevelClient.GetBatchClient(getDeployment()); + clientObject = topLevelClient.GetBatchClient(); break; case nameof(ChatClient): clientObject = topLevelClient.GetChatClient(getDeployment()); @@ -574,6 +574,9 @@ protected void ValidateById(string id) case nameof(VectorStore): _vectorStoreIdsToDelete.Add(id); break; + case nameof(CreateBatchOperation): + _batchIdsToDelete.Add(id); + break; default: throw new NotImplementedException(); } @@ -622,6 +625,7 @@ protected void Validate(T target) OpenAIFile file => file.Id, ThreadRun run => run.Id, VectorStore store => store.Id, + CreateBatchOperation batchOperation => batchOperation.BatchId, _ => throw new NotImplementedException(), }); } @@ -637,7 +641,6 @@ protected void Cleanup() }); RequestOptions requestOptions = new() { ErrorOptions = ClientErrorBehaviors.NoThrow, }; -#if !AZURE_OPENAI_GA OpenAIFileClient fileClient = topLevelCleanupClient.GetOpenAIFileClient(); foreach (string fileId in _fileIdsToDelete) { @@ -645,6 +648,13 @@ protected void Cleanup() } _fileIdsToDelete.Clear(); + BatchClient batchClient = topLevelCleanupClient.GetBatchClient(); + foreach (string batchId in _batchIdsToDelete) + { + // No delete currently exists + } + +#if !AZURE_OPENAI_GA AssistantClient client = topLevelCleanupClient.GetAssistantClient(); VectorStoreClient vectorStoreClient = topLevelCleanupClient.GetVectorStoreClient(); foreach ((string threadId, string messageId) in _threadIdsWithMessageIdsToDelete) @@ -735,6 +745,7 @@ internal class TopLevelInfo private readonly List _fileIdsToDelete = []; private readonly List<(string, string)> _vectorStoreFileAssociationsToRemove = []; private readonly List _vectorStoreIdsToDelete = []; + private readonly List _batchIdsToDelete = []; } public class TestClientOptions : AzureOpenAIClientOptions diff --git a/sdk/openai/ci.yml b/sdk/openai/ci.yml index 62e6f4b87040..2956b8ed6c95 100644 --- a/sdk/openai/ci.yml +++ b/sdk/openai/ci.yml @@ -11,7 +11,6 @@ trigger: - sdk/openai - sdk/openai/ci.yml - sdk/openai/Azure.AI.OpenAI - - sdk/openai/Azure.AI.OpenAI.Assistants pr: branches: @@ -25,7 +24,6 @@ pr: - sdk/openai - sdk/openai/ci.yml - sdk/openai/Azure.AI.OpenAI - - sdk/openai/Azure.AI.OpenAI.Assistants extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -37,6 +35,4 @@ extends: ArtifactName: packages Artifacts: - name: Azure.AI.OpenAI - safeName: AzureAIOpenAI - - name: Azure.AI.OpenAI.Assistants - safeName: AzureAIOpenAIAssistants + safeName: AzureAIOpenAI \ No newline at end of file diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs index 5f1dae205813..47a863e25491 100644 --- a/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs @@ -36,7 +36,13 @@ public MockAsyncCollectionResult(Func> enumerateAsyncFu /// public override ContinuationToken? GetContinuationToken(ClientResult page) { - var parsed = MockPage.FromClientResult(page); + MockPage? parsed = MockPage.FromClientResult(page); + + if (parsed == null) + { + return null; + } + string token = parsed.Next.ToString(CultureInfo.InvariantCulture); return ContinuationToken.FromBytes(BinaryData.FromString(token)); } @@ -75,5 +81,5 @@ public override async IAsyncEnumerable GetRawPagesAsync() /// protected override IAsyncEnumerable GetValuesFromPageAsync(ClientResult page) - => new SyncToAsyncEnumerable(MockPage.FromClientResult(page).Values); + => new SyncToAsyncEnumerable(MockPage.FromClientResult(page)?.Values ?? []); } diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs index 49b11923b67e..73c900f2e270 100644 --- a/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs @@ -66,13 +66,19 @@ public override IEnumerable GetRawPages() /// public override ContinuationToken? GetContinuationToken(ClientResult page) { - var parsed = MockPage.FromClientResult(page); + MockPage? parsed = MockPage.FromClientResult(page); + + if (parsed == null) + { + return null; + } + string token = parsed.Next.ToString(CultureInfo.InvariantCulture); return ContinuationToken.FromBytes(BinaryData.FromString(token)); } /// protected override IEnumerable GetValuesFromPage(ClientResult page) - => MockPage.FromClientResult(page).Values; + => MockPage.FromClientResult(page)?.Values ?? []; } } diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockPage.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockPage.cs index 9d9ff8cbf0e3..5c5f6f25234c 100644 --- a/sdk/openai/tools/TestFramework/src/Mocks/MockPage.cs +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockPage.cs @@ -27,7 +27,7 @@ public class MockPage /// /// The client result. /// The created instance. - public static MockPage FromClientResult(ClientResult result) + public static MockPage? FromClientResult(ClientResult result) { PipelineResponse response = result.GetRawResponse(); response.BufferContent(); diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs index 53cc2c177c9c..124892d349aa 100644 --- a/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs @@ -14,7 +14,7 @@ namespace OpenAI.TestFramework.Mocks; /// A client for . /// /// The type of data used by the client. -public class MockRestServiceClient : IDisposable +public class MockRestServiceClient : IDisposable where TData : class { private ClientPipeline _pipeline; private Uri _baseUri; @@ -87,18 +87,16 @@ public virtual ClientResult Add(string id, TData data, CancellationToken token = ClientResult result = await SendSyncOrAsync(true, HttpMethod.Get, id, default, token) .ConfigureAwait(false); - var response = result.GetRawResponse(); - var entry = response.Content.ToObjectFromJson.Entry>(); - var entryData = entry == null ? default : entry.data; + PipelineResponse response = result.GetRawResponse(); return ClientResult.FromOptionalValue( - entryData, + response.Content?.ToObjectFromJson.Entry>()?.data, response); } catch (ClientResultException ex) { if (ex.GetRawResponse()?.Status == 404) { - return ClientResult.FromOptionalValue(default, ex.GetRawResponse()!); + return ClientResult.FromOptionalValue(default, ex.GetRawResponse()!); } throw; @@ -119,11 +117,9 @@ public virtual ClientResult Add(string id, TData data, CancellationToken token = try { ClientResult result = SendSyncOrAsync(false, HttpMethod.Get, id, default, token).GetAwaiter().GetResult(); - var response = result.GetRawResponse(); - var entry = response.Content.ToObjectFromJson.Entry>(); - var entryData = entry == null ? default : entry.data; + PipelineResponse response = result.GetRawResponse(); return ClientResult.FromOptionalValue( - entryData, + response.Content?.ToObjectFromJson.Entry>()?.data, response); } catch (ClientResultException ex) diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/CHANGELOG.md b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/CHANGELOG.md index 7f19e5822dfa..37bdc3a7c7b3 100644 --- a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/CHANGELOG.md +++ b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/README.md b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/README.md index 92bec25517d9..27a93efb2e23 100644 --- a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/README.md +++ b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/CHANGELOG.md b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/CHANGELOG.md index a06cc33191a3..97d3e0e51679 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/CHANGELOG.md +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/CHANGELOG.md @@ -81,7 +81,7 @@ Polishing since last public beta release: - Prepended `OperationalInsights` prefix to all single / simple model names. - Corrected the format of all `Guid` type properties / parameters. - Corrected the format of all `ResourceIdentifier` type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -108,4 +108,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/README.md b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/README.md index 50c40a4b094b..badb1901f0a3 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/README.md +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/CHANGELOG.md b/sdk/oracle/Azure.ResourceManager.OracleDatabase/CHANGELOG.md index e92161c186da..0b218b4cc4be 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/CHANGELOG.md +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/CHANGELOG.md @@ -32,4 +32,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/README.md b/sdk/oracle/Azure.ResourceManager.OracleDatabase/README.md index 2b5564d6a971..090af1befd10 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/README.md +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/README.md @@ -38,7 +38,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/CHANGELOG.md b/sdk/orbital/Azure.ResourceManager.Orbital/CHANGELOG.md index a6b85c11032c..0f693660e0fd 100644 --- a/sdk/orbital/Azure.ResourceManager.Orbital/CHANGELOG.md +++ b/sdk/orbital/Azure.ResourceManager.Orbital/CHANGELOG.md @@ -59,8 +59,8 @@ Polishing since last public beta release: - Corrected the format of all `IPAddress` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -88,4 +88,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/README.md b/sdk/orbital/Azure.ResourceManager.Orbital/README.md index 7797b6311f17..070dc630cfdc 100644 --- a/sdk/orbital/Azure.ResourceManager.Orbital/README.md +++ b/sdk/orbital/Azure.ResourceManager.Orbital/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/CHANGELOG.md b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/CHANGELOG.md index 040a11c6f110..6d7c9b0a39df 100644 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/CHANGELOG.md +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/CHANGELOG.md @@ -43,8 +43,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -65,4 +65,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/README.md b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/README.md index 90748ddbec89..1def01792f0e 100644 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/README.md +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/peering/Azure.ResourceManager.Peering/CHANGELOG.md b/sdk/peering/Azure.ResourceManager.Peering/CHANGELOG.md index bc6fc4c8bdb0..f56fdb3d987c 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/CHANGELOG.md +++ b/sdk/peering/Azure.ResourceManager.Peering/CHANGELOG.md @@ -99,4 +99,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/peering/Azure.ResourceManager.Peering/README.md b/sdk/peering/Azure.ResourceManager.Peering/README.md index 0abecb6ebfa8..4890e575a5c2 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/README.md +++ b/sdk/peering/Azure.ResourceManager.Peering/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/personalizer/Azure.AI.Personalizer/CHANGELOG.md b/sdk/personalizer/Azure.AI.Personalizer/CHANGELOG.md index 225dd068465d..f94bedba0992 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/CHANGELOG.md +++ b/sdk/personalizer/Azure.AI.Personalizer/CHANGELOG.md @@ -24,10 +24,10 @@ ## 2.0.0-beta.1 (2021-10-05) ### Features Added -- Initial Release of Azure AI [Personalizer cognitive service](https://docs.microsoft.com/azure/cognitive-services/personalizer/) version 2.0.0-beta.1 SDK. +- Initial Release of Azure AI [Personalizer cognitive service](https://learn.microsoft.com/azure/cognitive-services/personalizer/) version 2.0.0-beta.1 SDK. - This is a new release of the Azure AI Personalizer SDK that follows the Azure SDK guidelines, so the structure is a little different from the old SDK. -- [Multi-Slot personalization](https://docs.microsoft.com/azure/cognitive-services/personalizer/how-to-multi-slot?pivots=programming-language-csharp) -- [Personalizer Automatic Optimization](https://docs.microsoft.com/azure/cognitive-services/personalizer/concept-auto-optimization) +- [Multi-Slot personalization](https://learn.microsoft.com/azure/cognitive-services/personalizer/how-to-multi-slot?pivots=programming-language-csharp) +- [Personalizer Automatic Optimization](https://learn.microsoft.com/azure/cognitive-services/personalizer/concept-auto-optimization) - Support Azure Active Directory Authentication. - New overloads for `Rank`, `Reward` and the `PersonalizerClient` constructor. diff --git a/sdk/personalizer/Azure.AI.Personalizer/README.md b/sdk/personalizer/Azure.AI.Personalizer/README.md index 18836f6e2edd..a5d5af276e7f 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/README.md +++ b/sdk/personalizer/Azure.AI.Personalizer/README.md @@ -1,6 +1,6 @@ # Azure Personalizer client library for .NET -[Azure Personalizer](https://docs.microsoft.com/azure/cognitive-services/personalizer/) +[Azure Personalizer](https://learn.microsoft.com/azure/cognitive-services/personalizer/) is a cloud-based service that helps your applications choose the best content item to show your users. You can use the Personalizer service to determine what product to suggest to shoppers or to figure out the optimal position for an advertisement. After the content is shown to the user, your application monitors the user's reaction and reports a reward score back to the Personalizer service. This ensures continuous improvement of the machine learning model, and Personalizer's ability to select the best content item based on the contextual information it receives. ## Getting started diff --git a/sdk/personalizer/README.md b/sdk/personalizer/README.md index e4341eb2923f..06412036047f 100644 --- a/sdk/personalizer/README.md +++ b/sdk/personalizer/README.md @@ -1,6 +1,6 @@ # Azure Personalizer client library for .NET -[Azure Personalizer](https://docs.microsoft.com/azure/cognitive-services/personalizer/) +[Azure Personalizer](https://learn.microsoft.com/azure/cognitive-services/personalizer/) is a cloud-based service that helps your applications choose the best content item to show your users. You can use the Personalizer service to determine what product to suggest to shoppers or to figure out the optimal position for an advertisement. After the content is shown to the user, your application monitors the user's reaction and reports a reward score back to the Personalizer service. This ensures continuous improvement of the machine learning model, and Personalizer's ability to select the best content item based on the contextual information it receives. ## Getting started diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/CHANGELOG.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/CHANGELOG.md index 81b7928acb0a..002134afdd8d 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/CHANGELOG.md +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes +## 1.0.0-beta.4 (2024-12-13) ### Bugs Fixed -### Other Changes +- Fixed a bug where upload results were incomplete for large size classname suites. ## 1.0.0-beta.3 (2024-11-18) diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md index 00e7a2426487..c490d6113ff8 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/CHANGELOG.md @@ -1,14 +1,11 @@ # Release History -## 1.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes +## 1.0.0-beta.4 (2024-12-13) ### Bugs Fixed -### Other Changes +- Fixed a bug where upload results were incomplete for large size classname suites. + ## 1.0.0-beta.3 (2024-11-18) diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs index e1e135158fea..85254f869261 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs @@ -67,7 +67,7 @@ public TestRunDto GetTestRun() TestType = "WebTest", TestSdkLanguage = "CSHARP", TestFramework = new TestFramework() { Name = "PLAYWRIGHT", RunnerName = "NUNIT", Version = "3.1" }, // TODO fetch runner name MSTest/Nunit - ReporterPackageVersion = "1.0.0-beta.3", + ReporterPackageVersion = "1.0.0-beta.4", Shards = new Shard() { Total = 1 } } }; @@ -107,7 +107,7 @@ public TestResults GetTestCaseResultData(TestResult? testResultSource) testCaseResultData.TestTitle = testResultSource.TestCase.DisplayName; var className = FetchTestClassName(testResultSource.TestCase.FullyQualifiedName); testCaseResultData.SuiteTitle = className; - testCaseResultData.SuiteId = className; + testCaseResultData.SuiteId = ReporterUtils.CalculateSha1Hash(className); testCaseResultData.FileName = FetchFileName(testResultSource.TestCase.Source); testCaseResultData.LineNumber = testResultSource.TestCase.LineNumber; testCaseResultData.Retry = 0; // TODO Retry and PreviousRetries diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs index 75fc38eb7a35..95f15ade3051 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs @@ -65,7 +65,7 @@ public void GetTestRun_ReturnsTestRunDto() Assert.AreEqual("PLAYWRIGHT", result.TestRunConfig!.TestFramework!.Name); Assert.AreEqual("NUNIT", result.TestRunConfig!.TestFramework!.RunnerName); Assert.AreEqual("3.1", result.TestRunConfig!.TestFramework!.Version); - Assert.AreEqual("1.0.0-beta.3", result.TestRunConfig!.ReporterPackageVersion); + Assert.AreEqual("1.0.0-beta.4", result.TestRunConfig!.ReporterPackageVersion); Assert.IsNotNull(result.TestRunConfig!.Shards); Assert.AreEqual(1, result.TestRunConfig!.Shards!.Total); } @@ -165,7 +165,7 @@ public void GetTestCaseResultData_WithNonNullTestResult_ReturnsTestResults() Assert.IsNotNull(result.TestId); Assert.AreEqual(testResult.TestCase.DisplayName, result.TestTitle); Assert.AreEqual("Test", result.SuiteTitle); - Assert.AreEqual("Test", result.SuiteId); + Assert.AreEqual(ReporterUtils.CalculateSha1Hash("Test"), result.SuiteId); Assert.AreEqual("TestNamespace.TestClass", result.FileName); Assert.AreEqual(testResult.TestCase.LineNumber, result.LineNumber); Assert.AreEqual(0, result.Retry); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/CHANGELOG.md b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/CHANGELOG.md index 661c97bb5970..2b8b031e7c9a 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/CHANGELOG.md +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/CHANGELOG.md @@ -1,17 +1,22 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.1.0-beta.1 (Unreleased) ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. - ### Breaking Changes ### Bugs Fixed ### Other Changes +## 1.0.0 (2024-12-18) + +### Features Added + +- Upgraded api-version from '2023-10-01-preview' to '2024-12-01'. Spec detail available at https://github.com/Azure/azure-rest-api-specs/tree/c39acac0b3b7ceeee03b594a7b49c9bad6b8e9f2/specification/playwrighttesting/PlaywrightTesting.Management. +- Exposed `JsonModelWriteCore` for model serialization procedure. + ## 1.0.0-beta.1 (2024-01-19) ### General New Features @@ -26,4 +31,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/README.md b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/README.md index 3c67c0a28c37..27fbef65ae09 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/README.md +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/README.md @@ -17,7 +17,7 @@ This library follows the [new Azure SDK guidelines](https://azure.github.io/azur Install the Microsoft Azure Playwright Testing management library for .NET with [NuGet](https://www.nuget.org/): ```dotnetcli -dotnet add package Azure.ResourceManager.PlaywrightTesting --prerelease +dotnet add package Azure.ResourceManager.PlaywrightTesting ``` ### Prerequisites @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.net8.0.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.net8.0.cs index 2f7e09b19bef..8bae8011d56b 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.net8.0.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.net8.0.cs @@ -3,16 +3,16 @@ namespace Azure.ResourceManager.PlaywrightTesting public partial class PlaywrightTestingAccountCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected PlaywrightTestingAccountCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string accountName, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string accountName, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } @@ -20,11 +20,7 @@ protected PlaywrightTestingAccountCollection() { } public partial class PlaywrightTestingAccountData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PlaywrightTestingAccountData(Azure.Core.AzureLocation location) { } - public System.Uri DashboardUri { get { throw null; } } - public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? RegionalAffinity { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? Reporting { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? ScalableExecution { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -32,6 +28,47 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PlaywrightTestingAccountQuotaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PlaywrightTestingAccountQuotaCollection() { } + public virtual Azure.Response Exists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PlaywrightTestingAccountQuotaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingAccountQuotaData() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountQuotaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PlaywrightTestingAccountQuotaResource() { } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class PlaywrightTestingAccountResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -40,11 +77,14 @@ protected PlaywrightTestingAccountResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaCollection GetAllPlaywrightTestingAccountQuota() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPlaywrightTestingAccountQuota(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlaywrightTestingAccountQuotaAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -59,37 +99,39 @@ protected PlaywrightTestingAccountResource() { } } public static partial class PlaywrightTestingExtensions { - public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location) { throw null; } - public static Azure.Response GetPlaywrightTestingAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CheckPlaywrightTestingNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckPlaywrightTestingNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string location) { throw null; } + public static Azure.Response GetPlaywrightTestingAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaResource GetPlaywrightTestingAccountQuotaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountResource GetPlaywrightTestingAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetPlaywrightTestingAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetPlaywrightTestingAccountsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaResource GetPlaywrightTestingQuotaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class PlaywrightTestingQuotaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected PlaywrightTestingQuotaCollection() { } - public virtual Azure.Response Exists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } public partial class PlaywrightTestingQuotaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public PlaywrightTestingQuotaData() { } - public Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties FreeTrial { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + internal PlaywrightTestingQuotaData() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties Properties { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -103,7 +145,7 @@ public partial class PlaywrightTestingQuotaResource : Azure.ResourceManager.ArmR protected PlaywrightTestingQuotaResource() { } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -118,99 +160,224 @@ namespace Azure.ResourceManager.PlaywrightTesting.Mocking public partial class MockablePlaywrightTestingArmClient : Azure.ResourceManager.ArmResource { protected MockablePlaywrightTestingArmClient() { } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaResource GetPlaywrightTestingAccountQuotaResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountResource GetPlaywrightTestingAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaResource GetPlaywrightTestingQuotaResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockablePlaywrightTestingResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockablePlaywrightTestingResourceGroupResource() { } - public virtual Azure.Response GetPlaywrightTestingAccount(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPlaywrightTestingAccount(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts() { throw null; } } public partial class MockablePlaywrightTestingSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockablePlaywrightTestingSubscriptionResource() { } - public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(Azure.Core.AzureLocation location) { throw null; } + public virtual Azure.Response CheckPlaywrightTestingNameAvailability(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckPlaywrightTestingNameAvailabilityAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(string location) { throw null; } public virtual Azure.Pageable GetPlaywrightTestingAccounts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPlaywrightTestingAccountsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetPlaywrightTestingQuota(Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPlaywrightTestingQuota(string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.PlaywrightTesting.Models { + public partial class AccountUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccountUpdateProperties() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? LocalAuth { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? RegionalAffinity { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? Reporting { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? ScalableExecution { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.AccountUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.AccountUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmPlaywrightTestingModelFactory { - public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData PlaywrightTestingAccountData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Uri dashboardUri = null, Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? regionalAffinity = default(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? scalableExecution = default(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? reporting = default(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } - public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData PlaywrightTestingQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties freeTrial = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData PlaywrightTestingAccountData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties properties = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties PlaywrightTestingAccountFreeTrialProperties(System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset expiryOn = default(System.DateTimeOffset), int allocatedValue = 0, int usedValue = 0, float percentageUsed = 0f) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties PlaywrightTestingAccountProperties(System.Uri dashboardUri = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? regionalAffinity = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? scalableExecution = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? reporting = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? localAuth = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData PlaywrightTestingAccountQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties properties = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties PlaywrightTestingAccountQuotaProperties(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties freeTrial = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties PlaywrightTestingFreeTrialProperties(string accountId = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState state = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityResult PlaywrightTestingNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason? reason = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason?), string message = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData PlaywrightTestingQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties properties = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties PlaywrightTestingQuotaProperties(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties freeTrial = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType? offeringType = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + } + public partial class PlaywrightTestingAccountFreeTrialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingAccountFreeTrialProperties() { } + public int AllocatedValue { get { throw null; } } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public System.DateTimeOffset ExpiryOn { get { throw null; } } + public float PercentageUsed { get { throw null; } } + public int UsedValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlaywrightTestingAccountPatch() { } + public Azure.ResourceManager.PlaywrightTesting.Models.AccountUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlaywrightTestingAccountProperties() { } + public System.Uri DashboardUri { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? LocalAuth { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? RegionalAffinity { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? Reporting { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? ScalableExecution { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountQuotaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingAccountQuotaProperties() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties FreeTrial { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EnablementStatus : System.IEquatable + public readonly partial struct PlaywrightTestingEnablementStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EnablementStatus(string value) { throw null; } - public static Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus Disabled { get { throw null; } } - public static Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus other) { throw null; } + public PlaywrightTestingEnablementStatus(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus 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.ResourceManager.PlaywrightTesting.Models.EnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus right) { throw null; } - public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class FreeTrialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlaywrightTestingFreeTrialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public FreeTrialProperties(string accountId, System.DateTimeOffset createdOn, System.DateTimeOffset expiryOn, int allocatedValue, int usedValue, decimal percentageUsed, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState state) { } + internal PlaywrightTestingFreeTrialProperties() { } public string AccountId { get { throw null; } } - public int AllocatedValue { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public System.DateTimeOffset ExpiryOn { get { throw null; } } - public decimal PercentageUsed { get { throw null; } } - public Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState State { get { throw null; } } - public int UsedValue { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState State { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct FreeTrialState : System.IEquatable + public readonly partial struct PlaywrightTestingFreeTrialState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public FreeTrialState(string value) { throw null; } - public static Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState Active { get { throw null; } } - public static Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState Expired { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState other) { throw null; } + public PlaywrightTestingFreeTrialState(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState Active { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState Expired { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState NotEligible { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState NotRegistered { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState 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.ResourceManager.PlaywrightTesting.Models.FreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState right) { throw null; } - public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState right) { throw null; } public override string ToString() { throw null; } } - public partial class PlaywrightTestingAccountPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlaywrightTestingNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public PlaywrightTestingAccountPatch() { } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? RegionalAffinity { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? Reporting { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? ScalableExecution { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public PlaywrightTestingNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public string Type { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingNameAvailabilityResult() { } + public bool? IsNameAvailable { get { throw null; } } + public string Message { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason? Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PlaywrightTestingNameUnavailableReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PlaywrightTestingNameUnavailableReason(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason 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.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PlaywrightTestingOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PlaywrightTestingOfferingType(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType GeneralAvailability { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType NotApplicable { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType PrivatePreview { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType PublicPreview { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType 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.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PlaywrightTestingProvisioningState : System.IEquatable @@ -220,6 +387,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public PlaywrightTestingProvisioningState(string value) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Accepted { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Creating { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Failed { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Succeeded { get { throw null; } } @@ -239,6 +407,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public PlaywrightTestingQuotaName(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName Reporting { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName ScalableExecution { get { throw null; } } public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -250,4 +419,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName right) { throw null; } public override string ToString() { throw null; } } + public partial class PlaywrightTestingQuotaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingQuotaProperties() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties FreeTrial { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType? OfferingType { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.netstandard2.0.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.netstandard2.0.cs index 2f7e09b19bef..8bae8011d56b 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.netstandard2.0.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/api/Azure.ResourceManager.PlaywrightTesting.netstandard2.0.cs @@ -3,16 +3,16 @@ namespace Azure.ResourceManager.PlaywrightTesting public partial class PlaywrightTestingAccountCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected PlaywrightTestingAccountCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string accountName, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string accountName, Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } @@ -20,11 +20,7 @@ protected PlaywrightTestingAccountCollection() { } public partial class PlaywrightTestingAccountData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PlaywrightTestingAccountData(Azure.Core.AzureLocation location) { } - public System.Uri DashboardUri { get { throw null; } } - public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? RegionalAffinity { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? Reporting { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? ScalableExecution { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -32,6 +28,47 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PlaywrightTestingAccountQuotaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PlaywrightTestingAccountQuotaCollection() { } + public virtual Azure.Response Exists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PlaywrightTestingAccountQuotaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingAccountQuotaData() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountQuotaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PlaywrightTestingAccountQuotaResource() { } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class PlaywrightTestingAccountResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -40,11 +77,14 @@ protected PlaywrightTestingAccountResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaCollection GetAllPlaywrightTestingAccountQuota() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPlaywrightTestingAccountQuota(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlaywrightTestingAccountQuotaAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -59,37 +99,39 @@ protected PlaywrightTestingAccountResource() { } } public static partial class PlaywrightTestingExtensions { - public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location) { throw null; } - public static Azure.Response GetPlaywrightTestingAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response CheckPlaywrightTestingNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckPlaywrightTestingNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string location) { throw null; } + public static Azure.Response GetPlaywrightTestingAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaResource GetPlaywrightTestingAccountQuotaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountResource GetPlaywrightTestingAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetPlaywrightTestingAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetPlaywrightTestingAccountsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetPlaywrightTestingQuota(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaResource GetPlaywrightTestingQuotaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class PlaywrightTestingQuotaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected PlaywrightTestingQuotaCollection() { } - public virtual Azure.Response Exists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } public partial class PlaywrightTestingQuotaData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public PlaywrightTestingQuotaData() { } - public Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties FreeTrial { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + internal PlaywrightTestingQuotaData() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties Properties { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -103,7 +145,7 @@ public partial class PlaywrightTestingQuotaResource : Azure.ResourceManager.ArmR protected PlaywrightTestingQuotaResource() { } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -118,99 +160,224 @@ namespace Azure.ResourceManager.PlaywrightTesting.Mocking public partial class MockablePlaywrightTestingArmClient : Azure.ResourceManager.ArmResource { protected MockablePlaywrightTestingArmClient() { } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaResource GetPlaywrightTestingAccountQuotaResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountResource GetPlaywrightTestingAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaResource GetPlaywrightTestingQuotaResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockablePlaywrightTestingResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockablePlaywrightTestingResourceGroupResource() { } - public virtual Azure.Response GetPlaywrightTestingAccount(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPlaywrightTestingAccount(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlaywrightTestingAccountAsync(string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts() { throw null; } } public partial class MockablePlaywrightTestingSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockablePlaywrightTestingSubscriptionResource() { } - public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(Azure.Core.AzureLocation location) { throw null; } + public virtual Azure.Response CheckPlaywrightTestingNameAvailability(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckPlaywrightTestingNameAvailabilityAsync(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(string location) { throw null; } public virtual Azure.Pageable GetPlaywrightTestingAccounts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPlaywrightTestingAccountsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetPlaywrightTestingQuota(Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPlaywrightTestingQuota(string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlaywrightTestingQuotaAsync(string location, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName quotaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.PlaywrightTesting.Models { + public partial class AccountUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccountUpdateProperties() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? LocalAuth { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? RegionalAffinity { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? Reporting { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? ScalableExecution { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.AccountUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.AccountUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmPlaywrightTestingModelFactory { - public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData PlaywrightTestingAccountData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Uri dashboardUri = null, Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? regionalAffinity = default(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? scalableExecution = default(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? reporting = default(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } - public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData PlaywrightTestingQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties freeTrial = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountData PlaywrightTestingAccountData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties properties = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties PlaywrightTestingAccountFreeTrialProperties(System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset expiryOn = default(System.DateTimeOffset), int allocatedValue = 0, int usedValue = 0, float percentageUsed = 0f) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties PlaywrightTestingAccountProperties(System.Uri dashboardUri = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? regionalAffinity = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? scalableExecution = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? reporting = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? localAuth = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingAccountQuotaData PlaywrightTestingAccountQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties properties = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties PlaywrightTestingAccountQuotaProperties(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties freeTrial = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties PlaywrightTestingFreeTrialProperties(string accountId = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState state = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState)) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityResult PlaywrightTestingNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason? reason = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason?), string message = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.PlaywrightTestingQuotaData PlaywrightTestingQuotaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties properties = null) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties PlaywrightTestingQuotaProperties(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties freeTrial = null, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType? offeringType = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType?), Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? provisioningState = default(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState?)) { throw null; } + } + public partial class PlaywrightTestingAccountFreeTrialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingAccountFreeTrialProperties() { } + public int AllocatedValue { get { throw null; } } + public System.DateTimeOffset CreatedOn { get { throw null; } } + public System.DateTimeOffset ExpiryOn { get { throw null; } } + public float PercentageUsed { get { throw null; } } + public int UsedValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlaywrightTestingAccountPatch() { } + public Azure.ResourceManager.PlaywrightTesting.Models.AccountUpdateProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlaywrightTestingAccountProperties() { } + public System.Uri DashboardUri { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? LocalAuth { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? RegionalAffinity { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? Reporting { get { throw null; } set { } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus? ScalableExecution { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingAccountQuotaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingAccountQuotaProperties() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountFreeTrialProperties FreeTrial { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountQuotaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EnablementStatus : System.IEquatable + public readonly partial struct PlaywrightTestingEnablementStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EnablementStatus(string value) { throw null; } - public static Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus Disabled { get { throw null; } } - public static Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus Enabled { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus other) { throw null; } + public PlaywrightTestingEnablementStatus(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus 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.ResourceManager.PlaywrightTesting.Models.EnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus right) { throw null; } - public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingEnablementStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class FreeTrialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlaywrightTestingFreeTrialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public FreeTrialProperties(string accountId, System.DateTimeOffset createdOn, System.DateTimeOffset expiryOn, int allocatedValue, int usedValue, decimal percentageUsed, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState state) { } + internal PlaywrightTestingFreeTrialProperties() { } public string AccountId { get { throw null; } } - public int AllocatedValue { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public System.DateTimeOffset ExpiryOn { get { throw null; } } - public decimal PercentageUsed { get { throw null; } } - public Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState State { get { throw null; } } - public int UsedValue { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState State { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct FreeTrialState : System.IEquatable + public readonly partial struct PlaywrightTestingFreeTrialState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public FreeTrialState(string value) { throw null; } - public static Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState Active { get { throw null; } } - public static Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState Expired { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState other) { throw null; } + public PlaywrightTestingFreeTrialState(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState Active { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState Expired { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState NotEligible { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState NotRegistered { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState 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.ResourceManager.PlaywrightTesting.Models.FreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState right) { throw null; } - public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.FreeTrialState right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialState right) { throw null; } public override string ToString() { throw null; } } - public partial class PlaywrightTestingAccountPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlaywrightTestingNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public PlaywrightTestingAccountPatch() { } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? RegionalAffinity { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? Reporting { get { throw null; } set { } } - public Azure.ResourceManager.PlaywrightTesting.Models.EnablementStatus? ScalableExecution { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public PlaywrightTestingNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public string Type { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingAccountPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlaywrightTestingNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingNameAvailabilityResult() { } + public bool? IsNameAvailable { get { throw null; } } + public string Message { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason? Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PlaywrightTestingNameUnavailableReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PlaywrightTestingNameUnavailableReason(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason 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.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingNameUnavailableReason right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PlaywrightTestingOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PlaywrightTestingOfferingType(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType GeneralAvailability { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType NotApplicable { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType PrivatePreview { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType PublicPreview { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType 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.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PlaywrightTestingProvisioningState : System.IEquatable @@ -220,6 +387,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public PlaywrightTestingProvisioningState(string value) { throw null; } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Accepted { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Creating { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Failed { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState Succeeded { get { throw null; } } @@ -239,6 +407,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public PlaywrightTestingQuotaName(string value) { throw null; } + public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName Reporting { get { throw null; } } public static Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName ScalableExecution { get { throw null; } } public bool Equals(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -250,4 +419,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName left, Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaName right) { throw null; } public override string ToString() { throw null; } } + public partial class PlaywrightTestingQuotaProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PlaywrightTestingQuotaProperties() { } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingFreeTrialProperties FreeTrial { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingOfferingType? OfferingType { get { throw null; } } + public Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlaywrightTesting.Models.PlaywrightTestingQuotaProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/assets.json b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/assets.json index 01e11f27d83a..4974efb3a6a0 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/assets.json +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/playwrighttesting/Azure.ResourceManager.PlaywrightTesting", - "Tag": "net/playwrighttesting/Azure.ResourceManager.PlaywrightTesting_adce24e9e5" + "Tag": "net/playwrighttesting/Azure.ResourceManager.PlaywrightTesting_72bad6017d" } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountCollection.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountCollection.cs index b8d39fa59011..aebbdedd932e 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountCollection.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountCollection.cs @@ -21,8 +21,8 @@ public partial class Sample_PlaywrightTestingAccountCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AccountsCreateOrUpdate() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json - // this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Accounts_CreateOrUpdate.json + // this example is just showing the usage of "Account_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -40,16 +40,19 @@ public async Task CreateOrUpdate_AccountsCreateOrUpdate() PlaywrightTestingAccountCollection collection = resourceGroupResource.GetPlaywrightTestingAccounts(); // invoke the operation - string name = "myPlaywrightAccount"; + string accountName = "myPlaywrightAccount"; PlaywrightTestingAccountData data = new PlaywrightTestingAccountData(new AzureLocation("westus")) { - RegionalAffinity = EnablementStatus.Enabled, + Properties = new PlaywrightTestingAccountProperties + { + RegionalAffinity = PlaywrightTestingEnablementStatus.Enabled, + }, Tags = { ["Team"] = "Dev Exp" }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data); PlaywrightTestingAccountResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well @@ -58,143 +61,5 @@ public async Task CreateOrUpdate_AccountsCreateOrUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_AccountsGet() - { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "dummyrg"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this PlaywrightTestingAccountResource - PlaywrightTestingAccountCollection collection = resourceGroupResource.GetPlaywrightTestingAccounts(); - - // invoke the operation - string name = "myPlaywrightAccount"; - PlaywrightTestingAccountResource result = await collection.GetAsync(name); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - PlaywrightTestingAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_AccountsListByResourceGroup() - { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json - // this example is just showing the usage of "Accounts_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "dummyrg"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this PlaywrightTestingAccountResource - PlaywrightTestingAccountCollection collection = resourceGroupResource.GetPlaywrightTestingAccounts(); - - // invoke the operation and iterate over the result - await foreach (PlaywrightTestingAccountResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - PlaywrightTestingAccountData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_AccountsGet() - { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "dummyrg"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this PlaywrightTestingAccountResource - PlaywrightTestingAccountCollection collection = resourceGroupResource.GetPlaywrightTestingAccounts(); - - // invoke the operation - string name = "myPlaywrightAccount"; - bool result = await collection.ExistsAsync(name); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_AccountsGet() - { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "dummyrg"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this PlaywrightTestingAccountResource - PlaywrightTestingAccountCollection collection = resourceGroupResource.GetPlaywrightTestingAccounts(); - - // invoke the operation - string name = "myPlaywrightAccount"; - NullableResponse response = await collection.GetIfExistsAsync(name); - PlaywrightTestingAccountResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - PlaywrightTestingAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountQuotaCollection.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountQuotaCollection.cs new file mode 100644 index 000000000000..48997baf2881 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountQuotaCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.PlaywrightTesting.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlaywrightTesting.Samples +{ + public partial class Sample_PlaywrightTestingAccountQuotaCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AccountQuotasGet() + { + // Generated from example definition: 2024-12-01/AccountQuotas_Get.json + // this example is just showing the usage of "AccountQuota_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PlaywrightTestingAccountResource created on azure + // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "dummyrg"; + string accountName = "myPlaywrightAccount"; + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); + + // get the collection of this PlaywrightTestingAccountQuotaResource + PlaywrightTestingAccountQuotaCollection collection = playwrightTestingAccount.GetAllPlaywrightTestingAccountQuota(); + + // invoke the operation + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + PlaywrightTestingAccountQuotaResource result = await collection.GetAsync(quotaName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PlaywrightTestingAccountQuotaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AccountQuotasListByAccount() + { + // Generated from example definition: 2024-12-01/AccountQuotas_ListByAccount.json + // this example is just showing the usage of "AccountQuota_ListByAccount" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PlaywrightTestingAccountResource created on azure + // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "dummyrg"; + string accountName = "myPlaywrightAccount"; + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); + + // get the collection of this PlaywrightTestingAccountQuotaResource + PlaywrightTestingAccountQuotaCollection collection = playwrightTestingAccount.GetAllPlaywrightTestingAccountQuota(); + + // invoke the operation and iterate over the result + await foreach (PlaywrightTestingAccountQuotaResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PlaywrightTestingAccountQuotaData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AccountQuotasGet() + { + // Generated from example definition: 2024-12-01/AccountQuotas_Get.json + // this example is just showing the usage of "AccountQuota_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PlaywrightTestingAccountResource created on azure + // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "dummyrg"; + string accountName = "myPlaywrightAccount"; + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); + + // get the collection of this PlaywrightTestingAccountQuotaResource + PlaywrightTestingAccountQuotaCollection collection = playwrightTestingAccount.GetAllPlaywrightTestingAccountQuota(); + + // invoke the operation + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + bool result = await collection.ExistsAsync(quotaName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AccountQuotasGet() + { + // Generated from example definition: 2024-12-01/AccountQuotas_Get.json + // this example is just showing the usage of "AccountQuota_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PlaywrightTestingAccountResource created on azure + // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "dummyrg"; + string accountName = "myPlaywrightAccount"; + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); + + // get the collection of this PlaywrightTestingAccountQuotaResource + PlaywrightTestingAccountQuotaCollection collection = playwrightTestingAccount.GetAllPlaywrightTestingAccountQuota(); + + // invoke the operation + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + NullableResponse response = await collection.GetIfExistsAsync(quotaName); + PlaywrightTestingAccountQuotaResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PlaywrightTestingAccountQuotaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountQuotaResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountQuotaResource.cs new file mode 100644 index 000000000000..3588cf362776 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountQuotaResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.PlaywrightTesting.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlaywrightTesting.Samples +{ + public partial class Sample_PlaywrightTestingAccountQuotaResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AccountQuotasGet() + { + // Generated from example definition: 2024-12-01/AccountQuotas_Get.json + // this example is just showing the usage of "AccountQuota_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PlaywrightTestingAccountQuotaResource created on azure + // for more information of creating PlaywrightTestingAccountQuotaResource, please refer to the document of PlaywrightTestingAccountQuotaResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "dummyrg"; + string accountName = "myPlaywrightAccount"; + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + ResourceIdentifier playwrightTestingAccountQuotaResourceId = PlaywrightTestingAccountQuotaResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, quotaName); + PlaywrightTestingAccountQuotaResource playwrightTestingAccountQuota = client.GetPlaywrightTestingAccountQuotaResource(playwrightTestingAccountQuotaResourceId); + + // invoke the operation + PlaywrightTestingAccountQuotaResource result = await playwrightTestingAccountQuota.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PlaywrightTestingAccountQuotaData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountResource.cs index 7f4a0091fd0d..e5b6390a3ead 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountResource.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingAccountResource.cs @@ -16,42 +16,12 @@ namespace Azure.ResourceManager.PlaywrightTesting.Samples { public partial class Sample_PlaywrightTestingAccountResource { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_AccountsGet() - { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this PlaywrightTestingAccountResource created on azure - // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "dummyrg"; - string name = "myPlaywrightAccount"; - ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); - PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); - - // invoke the operation - PlaywrightTestingAccountResource result = await playwrightTestingAccount.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - PlaywrightTestingAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task Delete_AccountsDelete() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json - // this example is just showing the usage of "Accounts_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Accounts_Delete.json + // this example is just showing the usage of "Account_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -62,8 +32,8 @@ public async Task Delete_AccountsDelete() // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "dummyrg"; - string name = "myPlaywrightAccount"; - ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + string accountName = "myPlaywrightAccount"; + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); // invoke the operation @@ -76,8 +46,8 @@ public async Task Delete_AccountsDelete() [Ignore("Only validating compilation of examples")] public async Task Update_AccountsUpdate() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json - // this example is just showing the usage of "Accounts_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Accounts_Update.json + // this example is just showing the usage of "Account_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -88,8 +58,8 @@ public async Task Update_AccountsUpdate() // for more information of creating PlaywrightTestingAccountResource, please refer to the document of PlaywrightTestingAccountResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "dummyrg"; - string name = "myPlaywrightAccount"; - ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + string accountName = "myPlaywrightAccount"; + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); PlaywrightTestingAccountResource playwrightTestingAccount = client.GetPlaywrightTestingAccountResource(playwrightTestingAccountResourceId); // invoke the operation @@ -97,10 +67,13 @@ public async Task Update_AccountsUpdate() { Tags = { -["Division"] = "LT", -["Team"] = "Dev Exp" +["Team"] = "Dev Exp", +["Division"] = "LT" }, - RegionalAffinity = EnablementStatus.Enabled, + Properties = new AccountUpdateProperties + { + RegionalAffinity = PlaywrightTestingEnablementStatus.Enabled, + }, }; PlaywrightTestingAccountResource result = await playwrightTestingAccount.UpdateAsync(patch); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaCollection.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaCollection.cs index f17ae04b5e1c..185013c36333 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaCollection.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaCollection.cs @@ -21,8 +21,8 @@ public partial class Sample_PlaywrightTestingQuotaCollection [Ignore("Only validating compilation of examples")] public async Task Get_QuotasGet() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - // this example is just showing the usage of "Quotas_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Quotas_Get.json + // this example is just showing the usage of "Quota_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -36,12 +36,12 @@ public async Task Get_QuotasGet() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // get the collection of this PlaywrightTestingQuotaResource - AzureLocation location = new AzureLocation("eastus"); + string location = "eastus"; PlaywrightTestingQuotaCollection collection = subscriptionResource.GetAllPlaywrightTestingQuota(location); // invoke the operation - PlaywrightTestingQuotaName name = PlaywrightTestingQuotaName.ScalableExecution; - PlaywrightTestingQuotaResource result = await collection.GetAsync(name); + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + PlaywrightTestingQuotaResource result = await collection.GetAsync(quotaName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -54,8 +54,8 @@ public async Task Get_QuotasGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_QuotasListBySubscription() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json - // this example is just showing the usage of "Quotas_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Quotas_ListBySubscription.json + // this example is just showing the usage of "Quota_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -69,7 +69,7 @@ public async Task GetAll_QuotasListBySubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // get the collection of this PlaywrightTestingQuotaResource - AzureLocation location = new AzureLocation("eastus"); + string location = "eastus"; PlaywrightTestingQuotaCollection collection = subscriptionResource.GetAllPlaywrightTestingQuota(location); // invoke the operation and iterate over the result @@ -89,8 +89,8 @@ public async Task GetAll_QuotasListBySubscription() [Ignore("Only validating compilation of examples")] public async Task Exists_QuotasGet() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - // this example is just showing the usage of "Quotas_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Quotas_Get.json + // this example is just showing the usage of "Quota_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -104,12 +104,12 @@ public async Task Exists_QuotasGet() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // get the collection of this PlaywrightTestingQuotaResource - AzureLocation location = new AzureLocation("eastus"); + string location = "eastus"; PlaywrightTestingQuotaCollection collection = subscriptionResource.GetAllPlaywrightTestingQuota(location); // invoke the operation - PlaywrightTestingQuotaName name = PlaywrightTestingQuotaName.ScalableExecution; - bool result = await collection.ExistsAsync(name); + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + bool result = await collection.ExistsAsync(quotaName); Console.WriteLine($"Succeeded: {result}"); } @@ -118,8 +118,8 @@ public async Task Exists_QuotasGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_QuotasGet() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - // this example is just showing the usage of "Quotas_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Quotas_Get.json + // this example is just showing the usage of "Quota_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -133,12 +133,12 @@ public async Task GetIfExists_QuotasGet() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // get the collection of this PlaywrightTestingQuotaResource - AzureLocation location = new AzureLocation("eastus"); + string location = "eastus"; PlaywrightTestingQuotaCollection collection = subscriptionResource.GetAllPlaywrightTestingQuota(location); // invoke the operation - PlaywrightTestingQuotaName name = PlaywrightTestingQuotaName.ScalableExecution; - NullableResponse response = await collection.GetIfExistsAsync(name); + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + NullableResponse response = await collection.GetIfExistsAsync(quotaName); PlaywrightTestingQuotaResource result = response.HasValue ? response.Value : null; if (result == null) diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaResource.cs index 2268453872cb..22387c22061f 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaResource.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_PlaywrightTestingQuotaResource.cs @@ -20,8 +20,8 @@ public partial class Sample_PlaywrightTestingQuotaResource [Ignore("Only validating compilation of examples")] public async Task Get_QuotasGet() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - // this example is just showing the usage of "Quotas_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Quotas_Get.json + // this example is just showing the usage of "Quota_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -31,9 +31,9 @@ public async Task Get_QuotasGet() // this example assumes you already have this PlaywrightTestingQuotaResource created on azure // for more information of creating PlaywrightTestingQuotaResource, please refer to the document of PlaywrightTestingQuotaResource string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("eastus"); - PlaywrightTestingQuotaName name = PlaywrightTestingQuotaName.ScalableExecution; - ResourceIdentifier playwrightTestingQuotaResourceId = PlaywrightTestingQuotaResource.CreateResourceIdentifier(subscriptionId, location, name); + string location = "eastus"; + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + ResourceIdentifier playwrightTestingQuotaResourceId = PlaywrightTestingQuotaResource.CreateResourceIdentifier(subscriptionId, location, quotaName); PlaywrightTestingQuotaResource playwrightTestingQuota = client.GetPlaywrightTestingQuotaResource(playwrightTestingQuotaResourceId); // invoke the operation diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index d3357cd6bd93..766aee6e99a3 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.PlaywrightTesting.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -18,10 +19,10 @@ public partial class Sample_SubscriptionResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task GetPlaywrightTestingAccounts_AccountsListBySubscription() + public async Task CheckPlaywrightTestingNameAvailability_AccountsCheckNameAvailability() { - // Generated from example definition: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json - // this example is just showing the usage of "Accounts_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-12-01/Accounts_CheckNameAvailability.json + // this example is just showing the usage of "Accounts_CheckPlaywrightTestingNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -34,17 +35,15 @@ public async Task GetPlaywrightTestingAccounts_AccountsListBySubscription() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation and iterate over the result - await foreach (PlaywrightTestingAccountResource item in subscriptionResource.GetPlaywrightTestingAccountsAsync()) + // invoke the operation + PlaywrightTestingNameAvailabilityContent content = new PlaywrightTestingNameAvailabilityContent { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - PlaywrightTestingAccountData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); + Name = "dummyName", + Type = "Microsoft.AzurePlaywrightService/Accounts", + }; + PlaywrightTestingNameAvailabilityResult result = await subscriptionResource.CheckPlaywrightTestingNameAvailabilityAsync(content); + + Console.WriteLine($"Succeeded: {result}"); } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Azure.ResourceManager.PlaywrightTesting.csproj b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Azure.ResourceManager.PlaywrightTesting.csproj index 61d5cb3afde3..3a6c788a4d95 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Azure.ResourceManager.PlaywrightTesting.csproj +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Azure.ResourceManager.PlaywrightTesting.csproj @@ -1,6 +1,8 @@ - 1.0.0-beta.2 + 1.1.0-beta.1 + + 1.0.0 Azure.ResourceManager.PlaywrightTesting Azure Resource Manager client SDK for Azure resource provider PlaywrightTesting. azure;management;arm;resource manager;playwrighttesting diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/ArmPlaywrightTestingModelFactory.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/ArmPlaywrightTestingModelFactory.cs index e4799441a662..6ab3815727d2 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/ArmPlaywrightTestingModelFactory.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/ArmPlaywrightTestingModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -15,6 +16,88 @@ namespace Azure.ResourceManager.PlaywrightTesting.Models /// Model factory for models. public static partial class ArmPlaywrightTestingModelFactory { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static PlaywrightTestingAccountQuotaData PlaywrightTestingAccountQuotaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PlaywrightTestingAccountQuotaProperties properties = null) + { + return new PlaywrightTestingAccountQuotaData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Playwright service account quota resource free-trial properties. + /// The status of the last operation. + /// A new instance for mocking. + public static PlaywrightTestingAccountQuotaProperties PlaywrightTestingAccountQuotaProperties(PlaywrightTestingAccountFreeTrialProperties freeTrial = null, PlaywrightTestingProvisioningState? provisioningState = null) + { + return new PlaywrightTestingAccountQuotaProperties(freeTrial, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The free-trial createdAt utcDateTime. + /// The free-trial expiryAt utcDateTime. + /// The free-trial allocated limit value eg. allocated free minutes. + /// The free-trial used value eg. used free minutes. + /// The free-trial percentage used. + /// A new instance for mocking. + public static PlaywrightTestingAccountFreeTrialProperties PlaywrightTestingAccountFreeTrialProperties(DateTimeOffset createdOn = default, DateTimeOffset expiryOn = default, int allocatedValue = default, int usedValue = default, float percentageUsed = default) + { + return new PlaywrightTestingAccountFreeTrialProperties( + createdOn, + expiryOn, + allocatedValue, + usedValue, + percentageUsed, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static PlaywrightTestingQuotaData PlaywrightTestingQuotaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PlaywrightTestingQuotaProperties properties = null) + { + return new PlaywrightTestingQuotaData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The subscription quota resource free-trial properties. + /// Indicates the offering type for the subscription. + /// The status of the last operation. + /// A new instance for mocking. + public static PlaywrightTestingQuotaProperties PlaywrightTestingQuotaProperties(PlaywrightTestingFreeTrialProperties freeTrial = null, PlaywrightTestingOfferingType? offeringType = null, PlaywrightTestingProvisioningState? provisioningState = null) + { + return new PlaywrightTestingQuotaProperties(freeTrial, offeringType, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Playwright service account id. + /// The free-trial state. + /// A new instance for mocking. + public static PlaywrightTestingFreeTrialProperties PlaywrightTestingFreeTrialProperties(string accountId = null, PlaywrightTestingFreeTrialState state = default) + { + return new PlaywrightTestingFreeTrialProperties(accountId, state, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -22,13 +105,9 @@ public static partial class ArmPlaywrightTestingModelFactory /// The systemData. /// The tags. /// The location. - /// The Playwright testing dashboard URI for the account resource. - /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. - /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. - /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. - /// The status of the last operation. + /// The resource-specific properties for this resource. /// A new instance for mocking. - public static PlaywrightTestingAccountData PlaywrightTestingAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, Uri dashboardUri = null, EnablementStatus? regionalAffinity = null, EnablementStatus? scalableExecution = null, EnablementStatus? reporting = null, PlaywrightTestingProvisioningState? provisioningState = null) + public static PlaywrightTestingAccountData PlaywrightTestingAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, PlaywrightTestingAccountProperties properties = null) { tags ??= new Dictionary(); @@ -39,32 +118,38 @@ public static PlaywrightTestingAccountData PlaywrightTestingAccountData(Resource systemData, tags, location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Playwright testing dashboard URI for the account resource. + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + /// When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. + /// The status of the last operation. + /// A new instance for mocking. + public static PlaywrightTestingAccountProperties PlaywrightTestingAccountProperties(Uri dashboardUri = null, PlaywrightTestingEnablementStatus? regionalAffinity = null, PlaywrightTestingEnablementStatus? scalableExecution = null, PlaywrightTestingEnablementStatus? reporting = null, PlaywrightTestingEnablementStatus? localAuth = null, PlaywrightTestingProvisioningState? provisioningState = null) + { + return new PlaywrightTestingAccountProperties( dashboardUri, regionalAffinity, scalableExecution, reporting, + localAuth, provisioningState, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The free-trial quota. - /// The status of the last operation. - /// A new instance for mocking. - public static PlaywrightTestingQuotaData PlaywrightTestingQuotaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, FreeTrialProperties freeTrial = null, PlaywrightTestingProvisioningState? provisioningState = null) + /// Initializes a new instance of . + /// Indicates if the resource name is available. + /// The reason why the given name is not available. + /// Detailed reason why the given name is not available. + /// A new instance for mocking. + public static PlaywrightTestingNameAvailabilityResult PlaywrightTestingNameAvailabilityResult(bool? isNameAvailable = null, PlaywrightTestingNameUnavailableReason? reason = null, string message = null) { - return new PlaywrightTestingQuotaData( - id, - name, - resourceType, - systemData, - freeTrial, - provisioningState, - serializedAdditionalRawData: null); + return new PlaywrightTestingNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingArmClient.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingArmClient.cs index da51ea045653..b1963f3e762b 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingArmClient.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingArmClient.cs @@ -57,5 +57,17 @@ public virtual PlaywrightTestingQuotaResource GetPlaywrightTestingQuotaResource( PlaywrightTestingQuotaResource.ValidateResourceId(id); return new PlaywrightTestingQuotaResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PlaywrightTestingAccountQuotaResource GetPlaywrightTestingAccountQuotaResource(ResourceIdentifier id) + { + PlaywrightTestingAccountQuotaResource.ValidateResourceId(id); + return new PlaywrightTestingAccountQuotaResource(Client, id); + } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingResourceGroupResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingResourceGroupResource.cs index d57acf34df24..4da148cf71e2 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingResourceGroupResource.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingResourceGroupResource.cs @@ -45,15 +45,15 @@ public virtual PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts() /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -61,14 +61,14 @@ public virtual PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts() /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetPlaywrightTestingAccountAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetPlaywrightTestingAccountAsync(string accountName, CancellationToken cancellationToken = default) { - return await GetPlaywrightTestingAccounts().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetPlaywrightTestingAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -76,15 +76,15 @@ public virtual async Task> GetPlaywri /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -92,14 +92,14 @@ public virtual async Task> GetPlaywri /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetPlaywrightTestingAccount(string name, CancellationToken cancellationToken = default) + public virtual Response GetPlaywrightTestingAccount(string accountName, CancellationToken cancellationToken = default) { - return GetPlaywrightTestingAccounts().Get(name, cancellationToken); + return GetPlaywrightTestingAccounts().Get(accountName, cancellationToken); } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingSubscriptionResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingSubscriptionResource.cs index ad2be21afbb6..0d7eb6e75f11 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingSubscriptionResource.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/MockablePlaywrightTestingSubscriptionResource.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Threading; using System.Threading.Tasks; using Autorest.CSharp.Core; @@ -43,26 +44,28 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Gets a collection of PlaywrightTestingQuotaResources in the SubscriptionResource. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of PlaywrightTestingQuotaResources and their operations over a PlaywrightTestingQuotaResource. - public virtual PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(AzureLocation location) + public virtual PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(string location) { return new PlaywrightTestingQuotaCollection(Client, Id, location); } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -71,28 +74,30 @@ public virtual PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(Azu /// /// /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// The quota name. + /// The quota name. /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetPlaywrightTestingQuotaAsync(AzureLocation location, PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual async Task> GetPlaywrightTestingQuotaAsync(string location, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { - return await GetAllPlaywrightTestingQuota(location).GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAllPlaywrightTestingQuota(location).GetAsync(quotaName, cancellationToken).ConfigureAwait(false); } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -101,12 +106,14 @@ public virtual async Task> GetPlaywrigh /// /// /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// The quota name. + /// The quota name. /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetPlaywrightTestingQuota(AzureLocation location, PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual Response GetPlaywrightTestingQuota(string location, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { - return GetAllPlaywrightTestingQuota(location).Get(name, cancellationToken); + return GetAllPlaywrightTestingQuota(location).Get(quotaName, cancellationToken); } /// @@ -118,11 +125,11 @@ public virtual Response GetPlaywrightTestingQuot /// /// /// Operation Id - /// Accounts_ListBySubscription + /// Account_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -148,11 +155,11 @@ public virtual AsyncPageable GetPlaywrightTest /// /// /// Operation Id - /// Accounts_ListBySubscription + /// Account_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -168,5 +175,89 @@ public virtual Pageable GetPlaywrightTestingAc HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PlaywrightTestingAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PlaywrightTestingAccountResource(Client, PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(e)), PlaywrightTestingAccountAccountsClientDiagnostics, Pipeline, "MockablePlaywrightTestingSubscriptionResource.GetPlaywrightTestingAccounts", "value", "nextLink", cancellationToken); } + + /// + /// Adds check global name availability operation, normally used if a resource name must be globally unique. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability + /// + /// + /// Operation Id + /// Accounts_CheckPlaywrightTestingNameAvailability + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The CheckAvailability request. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckPlaywrightTestingNameAvailabilityAsync(PlaywrightTestingNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PlaywrightTestingAccountAccountsClientDiagnostics.CreateScope("MockablePlaywrightTestingSubscriptionResource.CheckPlaywrightTestingNameAvailability"); + scope.Start(); + try + { + var response = await PlaywrightTestingAccountAccountsRestClient.CheckPlaywrightTestingNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds check global name availability operation, normally used if a resource name must be globally unique. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability + /// + /// + /// Operation Id + /// Accounts_CheckPlaywrightTestingNameAvailability + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The CheckAvailability request. + /// The cancellation token to use. + /// is null. + public virtual Response CheckPlaywrightTestingNameAvailability(PlaywrightTestingNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PlaywrightTestingAccountAccountsClientDiagnostics.CreateScope("MockablePlaywrightTestingSubscriptionResource.CheckPlaywrightTestingNameAvailability"); + scope.Start(); + try + { + var response = PlaywrightTestingAccountAccountsRestClient.CheckPlaywrightTestingNameAvailability(Id.SubscriptionId, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/PlaywrightTestingExtensions.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/PlaywrightTestingExtensions.cs index dbf82f7e308d..8ac39d8a7c03 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/PlaywrightTestingExtensions.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Extensions/PlaywrightTestingExtensions.cs @@ -71,6 +71,25 @@ public static PlaywrightTestingQuotaResource GetPlaywrightTestingQuotaResource(t return GetMockablePlaywrightTestingArmClient(client).GetPlaywrightTestingQuotaResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static PlaywrightTestingAccountQuotaResource GetPlaywrightTestingAccountQuotaResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePlaywrightTestingArmClient(client).GetPlaywrightTestingAccountQuotaResource(id); + } + /// /// Gets a collection of PlaywrightTestingAccountResources in the ResourceGroupResource. /// @@ -93,15 +112,15 @@ public static PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts(th /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -114,16 +133,16 @@ public static PlaywrightTestingAccountCollection GetPlaywrightTestingAccounts(th /// /// /// The instance the method will execute against. - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetPlaywrightTestingAccountAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) + public static async Task> GetPlaywrightTestingAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockablePlaywrightTestingResourceGroupResource(resourceGroupResource).GetPlaywrightTestingAccountAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMockablePlaywrightTestingResourceGroupResource(resourceGroupResource).GetPlaywrightTestingAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -131,15 +150,15 @@ public static async Task> GetPlaywrig /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -152,30 +171,31 @@ public static async Task> GetPlaywrig /// /// /// The instance the method will execute against. - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetPlaywrightTestingAccount(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) + public static Response GetPlaywrightTestingAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockablePlaywrightTestingResourceGroupResource(resourceGroupResource).GetPlaywrightTestingAccount(name, cancellationToken); + return GetMockablePlaywrightTestingResourceGroupResource(resourceGroupResource).GetPlaywrightTestingAccount(accountName, cancellationToken); } /// /// Gets a collection of PlaywrightTestingQuotaResources in the SubscriptionResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// is null. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of PlaywrightTestingQuotaResources and their operations over a PlaywrightTestingQuotaResource. - public static PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this SubscriptionResource subscriptionResource, AzureLocation location) + public static PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this SubscriptionResource subscriptionResource, string location) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -183,19 +203,19 @@ public static PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -204,36 +224,37 @@ public static PlaywrightTestingQuotaCollection GetAllPlaywrightTestingQuota(this /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// The quota name. + /// The quota name. /// The cancellation token to use. - /// is null. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetPlaywrightTestingQuotaAsync(this SubscriptionResource subscriptionResource, AzureLocation location, PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public static async Task> GetPlaywrightTestingQuotaAsync(this SubscriptionResource subscriptionResource, string location, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).GetPlaywrightTestingQuotaAsync(location, name, cancellationToken).ConfigureAwait(false); + return await GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).GetPlaywrightTestingQuotaAsync(location, quotaName, cancellationToken).ConfigureAwait(false); } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -242,20 +263,21 @@ public static async Task> GetPlaywright /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// The quota name. + /// The quota name. /// The cancellation token to use. - /// is null. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetPlaywrightTestingQuota(this SubscriptionResource subscriptionResource, AzureLocation location, PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public static Response GetPlaywrightTestingQuota(this SubscriptionResource subscriptionResource, string location, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).GetPlaywrightTestingQuota(location, name, cancellationToken); + return GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).GetPlaywrightTestingQuota(location, quotaName, cancellationToken); } /// @@ -267,11 +289,11 @@ public static Response GetPlaywrightTestingQuota /// /// /// Operation Id - /// Accounts_ListBySubscription + /// Account_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -303,11 +325,11 @@ public static AsyncPageable GetPlaywrightTesti /// /// /// Operation Id - /// Accounts_ListBySubscription + /// Account_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -329,5 +351,77 @@ public static Pageable GetPlaywrightTestingAcc return GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).GetPlaywrightTestingAccounts(cancellationToken); } + + /// + /// Adds check global name availability operation, normally used if a resource name must be globally unique. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability + /// + /// + /// Operation Id + /// Accounts_CheckPlaywrightTestingNameAvailability + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The CheckAvailability request. + /// The cancellation token to use. + /// or is null. + public static async Task> CheckPlaywrightTestingNameAvailabilityAsync(this SubscriptionResource subscriptionResource, PlaywrightTestingNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).CheckPlaywrightTestingNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Adds check global name availability operation, normally used if a resource name must be globally unique. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability + /// + /// + /// Operation Id + /// Accounts_CheckPlaywrightTestingNameAvailability + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The CheckAvailability request. + /// The cancellation token to use. + /// or is null. + public static Response CheckPlaywrightTestingNameAvailability(this SubscriptionResource subscriptionResource, PlaywrightTestingNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePlaywrightTestingSubscriptionResource(subscriptionResource).CheckPlaywrightTestingNameAvailability(content, cancellationToken); + } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountQuotaListResult.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountQuotaListResult.Serialization.cs new file mode 100644 index 000000000000..bf117c5dc69c --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountQuotaListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + internal partial class AccountQuotaListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountQuotaListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccountQuotaListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountQuotaListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountQuotaListResult(document.RootElement, options); + } + + internal static AccountQuotaListResult DeserializeAccountQuotaListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PlaywrightTestingAccountQuotaData.DeserializePlaywrightTestingAccountQuotaData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountQuotaListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountQuotaListResult)} does not support writing '{options.Format}' format."); + } + } + + AccountQuotaListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountQuotaListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountQuotaListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanResourceListResult.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountQuotaListResult.cs similarity index 67% rename from sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanResourceListResult.cs rename to sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountQuotaListResult.cs index f38450010cf7..8c0efeb7c87e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanResourceListResult.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountQuotaListResult.cs @@ -9,10 +9,10 @@ using System.Collections.Generic; using System.Linq; -namespace Azure.ResourceManager.AppService.Models +namespace Azure.ResourceManager.PlaywrightTesting.Models { - /// Collection of resources. - internal partial class AppServicePlanResourceListResult + /// The response of a AccountQuota list operation. + internal partial class AccountQuotaListResult { /// /// Keeps track of any properties unknown to the library. @@ -46,35 +46,35 @@ internal partial class AppServicePlanResourceListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Collection of resources. + /// Initializes a new instance of . + /// The AccountQuota items on this page. /// is null. - internal AppServicePlanResourceListResult(IEnumerable value) + internal AccountQuotaListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); Value = value.ToList(); } - /// Initializes a new instance of . - /// Collection of resources. - /// Link to next page of resources. + /// Initializes a new instance of . + /// The AccountQuota items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal AppServicePlanResourceListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal AccountQuotaListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppServicePlanResourceListResult() + /// Initializes a new instance of for deserialization. + internal AccountQuotaListResult() { } - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } + /// The AccountQuota items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountUpdateProperties.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..c0d4db76371a --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountUpdateProperties.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class AccountUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RegionalAffinity)) + { + writer.WritePropertyName("regionalAffinity"u8); + writer.WriteStringValue(RegionalAffinity.Value.ToString()); + } + if (Optional.IsDefined(ScalableExecution)) + { + writer.WritePropertyName("scalableExecution"u8); + writer.WriteStringValue(ScalableExecution.Value.ToString()); + } + if (Optional.IsDefined(Reporting)) + { + writer.WritePropertyName("reporting"u8); + writer.WriteStringValue(Reporting.Value.ToString()); + } + if (Optional.IsDefined(LocalAuth)) + { + writer.WritePropertyName("localAuth"u8); + writer.WriteStringValue(LocalAuth.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccountUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountUpdateProperties(document.RootElement, options); + } + + internal static AccountUpdateProperties DeserializeAccountUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlaywrightTestingEnablementStatus? regionalAffinity = default; + PlaywrightTestingEnablementStatus? scalableExecution = default; + PlaywrightTestingEnablementStatus? reporting = default; + PlaywrightTestingEnablementStatus? localAuth = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("regionalAffinity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionalAffinity = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("scalableExecution"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalableExecution = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("reporting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reporting = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("localAuth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAuth = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountUpdateProperties(regionalAffinity, scalableExecution, reporting, localAuth, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AccountUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountUpdateProperties.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountUpdateProperties.cs new file mode 100644 index 000000000000..82c651dd1481 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/AccountUpdateProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The updatable properties of the Account. + public partial class AccountUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccountUpdateProperties() + { + } + + /// Initializes a new instance of . + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + /// When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. + /// Keeps track of any properties unknown to the library. + internal AccountUpdateProperties(PlaywrightTestingEnablementStatus? regionalAffinity, PlaywrightTestingEnablementStatus? scalableExecution, PlaywrightTestingEnablementStatus? reporting, PlaywrightTestingEnablementStatus? localAuth, IDictionary serializedAdditionalRawData) + { + RegionalAffinity = regionalAffinity; + ScalableExecution = scalableExecution; + Reporting = reporting; + LocalAuth = localAuth; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + public PlaywrightTestingEnablementStatus? RegionalAffinity { get; set; } + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + public PlaywrightTestingEnablementStatus? ScalableExecution { get; set; } + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + public PlaywrightTestingEnablementStatus? Reporting { get; set; } + /// When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. + public PlaywrightTestingEnablementStatus? LocalAuth { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/EnablementStatus.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/EnablementStatus.cs deleted file mode 100644 index 21f9490d4a2a..000000000000 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/EnablementStatus.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.ResourceManager.PlaywrightTesting.Models -{ - /// The enablement status of a feature. - public readonly partial struct EnablementStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EnablementStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// The feature is Enabled. - public static EnablementStatus Enabled { get; } = new EnablementStatus(EnabledValue); - /// The feature is Disabled. - public static EnablementStatus Disabled { get; } = new EnablementStatus(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(EnablementStatus left, EnablementStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EnablementStatus left, EnablementStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator EnablementStatus(string value) => new EnablementStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EnablementStatus other && Equals(other); - /// - public bool Equals(EnablementStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialState.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialState.cs deleted file mode 100644 index 135eddf8d678..000000000000 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialState.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.ResourceManager.PlaywrightTesting.Models -{ - /// The free-trial state. - public readonly partial struct FreeTrialState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public FreeTrialState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ActiveValue = "Active"; - private const string ExpiredValue = "Expired"; - - /// The free-trial is Active. - public static FreeTrialState Active { get; } = new FreeTrialState(ActiveValue); - /// The free-trial is Expired. - public static FreeTrialState Expired { get; } = new FreeTrialState(ExpiredValue); - /// Determines if two values are the same. - public static bool operator ==(FreeTrialState left, FreeTrialState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(FreeTrialState left, FreeTrialState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator FreeTrialState(string value) => new FreeTrialState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is FreeTrialState other && Equals(other); - /// - public bool Equals(FreeTrialState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialProperties.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountFreeTrialProperties.Serialization.cs similarity index 65% rename from sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialProperties.Serialization.cs rename to sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountFreeTrialProperties.Serialization.cs index ab625ed5e7db..59ab7447dbca 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialProperties.Serialization.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountFreeTrialProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.PlaywrightTesting.Models { - public partial class FreeTrialProperties : IUtf8JsonSerializable, IJsonModel + public partial class PlaywrightTestingAccountFreeTrialProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,17 +28,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FreeTrialProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PlaywrightTestingAccountFreeTrialProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("accountId"u8); - writer.WriteStringValue(AccountId); - } if (options.Format != "W") { writer.WritePropertyName("createdAt"u8); @@ -64,11 +59,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("percentageUsed"u8); writer.WriteNumberValue(PercentageUsed); } - if (options.Format != "W") - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,19 +76,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - FreeTrialProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PlaywrightTestingAccountFreeTrialProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FreeTrialProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PlaywrightTestingAccountFreeTrialProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFreeTrialProperties(document.RootElement, options); + return DeserializePlaywrightTestingAccountFreeTrialProperties(document.RootElement, options); } - internal static FreeTrialProperties DeserializeFreeTrialProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static PlaywrightTestingAccountFreeTrialProperties DeserializePlaywrightTestingAccountFreeTrialProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -106,22 +96,15 @@ internal static FreeTrialProperties DeserializeFreeTrialProperties(JsonElement e { return null; } - string accountId = default; DateTimeOffset createdAt = default; DateTimeOffset expiryAt = default; int allocatedValue = default; int usedValue = default; - decimal percentageUsed = default; - FreeTrialState state = default; + float percentageUsed = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("accountId"u8)) - { - accountId = property.Value.GetString(); - continue; - } if (property.NameEquals("createdAt"u8)) { createdAt = property.Value.GetDateTimeOffset("O"); @@ -144,12 +127,7 @@ internal static FreeTrialProperties DeserializeFreeTrialProperties(JsonElement e } if (property.NameEquals("percentageUsed"u8)) { - percentageUsed = property.Value.GetDecimal(); - continue; - } - if (property.NameEquals("state"u8)) - { - state = new FreeTrialState(property.Value.GetString()); + percentageUsed = property.Value.GetSingle(); continue; } if (options.Format != "W") @@ -158,46 +136,44 @@ internal static FreeTrialProperties DeserializeFreeTrialProperties(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new FreeTrialProperties( - accountId, + return new PlaywrightTestingAccountFreeTrialProperties( createdAt, expiryAt, allocatedValue, usedValue, percentageUsed, - state, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(FreeTrialProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlaywrightTestingAccountFreeTrialProperties)} does not support writing '{options.Format}' format."); } } - FreeTrialProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PlaywrightTestingAccountFreeTrialProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeFreeTrialProperties(document.RootElement, options); + return DeserializePlaywrightTestingAccountFreeTrialProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(FreeTrialProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlaywrightTestingAccountFreeTrialProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialProperties.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountFreeTrialProperties.cs similarity index 71% rename from sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialProperties.cs rename to sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountFreeTrialProperties.cs index 6c4070247ce3..86f31d0312b2 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/FreeTrialProperties.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountFreeTrialProperties.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.PlaywrightTesting.Models { - /// The free-trial properties. - public partial class FreeTrialProperties + /// The Playwright service account quota resource free-trial properties. + public partial class PlaywrightTestingAccountFreeTrialProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,53 +45,43 @@ public partial class FreeTrialProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The playwright account id. + /// Initializes a new instance of . /// The free-trial createdAt utcDateTime. /// The free-trial expiryAt utcDateTime. /// The free-trial allocated limit value eg. allocated free minutes. /// The free-trial used value eg. used free minutes. /// The free-trial percentage used. - /// The free-trial state. - public FreeTrialProperties(string accountId, DateTimeOffset createdOn, DateTimeOffset expiryOn, int allocatedValue, int usedValue, decimal percentageUsed, FreeTrialState state) + internal PlaywrightTestingAccountFreeTrialProperties(DateTimeOffset createdOn, DateTimeOffset expiryOn, int allocatedValue, int usedValue, float percentageUsed) { - AccountId = accountId; CreatedOn = createdOn; ExpiryOn = expiryOn; AllocatedValue = allocatedValue; UsedValue = usedValue; PercentageUsed = percentageUsed; - State = state; } - /// Initializes a new instance of . - /// The playwright account id. + /// Initializes a new instance of . /// The free-trial createdAt utcDateTime. /// The free-trial expiryAt utcDateTime. /// The free-trial allocated limit value eg. allocated free minutes. /// The free-trial used value eg. used free minutes. /// The free-trial percentage used. - /// The free-trial state. /// Keeps track of any properties unknown to the library. - internal FreeTrialProperties(string accountId, DateTimeOffset createdOn, DateTimeOffset expiryOn, int allocatedValue, int usedValue, decimal percentageUsed, FreeTrialState state, IDictionary serializedAdditionalRawData) + internal PlaywrightTestingAccountFreeTrialProperties(DateTimeOffset createdOn, DateTimeOffset expiryOn, int allocatedValue, int usedValue, float percentageUsed, IDictionary serializedAdditionalRawData) { - AccountId = accountId; CreatedOn = createdOn; ExpiryOn = expiryOn; AllocatedValue = allocatedValue; UsedValue = usedValue; PercentageUsed = percentageUsed; - State = state; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal FreeTrialProperties() + /// Initializes a new instance of for deserialization. + internal PlaywrightTestingAccountFreeTrialProperties() { } - /// The playwright account id. - public string AccountId { get; } /// The free-trial createdAt utcDateTime. public DateTimeOffset CreatedOn { get; } /// The free-trial expiryAt utcDateTime. @@ -101,8 +91,6 @@ internal FreeTrialProperties() /// The free-trial used value eg. used free minutes. public int UsedValue { get; } /// The free-trial percentage used. - public decimal PercentageUsed { get; } - /// The free-trial state. - public FreeTrialState State { get; } + public float PercentageUsed { get; } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.Serialization.cs index 9b3d510ee3ae..3ed69cd86a57 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.Serialization.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.Serialization.cs @@ -45,24 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(RegionalAffinity)) - { - writer.WritePropertyName("regionalAffinity"u8); - writer.WriteStringValue(RegionalAffinity.Value.ToString()); - } - if (Optional.IsDefined(ScalableExecution)) - { - writer.WritePropertyName("scalableExecution"u8); - writer.WriteStringValue(ScalableExecution.Value.ToString()); - } - if (Optional.IsDefined(Reporting)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("reporting"u8); - writer.WriteStringValue(Reporting.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,9 +88,7 @@ internal static PlaywrightTestingAccountPatch DeserializePlaywrightTestingAccoun return null; } IDictionary tags = default; - EnablementStatus? regionalAffinity = default; - EnablementStatus? scalableExecution = default; - EnablementStatus? reporting = default; + AccountUpdateProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -126,39 +111,9 @@ internal static PlaywrightTestingAccountPatch DeserializePlaywrightTestingAccoun { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("regionalAffinity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - regionalAffinity = new EnablementStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scalableExecution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scalableExecution = new EnablementStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("reporting"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - reporting = new EnablementStatus(property0.Value.GetString()); - continue; - } - } + properties = AccountUpdateProperties.DeserializeAccountUpdateProperties(property.Value, options); continue; } if (options.Format != "W") @@ -167,7 +122,7 @@ internal static PlaywrightTestingAccountPatch DeserializePlaywrightTestingAccoun } } serializedAdditionalRawData = rawDataDictionary; - return new PlaywrightTestingAccountPatch(tags ?? new ChangeTrackingDictionary(), regionalAffinity, scalableExecution, reporting, serializedAdditionalRawData); + return new PlaywrightTestingAccountPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.cs index 246cd663a0fc..50d60ecf3d4b 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountPatch.cs @@ -53,26 +53,18 @@ public PlaywrightTestingAccountPatch() /// Initializes a new instance of . /// Resource tags. - /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. - /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. - /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal PlaywrightTestingAccountPatch(IDictionary tags, EnablementStatus? regionalAffinity, EnablementStatus? scalableExecution, EnablementStatus? reporting, IDictionary serializedAdditionalRawData) + internal PlaywrightTestingAccountPatch(IDictionary tags, AccountUpdateProperties properties, IDictionary serializedAdditionalRawData) { Tags = tags; - RegionalAffinity = regionalAffinity; - ScalableExecution = scalableExecution; - Reporting = reporting; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } - /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. - public EnablementStatus? RegionalAffinity { get; set; } - /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. - public EnablementStatus? ScalableExecution { get; set; } - /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. - public EnablementStatus? Reporting { get; set; } + /// The resource-specific properties for this resource. + public AccountUpdateProperties Properties { get; set; } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountProperties.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountProperties.Serialization.cs new file mode 100644 index 000000000000..d059ece6f846 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountProperties.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class PlaywrightTestingAccountProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingAccountProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(DashboardUri)) + { + writer.WritePropertyName("dashboardUri"u8); + writer.WriteStringValue(DashboardUri.AbsoluteUri); + } + if (Optional.IsDefined(RegionalAffinity)) + { + writer.WritePropertyName("regionalAffinity"u8); + writer.WriteStringValue(RegionalAffinity.Value.ToString()); + } + if (Optional.IsDefined(ScalableExecution)) + { + writer.WritePropertyName("scalableExecution"u8); + writer.WriteStringValue(ScalableExecution.Value.ToString()); + } + if (Optional.IsDefined(Reporting)) + { + writer.WritePropertyName("reporting"u8); + writer.WriteStringValue(Reporting.Value.ToString()); + } + if (Optional.IsDefined(LocalAuth)) + { + writer.WritePropertyName("localAuth"u8); + writer.WriteStringValue(LocalAuth.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlaywrightTestingAccountProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingAccountProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingAccountProperties(document.RootElement, options); + } + + internal static PlaywrightTestingAccountProperties DeserializePlaywrightTestingAccountProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri dashboardUri = default; + PlaywrightTestingEnablementStatus? regionalAffinity = default; + PlaywrightTestingEnablementStatus? scalableExecution = default; + PlaywrightTestingEnablementStatus? reporting = default; + PlaywrightTestingEnablementStatus? localAuth = default; + PlaywrightTestingProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dashboardUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dashboardUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("regionalAffinity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionalAffinity = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("scalableExecution"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalableExecution = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("reporting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reporting = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("localAuth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAuth = new PlaywrightTestingEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new PlaywrightTestingProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingAccountProperties( + dashboardUri, + regionalAffinity, + scalableExecution, + reporting, + localAuth, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingAccountProperties)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingAccountProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingAccountProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingAccountProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountProperties.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountProperties.cs new file mode 100644 index 000000000000..99305964ef65 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// Account resource properties. + public partial class PlaywrightTestingAccountProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PlaywrightTestingAccountProperties() + { + } + + /// Initializes a new instance of . + /// The Playwright testing dashboard URI for the account resource. + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + /// When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingAccountProperties(Uri dashboardUri, PlaywrightTestingEnablementStatus? regionalAffinity, PlaywrightTestingEnablementStatus? scalableExecution, PlaywrightTestingEnablementStatus? reporting, PlaywrightTestingEnablementStatus? localAuth, PlaywrightTestingProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + DashboardUri = dashboardUri; + RegionalAffinity = regionalAffinity; + ScalableExecution = scalableExecution; + Reporting = reporting; + LocalAuth = localAuth; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Playwright testing dashboard URI for the account resource. + public Uri DashboardUri { get; } + /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + public PlaywrightTestingEnablementStatus? RegionalAffinity { get; set; } + /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + public PlaywrightTestingEnablementStatus? ScalableExecution { get; set; } + /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + public PlaywrightTestingEnablementStatus? Reporting { get; set; } + /// When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. + public PlaywrightTestingEnablementStatus? LocalAuth { get; set; } + /// The status of the last operation. + public PlaywrightTestingProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountQuotaProperties.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountQuotaProperties.Serialization.cs new file mode 100644 index 000000000000..fb121f4a271b --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountQuotaProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class PlaywrightTestingAccountQuotaProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FreeTrial)) + { + writer.WritePropertyName("freeTrial"u8); + writer.WriteObjectValue(FreeTrial, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlaywrightTestingAccountQuotaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingAccountQuotaProperties(document.RootElement, options); + } + + internal static PlaywrightTestingAccountQuotaProperties DeserializePlaywrightTestingAccountQuotaProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlaywrightTestingAccountFreeTrialProperties freeTrial = default; + PlaywrightTestingProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("freeTrial"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + freeTrial = PlaywrightTestingAccountFreeTrialProperties.DeserializePlaywrightTestingAccountFreeTrialProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new PlaywrightTestingProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingAccountQuotaProperties(freeTrial, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaProperties)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingAccountQuotaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingAccountQuotaProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountQuotaProperties.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountQuotaProperties.cs new file mode 100644 index 000000000000..2b878b0053c4 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingAccountQuotaProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The Playwright service account quota resource properties. + public partial class PlaywrightTestingAccountQuotaProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PlaywrightTestingAccountQuotaProperties() + { + } + + /// Initializes a new instance of . + /// The Playwright service account quota resource free-trial properties. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingAccountQuotaProperties(PlaywrightTestingAccountFreeTrialProperties freeTrial, PlaywrightTestingProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + FreeTrial = freeTrial; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Playwright service account quota resource free-trial properties. + public PlaywrightTestingAccountFreeTrialProperties FreeTrial { get; } + /// The status of the last operation. + public PlaywrightTestingProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingEnablementStatus.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingEnablementStatus.cs new file mode 100644 index 000000000000..e64fdbd20d67 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingEnablementStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The enablement status of a feature. + public readonly partial struct PlaywrightTestingEnablementStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PlaywrightTestingEnablementStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// The feature is Enabled. + public static PlaywrightTestingEnablementStatus Enabled { get; } = new PlaywrightTestingEnablementStatus(EnabledValue); + /// The feature is Disabled. + public static PlaywrightTestingEnablementStatus Disabled { get; } = new PlaywrightTestingEnablementStatus(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PlaywrightTestingEnablementStatus left, PlaywrightTestingEnablementStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PlaywrightTestingEnablementStatus left, PlaywrightTestingEnablementStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PlaywrightTestingEnablementStatus(string value) => new PlaywrightTestingEnablementStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PlaywrightTestingEnablementStatus other && Equals(other); + /// + public bool Equals(PlaywrightTestingEnablementStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialProperties.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialProperties.Serialization.cs new file mode 100644 index 000000000000..3bccc11baac6 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialProperties.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class PlaywrightTestingFreeTrialProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingFreeTrialProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("accountId"u8); + writer.WriteStringValue(AccountId); + } + if (options.Format != "W") + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlaywrightTestingFreeTrialProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingFreeTrialProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingFreeTrialProperties(document.RootElement, options); + } + + internal static PlaywrightTestingFreeTrialProperties DeserializePlaywrightTestingFreeTrialProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accountId = default; + PlaywrightTestingFreeTrialState state = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accountId"u8)) + { + accountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = new PlaywrightTestingFreeTrialState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingFreeTrialProperties(accountId, state, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingFreeTrialProperties)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingFreeTrialProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingFreeTrialProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingFreeTrialProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialProperties.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialProperties.cs new file mode 100644 index 000000000000..1ab4dc9bc3a3 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The subscription quota resource free-trial properties. + public partial class PlaywrightTestingFreeTrialProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Playwright service account id. + /// The free-trial state. + internal PlaywrightTestingFreeTrialProperties(string accountId, PlaywrightTestingFreeTrialState state) + { + AccountId = accountId; + State = state; + } + + /// Initializes a new instance of . + /// The Playwright service account id. + /// The free-trial state. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingFreeTrialProperties(string accountId, PlaywrightTestingFreeTrialState state, IDictionary serializedAdditionalRawData) + { + AccountId = accountId; + State = state; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlaywrightTestingFreeTrialProperties() + { + } + + /// The Playwright service account id. + public string AccountId { get; } + /// The free-trial state. + public PlaywrightTestingFreeTrialState State { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialState.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialState.cs new file mode 100644 index 000000000000..237ecd45f2bc --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingFreeTrialState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The free-trial state. + public readonly partial struct PlaywrightTestingFreeTrialState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PlaywrightTestingFreeTrialState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string ExpiredValue = "Expired"; + private const string NotEligibleValue = "NotEligible"; + private const string NotRegisteredValue = "NotRegistered"; + + /// The free-trial is Active. + public static PlaywrightTestingFreeTrialState Active { get; } = new PlaywrightTestingFreeTrialState(ActiveValue); + /// The free-trial is Expired. + public static PlaywrightTestingFreeTrialState Expired { get; } = new PlaywrightTestingFreeTrialState(ExpiredValue); + /// The free-trial is Not Eligible. + public static PlaywrightTestingFreeTrialState NotEligible { get; } = new PlaywrightTestingFreeTrialState(NotEligibleValue); + /// The free-trial is Not Registered. + public static PlaywrightTestingFreeTrialState NotRegistered { get; } = new PlaywrightTestingFreeTrialState(NotRegisteredValue); + /// Determines if two values are the same. + public static bool operator ==(PlaywrightTestingFreeTrialState left, PlaywrightTestingFreeTrialState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PlaywrightTestingFreeTrialState left, PlaywrightTestingFreeTrialState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PlaywrightTestingFreeTrialState(string value) => new PlaywrightTestingFreeTrialState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PlaywrightTestingFreeTrialState other && Equals(other); + /// + public bool Equals(PlaywrightTestingFreeTrialState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityContent.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityContent.Serialization.cs new file mode 100644 index 000000000000..3f935bfd926f --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityContent.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class PlaywrightTestingNameAvailabilityContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlaywrightTestingNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingNameAvailabilityContent(document.RootElement, options); + } + + internal static PlaywrightTestingNameAvailabilityContent DeserializePlaywrightTestingNameAvailabilityContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingNameAvailabilityContent(name, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityContent)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingNameAvailabilityContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingNameAvailabilityContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityContent.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityContent.cs new file mode 100644 index 000000000000..ef3463181fe1 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The check availability request body. + public partial class PlaywrightTestingNameAvailabilityContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PlaywrightTestingNameAvailabilityContent() + { + } + + /// Initializes a new instance of . + /// The name of the resource for which availability needs to be checked. + /// The resource type. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingNameAvailabilityContent(string name, string type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the resource for which availability needs to be checked. + public string Name { get; set; } + /// The resource type. + public string Type { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityResult.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityResult.Serialization.cs new file mode 100644 index 000000000000..5a1f16cbc1bf --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class PlaywrightTestingNameAvailabilityResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsNameAvailable)) + { + writer.WritePropertyName("nameAvailable"u8); + writer.WriteBooleanValue(IsNameAvailable.Value); + } + if (Optional.IsDefined(Reason)) + { + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason.Value.ToString()); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlaywrightTestingNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingNameAvailabilityResult(document.RootElement, options); + } + + internal static PlaywrightTestingNameAvailabilityResult DeserializePlaywrightTestingNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? nameAvailable = default; + PlaywrightTestingNameUnavailableReason? reason = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reason = new PlaywrightTestingNameUnavailableReason(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingNameAvailabilityResult(nameAvailable, reason, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityResult)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingNameAvailabilityResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingNameAvailabilityResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityResult.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityResult.cs new file mode 100644 index 000000000000..8e825a386490 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameAvailabilityResult.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The check availability result. + public partial class PlaywrightTestingNameAvailabilityResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PlaywrightTestingNameAvailabilityResult() + { + } + + /// Initializes a new instance of . + /// Indicates if the resource name is available. + /// The reason why the given name is not available. + /// Detailed reason why the given name is not available. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingNameAvailabilityResult(bool? isNameAvailable, PlaywrightTestingNameUnavailableReason? reason, string message, IDictionary serializedAdditionalRawData) + { + IsNameAvailable = isNameAvailable; + Reason = reason; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates if the resource name is available. + public bool? IsNameAvailable { get; } + /// The reason why the given name is not available. + public PlaywrightTestingNameUnavailableReason? Reason { get; } + /// Detailed reason why the given name is not available. + public string Message { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameUnavailableReason.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameUnavailableReason.cs new file mode 100644 index 000000000000..26b72b8497cb --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingNameUnavailableReason.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// Possible reasons for a name not being available. + public readonly partial struct PlaywrightTestingNameUnavailableReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PlaywrightTestingNameUnavailableReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidValue = "Invalid"; + private const string AlreadyExistsValue = "AlreadyExists"; + + /// Name is invalid. + public static PlaywrightTestingNameUnavailableReason Invalid { get; } = new PlaywrightTestingNameUnavailableReason(InvalidValue); + /// Name already exists. + public static PlaywrightTestingNameUnavailableReason AlreadyExists { get; } = new PlaywrightTestingNameUnavailableReason(AlreadyExistsValue); + /// Determines if two values are the same. + public static bool operator ==(PlaywrightTestingNameUnavailableReason left, PlaywrightTestingNameUnavailableReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PlaywrightTestingNameUnavailableReason left, PlaywrightTestingNameUnavailableReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PlaywrightTestingNameUnavailableReason(string value) => new PlaywrightTestingNameUnavailableReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PlaywrightTestingNameUnavailableReason other && Equals(other); + /// + public bool Equals(PlaywrightTestingNameUnavailableReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingOfferingType.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingOfferingType.cs new file mode 100644 index 000000000000..fa2c55e8dcec --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingOfferingType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// Offering type state. + public readonly partial struct PlaywrightTestingOfferingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PlaywrightTestingOfferingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotApplicableValue = "NotApplicable"; + private const string PrivatePreviewValue = "PrivatePreview"; + private const string PublicPreviewValue = "PublicPreview"; + private const string GeneralAvailabilityValue = "GeneralAvailability"; + + /// The offeringType is NotApplicable. + public static PlaywrightTestingOfferingType NotApplicable { get; } = new PlaywrightTestingOfferingType(NotApplicableValue); + /// The offeringType is PrivatePreview. + public static PlaywrightTestingOfferingType PrivatePreview { get; } = new PlaywrightTestingOfferingType(PrivatePreviewValue); + /// The offeringType is PublicPreview. + public static PlaywrightTestingOfferingType PublicPreview { get; } = new PlaywrightTestingOfferingType(PublicPreviewValue); + /// The offeringType is GeneralAvailability. + public static PlaywrightTestingOfferingType GeneralAvailability { get; } = new PlaywrightTestingOfferingType(GeneralAvailabilityValue); + /// Determines if two values are the same. + public static bool operator ==(PlaywrightTestingOfferingType left, PlaywrightTestingOfferingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PlaywrightTestingOfferingType left, PlaywrightTestingOfferingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PlaywrightTestingOfferingType(string value) => new PlaywrightTestingOfferingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PlaywrightTestingOfferingType other && Equals(other); + /// + public bool Equals(PlaywrightTestingOfferingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingProvisioningState.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingProvisioningState.cs index 2e47e5a29821..ef32459a5c55 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingProvisioningState.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingProvisioningState.cs @@ -25,6 +25,7 @@ public PlaywrightTestingProvisioningState(string value) private const string SucceededValue = "Succeeded"; private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; private const string DeletingValue = "Deleting"; private const string AcceptedValue = "Accepted"; @@ -34,9 +35,11 @@ public PlaywrightTestingProvisioningState(string value) public static PlaywrightTestingProvisioningState Failed { get; } = new PlaywrightTestingProvisioningState(FailedValue); /// Resource creation was canceled. public static PlaywrightTestingProvisioningState Canceled { get; } = new PlaywrightTestingProvisioningState(CanceledValue); - /// Deletion in progress. + /// Creation in progress.. + public static PlaywrightTestingProvisioningState Creating { get; } = new PlaywrightTestingProvisioningState(CreatingValue); + /// Deletion in progress.. public static PlaywrightTestingProvisioningState Deleting { get; } = new PlaywrightTestingProvisioningState(DeletingValue); - /// Change accepted for processing. + /// Change accepted for processing.. public static PlaywrightTestingProvisioningState Accepted { get; } = new PlaywrightTestingProvisioningState(AcceptedValue); /// Determines if two values are the same. public static bool operator ==(PlaywrightTestingProvisioningState left, PlaywrightTestingProvisioningState right) => left.Equals(right); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaName.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaName.cs index ec70470da0d0..6c80598cdb8a 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaName.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaName.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.PlaywrightTesting.Models { - /// The PlaywrightTestingQuotaName. + /// The enum for quota name. public readonly partial struct PlaywrightTestingQuotaName : IEquatable { private readonly string _value; @@ -23,9 +23,12 @@ public PlaywrightTestingQuotaName(string value) } private const string ScalableExecutionValue = "ScalableExecution"; + private const string ReportingValue = "Reporting"; /// The quota details for scalable execution feature. When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. public static PlaywrightTestingQuotaName ScalableExecution { get; } = new PlaywrightTestingQuotaName(ScalableExecutionValue); + /// The quota details for reporting feature. When enabled, Playwright client will be able to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + public static PlaywrightTestingQuotaName Reporting { get; } = new PlaywrightTestingQuotaName(ReportingValue); /// Determines if two values are the same. public static bool operator ==(PlaywrightTestingQuotaName left, PlaywrightTestingQuotaName right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaProperties.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaProperties.Serialization.cs new file mode 100644 index 000000000000..a48fbf1ed9f4 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + public partial class PlaywrightTestingQuotaProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingQuotaProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FreeTrial)) + { + writer.WritePropertyName("freeTrial"u8); + writer.WriteObjectValue(FreeTrial, options); + } + if (options.Format != "W" && Optional.IsDefined(OfferingType)) + { + writer.WritePropertyName("offeringType"u8); + writer.WriteStringValue(OfferingType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlaywrightTestingQuotaProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingQuotaProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingQuotaProperties(document.RootElement, options); + } + + internal static PlaywrightTestingQuotaProperties DeserializePlaywrightTestingQuotaProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlaywrightTestingFreeTrialProperties freeTrial = default; + PlaywrightTestingOfferingType? offeringType = default; + PlaywrightTestingProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("freeTrial"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + freeTrial = PlaywrightTestingFreeTrialProperties.DeserializePlaywrightTestingFreeTrialProperties(property.Value, options); + continue; + } + if (property.NameEquals("offeringType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offeringType = new PlaywrightTestingOfferingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new PlaywrightTestingProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingQuotaProperties(freeTrial, offeringType, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingQuotaProperties)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingQuotaProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingQuotaProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingQuotaProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaProperties.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaProperties.cs new file mode 100644 index 000000000000..79c32aa77660 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/Models/PlaywrightTestingQuotaProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlaywrightTesting.Models +{ + /// The subscription quota resource properties. + public partial class PlaywrightTestingQuotaProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PlaywrightTestingQuotaProperties() + { + } + + /// Initializes a new instance of . + /// The subscription quota resource free-trial properties. + /// Indicates the offering type for the subscription. + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingQuotaProperties(PlaywrightTestingFreeTrialProperties freeTrial, PlaywrightTestingOfferingType? offeringType, PlaywrightTestingProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + FreeTrial = freeTrial; + OfferingType = offeringType; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The subscription quota resource free-trial properties. + public PlaywrightTestingFreeTrialProperties FreeTrial { get; } + /// Indicates the offering type for the subscription. + public PlaywrightTestingOfferingType? OfferingType { get; } + /// The status of the last operation. + public PlaywrightTestingProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountCollection.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountCollection.cs index a8972bf5fbf5..0f30335e26c2 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountCollection.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountCollection.cs @@ -57,15 +57,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_CreateOrUpdate + /// Account_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -74,22 +74,22 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// 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. - /// Name of account. + /// Name of account. /// Resource create parameters. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string accountName, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _playwrightTestingAccountAccountsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken).ConfigureAwait(false); - var operation = new PlaywrightTestingArmOperation(new PlaywrightTestingAccountOperationSource(Client), _playwrightTestingAccountAccountsClientDiagnostics, Pipeline, _playwrightTestingAccountAccountsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _playwrightTestingAccountAccountsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, data, cancellationToken).ConfigureAwait(false); + var operation = new PlaywrightTestingArmOperation(new PlaywrightTestingAccountOperationSource(Client), _playwrightTestingAccountAccountsClientDiagnostics, Pipeline, _playwrightTestingAccountAccountsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, accountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -106,15 +106,15 @@ public virtual async Task> Create /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_CreateOrUpdate + /// Account_CreateOrUpdate /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -123,22 +123,22 @@ public virtual async Task> Create /// /// /// 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. - /// Name of account. + /// Name of account. /// Resource create parameters. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string accountName, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.CreateOrUpdate"); scope.Start(); try { - var response = _playwrightTestingAccountAccountsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken); - var operation = new PlaywrightTestingArmOperation(new PlaywrightTestingAccountOperationSource(Client), _playwrightTestingAccountAccountsClientDiagnostics, Pipeline, _playwrightTestingAccountAccountsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _playwrightTestingAccountAccountsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, accountName, data, cancellationToken); + var operation = new PlaywrightTestingArmOperation(new PlaywrightTestingAccountOperationSource(Client), _playwrightTestingAccountAccountsClientDiagnostics, Pipeline, _playwrightTestingAccountAccountsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, accountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -155,15 +155,15 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -171,19 +171,19 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.Get"); scope.Start(); try { - var response = await _playwrightTestingAccountAccountsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingAccountAccountsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingAccountResource(Client, response.Value), response.GetRawResponse()); @@ -200,15 +200,15 @@ public virtual async Task> GetAsync(s /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -216,19 +216,19 @@ public virtual async Task> GetAsync(s /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string name, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.Get"); scope.Start(); try { - var response = _playwrightTestingAccountAccountsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken); + var response = _playwrightTestingAccountAccountsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingAccountResource(Client, response.Value), response.GetRawResponse()); @@ -249,11 +249,11 @@ public virtual Response Get(string name, Cance /// /// /// Operation Id - /// Accounts_ListByResourceGroup + /// Account_ListByResourceGroup /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Operation Id - /// Accounts_ListByResourceGroup + /// Account_ListByResourceGroup /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -305,15 +305,15 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -321,19 +321,19 @@ public virtual Pageable GetAll(CancellationTok /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.Exists"); scope.Start(); try { - var response = await _playwrightTestingAccountAccountsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingAccountAccountsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -348,15 +348,15 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -364,19 +364,19 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string name, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.Exists"); scope.Start(); try { - var response = _playwrightTestingAccountAccountsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + var response = _playwrightTestingAccountAccountsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -391,15 +391,15 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -407,19 +407,19 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.GetIfExists"); scope.Start(); try { - var response = await _playwrightTestingAccountAccountsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingAccountAccountsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingAccountResource(Client, response.Value), response.GetRawResponse()); @@ -436,15 +436,15 @@ public virtual async Task> Ge /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -452,19 +452,19 @@ public virtual async Task> Ge /// /// /// - /// Name of account. + /// Name of account. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); using var scope = _playwrightTestingAccountAccountsClientDiagnostics.CreateScope("PlaywrightTestingAccountCollection.GetIfExists"); scope.Start(); try { - var response = _playwrightTestingAccountAccountsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + var response = _playwrightTestingAccountAccountsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingAccountResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.Serialization.cs index 060b4ff212bc..5aa13413d2e7 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.Serialization.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.Serialization.cs @@ -37,34 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(DashboardUri)) - { - writer.WritePropertyName("dashboardUri"u8); - writer.WriteStringValue(DashboardUri.AbsoluteUri); - } - if (Optional.IsDefined(RegionalAffinity)) - { - writer.WritePropertyName("regionalAffinity"u8); - writer.WriteStringValue(RegionalAffinity.Value.ToString()); - } - if (Optional.IsDefined(ScalableExecution)) - { - writer.WritePropertyName("scalableExecution"u8); - writer.WriteStringValue(ScalableExecution.Value.ToString()); - } - if (Optional.IsDefined(Reporting)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("reporting"u8); - writer.WriteStringValue(Reporting.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - writer.WriteEndObject(); } PlaywrightTestingAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -87,21 +64,26 @@ internal static PlaywrightTestingAccountData DeserializePlaywrightTestingAccount { return null; } + PlaywrightTestingAccountProperties properties = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - Uri dashboardUri = default; - EnablementStatus? regionalAffinity = default; - EnablementStatus? scalableExecution = default; - EnablementStatus? reporting = default; - PlaywrightTestingProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = PlaywrightTestingAccountProperties.DeserializePlaywrightTestingAccountProperties(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -145,63 +127,6 @@ internal static PlaywrightTestingAccountData DeserializePlaywrightTestingAccount systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("dashboardUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dashboardUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("regionalAffinity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - regionalAffinity = new EnablementStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scalableExecution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scalableExecution = new EnablementStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("reporting"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - reporting = new EnablementStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new PlaywrightTestingProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -215,11 +140,7 @@ internal static PlaywrightTestingAccountData DeserializePlaywrightTestingAccount systemData, tags ?? new ChangeTrackingDictionary(), location, - dashboardUri, - regionalAffinity, - scalableExecution, - reporting, - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.cs index a52fd81e34f6..599008a12c6a 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.PlaywrightTesting { /// /// A class representing the PlaywrightTestingAccount data model. - /// An account resource + /// A Playwright service account resource. /// public partial class PlaywrightTestingAccountData : TrackedResourceData { @@ -64,19 +64,11 @@ public PlaywrightTestingAccountData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// The Playwright testing dashboard URI for the account resource. - /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. - /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. - /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. - /// The status of the last operation. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal PlaywrightTestingAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, Uri dashboardUri, EnablementStatus? regionalAffinity, EnablementStatus? scalableExecution, EnablementStatus? reporting, PlaywrightTestingProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal PlaywrightTestingAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PlaywrightTestingAccountProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - DashboardUri = dashboardUri; - RegionalAffinity = regionalAffinity; - ScalableExecution = scalableExecution; - Reporting = reporting; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -85,15 +77,7 @@ internal PlaywrightTestingAccountData() { } - /// The Playwright testing dashboard URI for the account resource. - public Uri DashboardUri { get; } - /// This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. - public EnablementStatus? RegionalAffinity { get; set; } - /// When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. - public EnablementStatus? ScalableExecution { get; set; } - /// When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. - public EnablementStatus? Reporting { get; set; } - /// The status of the last operation. - public PlaywrightTestingProvisioningState? ProvisioningState { get; } + /// The resource-specific properties for this resource. + public PlaywrightTestingAccountProperties Properties { get; set; } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaCollection.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaCollection.cs new file mode 100644 index 000000000000..2f561bc56cbd --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaCollection.cs @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.PlaywrightTesting.Models; + +namespace Azure.ResourceManager.PlaywrightTesting +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetPlaywrightTestingAccountQuotas method from an instance of . + /// + public partial class PlaywrightTestingAccountQuotaCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics; + private readonly AccountQuotasRestOperations _playwrightTestingAccountQuotaAccountQuotasRestClient; + + /// Initializes a new instance of the class for mocking. + protected PlaywrightTestingAccountQuotaCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal PlaywrightTestingAccountQuotaCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlaywrightTesting", PlaywrightTestingAccountQuotaResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PlaywrightTestingAccountQuotaResource.ResourceType, out string playwrightTestingAccountQuotaAccountQuotasApiVersion); + _playwrightTestingAccountQuotaAccountQuotasRestClient = new AccountQuotasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, playwrightTestingAccountQuotaAccountQuotasApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != PlaywrightTestingAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, PlaywrightTestingAccountResource.ResourceType), nameof(id)); + } + + /// + /// Get quota by name for an account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + public virtual async Task> GetAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaCollection.Get"); + scope.Start(); + try + { + var response = await _playwrightTestingAccountQuotaAccountQuotasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, quotaName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PlaywrightTestingAccountQuotaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get quota by name for an account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + public virtual Response Get(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaCollection.Get"); + scope.Start(); + try + { + var response = _playwrightTestingAccountQuotaAccountQuotasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, quotaName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PlaywrightTestingAccountQuotaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List quotas for a given account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas + /// + /// + /// Operation Id + /// AccountQuota_ListByAccount + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _playwrightTestingAccountQuotaAccountQuotasRestClient.CreateListByAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _playwrightTestingAccountQuotaAccountQuotasRestClient.CreateListByAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PlaywrightTestingAccountQuotaResource(Client, PlaywrightTestingAccountQuotaData.DeserializePlaywrightTestingAccountQuotaData(e)), _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics, Pipeline, "PlaywrightTestingAccountQuotaCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List quotas for a given account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas + /// + /// + /// Operation Id + /// AccountQuota_ListByAccount + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _playwrightTestingAccountQuotaAccountQuotasRestClient.CreateListByAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _playwrightTestingAccountQuotaAccountQuotasRestClient.CreateListByAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PlaywrightTestingAccountQuotaResource(Client, PlaywrightTestingAccountQuotaData.DeserializePlaywrightTestingAccountQuotaData(e)), _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics, Pipeline, "PlaywrightTestingAccountQuotaCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + public virtual async Task> ExistsAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaCollection.Exists"); + scope.Start(); + try + { + var response = await _playwrightTestingAccountQuotaAccountQuotasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, quotaName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + public virtual Response Exists(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaCollection.Exists"); + scope.Start(); + try + { + var response = _playwrightTestingAccountQuotaAccountQuotasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, quotaName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + public virtual async Task> GetIfExistsAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _playwrightTestingAccountQuotaAccountQuotasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, quotaName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PlaywrightTestingAccountQuotaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + public virtual NullableResponse GetIfExists(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaCollection.GetIfExists"); + scope.Start(); + try + { + var response = _playwrightTestingAccountQuotaAccountQuotasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, quotaName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PlaywrightTestingAccountQuotaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaData.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaData.Serialization.cs new file mode 100644 index 000000000000..1413bf1aa4d3 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PlaywrightTesting.Models; + +namespace Azure.ResourceManager.PlaywrightTesting +{ + public partial class PlaywrightTestingAccountQuotaData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + PlaywrightTestingAccountQuotaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlaywrightTestingAccountQuotaData(document.RootElement, options); + } + + internal static PlaywrightTestingAccountQuotaData DeserializePlaywrightTestingAccountQuotaData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlaywrightTestingAccountQuotaProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = PlaywrightTestingAccountQuotaProperties.DeserializePlaywrightTestingAccountQuotaProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlaywrightTestingAccountQuotaData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaData)} does not support writing '{options.Format}' format."); + } + } + + PlaywrightTestingAccountQuotaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePlaywrightTestingAccountQuotaData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlaywrightTestingAccountQuotaData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaData.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaData.cs new file mode 100644 index 000000000000..2c978269e3d3 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PlaywrightTesting.Models; + +namespace Azure.ResourceManager.PlaywrightTesting +{ + /// + /// A class representing the PlaywrightTestingAccountQuota data model. + /// A quota resource for a Playwright service account. + /// + public partial class PlaywrightTestingAccountQuotaData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PlaywrightTestingAccountQuotaData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal PlaywrightTestingAccountQuotaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PlaywrightTestingAccountQuotaProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public PlaywrightTestingAccountQuotaProperties Properties { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaResource.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaResource.Serialization.cs new file mode 100644 index 000000000000..82d6080bcc56 --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.PlaywrightTesting +{ + public partial class PlaywrightTestingAccountQuotaResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PlaywrightTestingAccountQuotaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + PlaywrightTestingAccountQuotaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaResource.cs new file mode 100644 index 000000000000..122f15bb738b --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountQuotaResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.PlaywrightTesting.Models; + +namespace Azure.ResourceManager.PlaywrightTesting +{ + /// + /// A Class representing a PlaywrightTestingAccountQuota along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetPlaywrightTestingAccountQuotaResource method. + /// Otherwise you can get one from its parent resource using the GetPlaywrightTestingAccountQuota method. + /// + public partial class PlaywrightTestingAccountQuotaResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The quotaName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingQuotaName quotaName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics; + private readonly AccountQuotasRestOperations _playwrightTestingAccountQuotaAccountQuotasRestClient; + private readonly PlaywrightTestingAccountQuotaData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AzurePlaywrightService/accounts/quotas"; + + /// Initializes a new instance of the class for mocking. + protected PlaywrightTestingAccountQuotaResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PlaywrightTestingAccountQuotaResource(ArmClient client, PlaywrightTestingAccountQuotaData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal PlaywrightTestingAccountQuotaResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlaywrightTesting", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string playwrightTestingAccountQuotaAccountQuotasApiVersion); + _playwrightTestingAccountQuotaAccountQuotasRestClient = new AccountQuotasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, playwrightTestingAccountQuotaAccountQuotasApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual PlaywrightTestingAccountQuotaData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get quota by name for an account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaResource.Get"); + scope.Start(); + try + { + var response = await _playwrightTestingAccountQuotaAccountQuotasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PlaywrightTestingAccountQuotaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get quota by name for an account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _playwrightTestingAccountQuotaAccountQuotasClientDiagnostics.CreateScope("PlaywrightTestingAccountQuotaResource.Get"); + scope.Start(); + try + { + var response = _playwrightTestingAccountQuotaAccountQuotasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PlaywrightTestingAccountQuotaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountResource.cs index c0142b77e95d..0b9bdec6c3ad 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountResource.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingAccountResource.cs @@ -28,10 +28,10 @@ public partial class PlaywrightTestingAccountResource : ArmResource /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. - /// The name. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + /// The accountName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}"; return new ResourceIdentifier(resourceId); } @@ -90,20 +90,85 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of PlaywrightTestingAccountQuotaResources in the PlaywrightTestingAccount. + /// An object representing collection of PlaywrightTestingAccountQuotaResources and their operations over a PlaywrightTestingAccountQuotaResource. + public virtual PlaywrightTestingAccountQuotaCollection GetAllPlaywrightTestingAccountQuota() + { + return GetCachedClient(client => new PlaywrightTestingAccountQuotaCollection(client, Id)); + } + + /// + /// Get quota by name for an account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetPlaywrightTestingAccountQuotaAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + return await GetAllPlaywrightTestingAccountQuota().GetAsync(quotaName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get quota by name for an account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName} + /// + /// + /// Operation Id + /// AccountQuota_Get + /// + /// + /// Default Api Version + /// 2024-12-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The Playwright service account quota name. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetPlaywrightTestingAccountQuota(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + return GetAllPlaywrightTestingAccountQuota().Get(quotaName, cancellationToken); + } + /// /// Get a Account /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -135,15 +200,15 @@ public virtual async Task> GetAsync(C /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -175,15 +240,15 @@ public virtual Response Get(CancellationToken /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Delete + /// Account_Delete /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -217,15 +282,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Delete + /// Account_Delete /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -259,15 +324,15 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Update + /// Account_Update /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -301,15 +366,15 @@ public virtual async Task> UpdateAsyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Update + /// Account_Update /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -343,15 +408,15 @@ public virtual Response Update(PlaywrightTesti /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -405,15 +470,15 @@ public virtual async Task> AddTagAsyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -467,15 +532,15 @@ public virtual Response AddTag(string key, str /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -524,15 +589,15 @@ public virtual async Task> SetTagsAsy /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -581,15 +646,15 @@ public virtual Response SetTags(IDictionary /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -641,15 +706,15 @@ public virtual async Task> RemoveTagA /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName} /// /// /// Operation Id - /// Accounts_Get + /// Account_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaCollection.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaCollection.cs index 46c3f62e9537..85292fdfd9f4 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaCollection.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaCollection.cs @@ -28,7 +28,7 @@ public partial class PlaywrightTestingQuotaCollection : ArmCollection, IEnumerab { private readonly ClientDiagnostics _playwrightTestingQuotaQuotasClientDiagnostics; private readonly QuotasRestOperations _playwrightTestingQuotaQuotasRestClient; - private readonly AzureLocation _location; + private readonly string _location; /// Initializes a new instance of the class for mocking. protected PlaywrightTestingQuotaCollection() @@ -39,7 +39,9 @@ protected PlaywrightTestingQuotaCollection() /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - internal PlaywrightTestingQuotaCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + /// is null. + /// is an empty string, and was expected to be non-empty. + internal PlaywrightTestingQuotaCollection(ArmClient client, ResourceIdentifier id, string location) : base(client, id) { _location = location; _playwrightTestingQuotaQuotasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlaywrightTesting", PlaywrightTestingQuotaResource.ResourceType.Namespace, Diagnostics); @@ -57,19 +59,19 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -77,15 +79,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// - /// The quota name. + /// The quota name. /// The cancellation token to use. - public virtual async Task> GetAsync(PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { using var scope = _playwrightTestingQuotaQuotasClientDiagnostics.CreateScope("PlaywrightTestingQuotaCollection.Get"); scope.Start(); try { - var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), name, cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, _location, quotaName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingQuotaResource(Client, response.Value), response.GetRawResponse()); @@ -98,19 +100,19 @@ public virtual async Task> GetAsync(Pla } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -118,15 +120,15 @@ public virtual async Task> GetAsync(Pla /// /// /// - /// The quota name. + /// The quota name. /// The cancellation token to use. - public virtual Response Get(PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual Response Get(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { using var scope = _playwrightTestingQuotaQuotasClientDiagnostics.CreateScope("PlaywrightTestingQuotaCollection.Get"); scope.Start(); try { - var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), name, cancellationToken); + var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, _location, quotaName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingQuotaResource(Client, response.Value), response.GetRawResponse()); @@ -147,11 +149,11 @@ public virtual Response Get(PlaywrightTestingQuo /// /// /// Operation Id - /// Quotas_ListBySubscription + /// Quota_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -163,8 +165,8 @@ public virtual Response Get(PlaywrightTestingQuo /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage FirstPageRequest(int? pageSizeHint) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, _location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, _location); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PlaywrightTestingQuotaResource(Client, PlaywrightTestingQuotaData.DeserializePlaywrightTestingQuotaData(e)), _playwrightTestingQuotaQuotasClientDiagnostics, Pipeline, "PlaywrightTestingQuotaCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -177,11 +179,11 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Operation Id - /// Quotas_ListBySubscription + /// Quota_ListBySubscription /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -193,8 +195,8 @@ public virtual AsyncPageable GetAllAsync(Cancell /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage FirstPageRequest(int? pageSizeHint) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, _location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _playwrightTestingQuotaQuotasRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, _location); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PlaywrightTestingQuotaResource(Client, PlaywrightTestingQuotaData.DeserializePlaywrightTestingQuotaData(e)), _playwrightTestingQuotaQuotasClientDiagnostics, Pipeline, "PlaywrightTestingQuotaCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -203,15 +205,15 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -219,15 +221,15 @@ public virtual Pageable GetAll(CancellationToken /// /// /// - /// The quota name. + /// The quota name. /// The cancellation token to use. - public virtual async Task> ExistsAsync(PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual async Task> ExistsAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { using var scope = _playwrightTestingQuotaQuotasClientDiagnostics.CreateScope("PlaywrightTestingQuotaCollection.Exists"); scope.Start(); try { - var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, _location, quotaName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -242,15 +244,15 @@ public virtual async Task> ExistsAsync(PlaywrightTestingQuotaName /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -258,15 +260,15 @@ public virtual async Task> ExistsAsync(PlaywrightTestingQuotaName /// /// /// - /// The quota name. + /// The quota name. /// The cancellation token to use. - public virtual Response Exists(PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual Response Exists(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { using var scope = _playwrightTestingQuotaQuotasClientDiagnostics.CreateScope("PlaywrightTestingQuotaCollection.Exists"); scope.Start(); try { - var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), name, cancellationToken: cancellationToken); + var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, _location, quotaName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -281,15 +283,15 @@ public virtual Response Exists(PlaywrightTestingQuotaName name, Cancellati /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -297,15 +299,15 @@ public virtual Response Exists(PlaywrightTestingQuotaName name, Cancellati /// /// /// - /// The quota name. + /// The quota name. /// The cancellation token to use. - public virtual async Task> GetIfExistsAsync(PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { using var scope = _playwrightTestingQuotaQuotasClientDiagnostics.CreateScope("PlaywrightTestingQuotaCollection.GetIfExists"); scope.Start(); try { - var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, _location, quotaName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingQuotaResource(Client, response.Value), response.GetRawResponse()); @@ -322,15 +324,15 @@ public virtual async Task> GetI /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -338,15 +340,15 @@ public virtual async Task> GetI /// /// /// - /// The quota name. + /// The quota name. /// The cancellation token to use. - public virtual NullableResponse GetIfExists(PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { using var scope = _playwrightTestingQuotaQuotasClientDiagnostics.CreateScope("PlaywrightTestingQuotaCollection.GetIfExists"); scope.Start(); try { - var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), name, cancellationToken: cancellationToken); + var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, _location, quotaName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingQuotaResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.Serialization.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.Serialization.cs index 88de95a31d92..fcb4a96dfe0f 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.Serialization.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.Serialization.cs @@ -37,19 +37,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(FreeTrial)) - { - writer.WritePropertyName("freeTrial"u8); - writer.WriteObjectValue(FreeTrial, options); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - writer.WriteEndObject(); } PlaywrightTestingQuotaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -72,16 +64,24 @@ internal static PlaywrightTestingQuotaData DeserializePlaywrightTestingQuotaData { return null; } + PlaywrightTestingQuotaProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - FreeTrialProperties freeTrial = default; - PlaywrightTestingProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = PlaywrightTestingQuotaProperties.DeserializePlaywrightTestingQuotaProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -106,36 +106,6 @@ internal static PlaywrightTestingQuotaData DeserializePlaywrightTestingQuotaData systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("freeTrial"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - freeTrial = FreeTrialProperties.DeserializeFreeTrialProperties(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new PlaywrightTestingProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -147,8 +117,7 @@ internal static PlaywrightTestingQuotaData DeserializePlaywrightTestingQuotaData name, type, systemData, - freeTrial, - provisioningState, + properties, serializedAdditionalRawData); } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.cs index 3fa5e8103e20..055e48773351 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.PlaywrightTesting { /// /// A class representing the PlaywrightTestingQuota data model. - /// A quota resource + /// A subscription quota resource. /// public partial class PlaywrightTestingQuotaData : ResourceData { @@ -52,7 +52,7 @@ public partial class PlaywrightTestingQuotaData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public PlaywrightTestingQuotaData() + internal PlaywrightTestingQuotaData() { } @@ -61,19 +61,15 @@ public PlaywrightTestingQuotaData() /// The name. /// The resourceType. /// The systemData. - /// The free-trial quota. - /// The status of the last operation. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal PlaywrightTestingQuotaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, FreeTrialProperties freeTrial, PlaywrightTestingProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal PlaywrightTestingQuotaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PlaywrightTestingQuotaProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - FreeTrial = freeTrial; - ProvisioningState = provisioningState; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The free-trial quota. - public FreeTrialProperties FreeTrial { get; set; } - /// The status of the last operation. - public PlaywrightTestingProvisioningState? ProvisioningState { get; } + /// The resource-specific properties for this resource. + public PlaywrightTestingQuotaProperties Properties { get; } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaResource.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaResource.cs index 9e0df63a1688..520475a00b75 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaResource.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/PlaywrightTestingQuotaResource.cs @@ -27,10 +27,10 @@ public partial class PlaywrightTestingQuotaResource : ArmResource /// Generate the resource identifier of a instance. /// The subscriptionId. /// The location. - /// The name. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, PlaywrightTestingQuotaName name) + /// The quotaName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, PlaywrightTestingQuotaName quotaName) { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name}"; + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName}"; return new ResourceIdentifier(resourceId); } @@ -90,19 +90,19 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> GetAsync(Can scope.Start(); try { - var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _playwrightTestingQuotaQuotasRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingQuotaResource(Client, response.Value), response.GetRawResponse()); @@ -130,19 +130,19 @@ public virtual async Task> GetAsync(Can } /// - /// Get quota by name. + /// Get subscription quota by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name} + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName} /// /// /// Operation Id - /// Quotas_Get + /// Quota_Get /// /// /// Default Api Version - /// 2023-10-01-preview + /// 2024-12-01 /// /// /// Resource @@ -157,7 +157,7 @@ public virtual Response Get(CancellationToken ca scope.Start(); try { - var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var response = _playwrightTestingQuotaQuotasRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new PlaywrightTestingQuotaResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountQuotasRestOperations.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountQuotasRestOperations.cs new file mode 100644 index 000000000000..a81831f6b1ba --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountQuotasRestOperations.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.PlaywrightTesting.Models; + +namespace Azure.ResourceManager.PlaywrightTesting +{ + internal partial class AccountQuotasRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AccountQuotasRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public AccountQuotasRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-12-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingQuotaName quotaName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/quotas/", false); + uri.AppendPath(quotaName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingQuotaName quotaName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/quotas/", false); + uri.AppendPath(quotaName.ToString(), true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get quota by name for an account. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// The Playwright service account quota name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, quotaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PlaywrightTestingAccountQuotaData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PlaywrightTestingAccountQuotaData.DeserializePlaywrightTestingAccountQuotaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PlaywrightTestingAccountQuotaData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get quota by name for an account. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// The Playwright service account quota name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, quotaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PlaywrightTestingAccountQuotaData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PlaywrightTestingAccountQuotaData.DeserializePlaywrightTestingAccountQuotaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PlaywrightTestingAccountQuotaData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAccountRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/quotas", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAccountRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/quotas", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List quotas for a given account. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAccountAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByAccountRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AccountQuotaListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountQuotaListResult.DeserializeAccountQuotaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List quotas for a given account. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAccount(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByAccountRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AccountQuotaListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountQuotaListResult.DeserializeAccountQuotaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAccountNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAccountNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List quotas for a given account. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAccountNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AccountQuotaListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountQuotaListResult.DeserializeAccountQuotaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List quotas for a given account. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAccountNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AccountQuotaListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountQuotaListResult.DeserializeAccountQuotaListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountsRestOperations.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountsRestOperations.cs index 3a09ccf89ae7..c5c311d28ceb 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountsRestOperations.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/AccountsRestOperations.cs @@ -25,29 +25,32 @@ internal partial class AccountsRestOperations /// Initializes a new instance of AccountsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public AccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01-preview"; + _apiVersion = apiVersion ?? "2024-12-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -56,7 +59,10 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -64,57 +70,69 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// List Account resources by subscription ID. - /// The ID of the target subscription. + /// Get a Account. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccountListResult value = default; + PlaywrightTestingAccountData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccountListResult.DeserializeAccountListResult(document.RootElement); + value = PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((PlaywrightTestingAccountData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List Account resources by subscription ID. - /// The ID of the target subscription. + /// Get a Account. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of account. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccountListResult value = default; + PlaywrightTestingAccountData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccountListResult.DeserializeAccountListResult(document.RootElement); + value = PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((PlaywrightTestingAccountData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -122,85 +140,91 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// List Account resources by resource group. - /// The ID of the target subscription. + /// Create a Account. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// Resource create parameters. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, accountName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - AccountListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccountListResult.DeserializeAccountListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List Account resources by resource group. - /// The ID of the target subscription. + /// Create a Account. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// Name of account. + /// Resource create parameters. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, accountName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - AccountListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccountListResult.DeserializeAccountListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -209,16 +233,16 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -226,28 +250,34 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Get a Account. - /// The ID of the target subscription. + /// Update a Account. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of account. + /// Name of account. + /// The resource properties to be updated. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -258,27 +288,27 @@ public async Task> GetAsync(string subscr value = PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((PlaywrightTestingAccountData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Account. - /// The ID of the target subscription. + /// Update a Account. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of account. + /// Name of account. + /// The resource properties to be updated. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string accountName, PlaywrightTestingAccountPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -289,14 +319,12 @@ public Response Get(string subscriptionId, string value = PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((PlaywrightTestingAccountData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountData data) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -305,16 +333,16 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountData data) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -322,73 +350,65 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath(accountName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create a Account. - /// The ID of the target subscription. + /// Delete a Account. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of account. - /// Resource create parameters. + /// Name of account. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - case 201: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Create a Account. - /// The ID of the target subscription. + /// Delete a Account. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of account. - /// Resource create parameters. + /// Name of account. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - case 201: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountPatch patch) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -396,60 +416,50 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountPatch patch) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update a Account. - /// The ID of the target subscription. + /// List Account resources by resource group. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of account. - /// The resource properties to be updated. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountPatch patch, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - PlaywrightTestingAccountData value = default; + AccountListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(document.RootElement); + value = AccountListResult.DeserializeAccountListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -457,30 +467,26 @@ public async Task> UpdateAsync(string sub } } - /// Update a Account. - /// The ID of the target subscription. + /// List Account resources by resource group. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// Name of account. - /// The resource properties to be updated. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string name, PlaywrightTestingAccountPatch patch, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - PlaywrightTestingAccountData value = default; + AccountListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PlaywrightTestingAccountData.DeserializePlaywrightTestingAccountData(document.RootElement); + value = AccountListResult.DeserializeAccountListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -488,33 +494,27 @@ public Response Update(string subscriptionId, stri } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts/", false); - uri.AppendPath(name, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -522,100 +522,108 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete a Account. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of account. + /// List Account resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + AccountListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountListResult.DeserializeAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete a Account. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of account. + /// List Account resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + AccountListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountListResult.DeserializeAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateCheckPlaywrightTestingNameAvailabilityRequestUri(string subscriptionId, PlaywrightTestingNameAvailabilityContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateCheckPlaywrightTestingNameAvailabilityRequest(string subscriptionId, PlaywrightTestingNameAvailabilityContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// List Account resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. + /// Adds check global name availability operation, normally used if a resource name must be globally unique. + /// The ID of the target subscription. The value must be an UUID. + /// The CheckAvailability request. /// The cancellation token to use. - /// or is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public async Task> CheckPlaywrightTestingNameAvailabilityAsync(string subscriptionId, PlaywrightTestingNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateCheckPlaywrightTestingNameAvailabilityRequest(subscriptionId, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccountListResult value = default; + PlaywrightTestingNameAvailabilityResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccountListResult.DeserializeAccountListResult(document.RootElement); + value = PlaywrightTestingNameAvailabilityResult.DeserializePlaywrightTestingNameAvailabilityResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -623,26 +631,26 @@ public async Task> ListBySubscriptionNextPageAsync(s } } - /// List Account resources by subscription ID. - /// The URL to the next page of results. - /// The ID of the target subscription. + /// Adds check global name availability operation, normally used if a resource name must be globally unique. + /// The ID of the target subscription. The value must be an UUID. + /// The CheckAvailability request. /// The cancellation token to use. - /// or is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + public Response CheckPlaywrightTestingNameAvailability(string subscriptionId, PlaywrightTestingNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateCheckPlaywrightTestingNameAvailabilityRequest(subscriptionId, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccountListResult value = default; + PlaywrightTestingNameAvailabilityResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccountListResult.DeserializeAccountListResult(document.RootElement); + value = PlaywrightTestingNameAvailabilityResult.DeserializePlaywrightTestingNameAvailabilityResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -674,7 +682,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// List Account resources by resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -703,7 +711,7 @@ public async Task> ListByResourceGroupNextPageAsync( /// List Account resources by resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -729,5 +737,81 @@ public Response ListByResourceGroupNextPage(string nextLink, throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Account resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AccountListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountListResult.DeserializeAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Account resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AccountListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountListResult.DeserializeAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/QuotasRestOperations.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/QuotasRestOperations.cs index 847b5ddbfa83..5a2d9a8afbd4 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/QuotasRestOperations.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/Generated/RestOperations/QuotasRestOperations.cs @@ -25,18 +25,18 @@ internal partial class QuotasRestOperations /// Initializes a new instance of QuotasRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public QuotasRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-01-preview"; + _apiVersion = apiVersion ?? "2024-12-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string location, PlaywrightTestingQuotaName quotaName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,12 +44,13 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/quotas", false); + uri.AppendPath("/quotas/", false); + uri.AppendPath(quotaName.ToString(), true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, AzureLocation location) + internal HttpMessage CreateGetRequest(string subscriptionId, string location, PlaywrightTestingQuotaName quotaName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -60,7 +61,8 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, Azur uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/quotas", false); + uri.AppendPath("/quotas/", false); + uri.AppendPath(quotaName.ToString(), true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -68,59 +70,67 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, Azur return message; } - /// List quotas for a given subscription Id. - /// The ID of the target subscription. + /// Get subscription quota by name. + /// The ID of the target subscription. The value must be an UUID. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. + /// The quota name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string location, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateListBySubscriptionRequest(subscriptionId, location); + using var message = CreateGetRequest(subscriptionId, location, quotaName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - QuotaListResult value = default; + PlaywrightTestingQuotaData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = QuotaListResult.DeserializeQuotaListResult(document.RootElement); + value = PlaywrightTestingQuotaData.DeserializePlaywrightTestingQuotaData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((PlaywrightTestingQuotaData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List quotas for a given subscription Id. - /// The ID of the target subscription. + /// Get subscription quota by name. + /// The ID of the target subscription. The value must be an UUID. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. + /// The quota name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string location, PlaywrightTestingQuotaName quotaName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateListBySubscriptionRequest(subscriptionId, location); + using var message = CreateGetRequest(subscriptionId, location, quotaName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - QuotaListResult value = default; + PlaywrightTestingQuotaData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = QuotaListResult.DeserializeQuotaListResult(document.RootElement); + value = PlaywrightTestingQuotaData.DeserializePlaywrightTestingQuotaData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((PlaywrightTestingQuotaData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, PlaywrightTestingQuotaName name) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string location) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -128,13 +138,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocat uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/quotas/", false); - uri.AppendPath(name.ToString(), true); + uri.AppendPath("/quotas", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, PlaywrightTestingQuotaName name) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string location) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -145,8 +154,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.AzurePlaywrightService/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/quotas/", false); - uri.AppendPath(name.ToString(), true); + uri.AppendPath("/quotas", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -154,65 +162,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat return message; } - /// Get quota by name. - /// The ID of the target subscription. + /// List quotas for a given subscription Id. + /// The ID of the target subscription. The value must be an UUID. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// The quota name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, AzureLocation location, PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateGetRequest(subscriptionId, location, name); + using var message = CreateListBySubscriptionRequest(subscriptionId, location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - PlaywrightTestingQuotaData value = default; + QuotaListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PlaywrightTestingQuotaData.DeserializePlaywrightTestingQuotaData(document.RootElement); + value = QuotaListResult.DeserializeQuotaListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((PlaywrightTestingQuotaData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get quota by name. - /// The ID of the target subscription. + /// List quotas for a given subscription Id. + /// The ID of the target subscription. The value must be an UUID. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. - /// The quota name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, AzureLocation location, PlaywrightTestingQuotaName name, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateGetRequest(subscriptionId, location, name); + using var message = CreateListBySubscriptionRequest(subscriptionId, location); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - PlaywrightTestingQuotaData value = default; + QuotaListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PlaywrightTestingQuotaData.DeserializePlaywrightTestingQuotaData(document.RootElement); + value = QuotaListResult.DeserializeQuotaListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((PlaywrightTestingQuotaData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string location) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -220,7 +224,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string location) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -236,15 +240,16 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// List quotas for a given subscription Id. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -264,15 +269,16 @@ public async Task> ListBySubscriptionNextPageAsync(str /// List quotas for a given subscription Id. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The location of quota in ARM Normalized format like eastus, southeastasia etc. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, location); _pipeline.Send(message, cancellationToken); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/autorest.md b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/autorest.md.bak similarity index 82% rename from sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/autorest.md rename to sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/autorest.md.bak index 88a3b30b223e..3766fca34e24 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/autorest.md +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/src/autorest.md.bak @@ -7,8 +7,8 @@ azure-arm: true csharp: true library-name: PlaywrightTesting namespace: Azure.ResourceManager.PlaywrightTesting -require: https://github.com/Azure/azure-rest-api-specs/blob/1285ef63d84c4bf3dfe42b514451822e1dd6e8fc/specification/playwrighttesting/resource-manager/readme.md -#tag: package-2023-10-01-preview +require: https://github.com/Azure/azure-rest-api-specs/blob/fdcf40595e792db3a048098504a568edc113b881/specification/playwrighttesting/resource-manager/readme.md +#tag: package-2024-12-01 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -24,6 +24,7 @@ use-model-reader-writer: true rename-mapping: Quota: PlaywrightTestingQuotas + CheckNameAvailabilityResponse: PlaywrightTestingNameAvailabilityResult prepend-rp-prefix: - QuotaNames diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Helper/ResourceHelper.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Helper/ResourceHelper.cs index b6df90610702..61a4f54da1b1 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Helper/ResourceHelper.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Helper/ResourceHelper.cs @@ -13,6 +13,7 @@ public class ResourceHelper { public const string RESOURCE_LOCATION = "eastus"; public const string RESOURCE_GROUP_NAME = "sdkRG"; + public const string RESOURCE_GROUP_NAME_TEST = "sdkRG1386"; public const string WORKSPACE_NAME = "testingWS"; } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountOperations.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountOperations.cs index 65dc5c83041b..36e04ac1bdde 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountOperations.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountOperations.cs @@ -54,7 +54,9 @@ public async Task AccountOperationTests() Assert.IsTrue(createResponse.Value.HasData); Assert.AreEqual(ResourceHelper.WORKSPACE_NAME, createResponse.Value.Data.Name); Assert.AreEqual(ResourceHelper.RESOURCE_LOCATION, createResponse.Value.Data.Location.Name); - Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, createResponse.Value.Data.ProvisioningState); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, createResponse.Value.Data.Properties.ProvisioningState); + Assert.IsNotNull(createResponse.Value.Data.Properties.ScalableExecution); + Assert.IsTrue(createResponse.Value.Data.Properties.ScalableExecution == PlaywrightTestingEnablementStatus.Enabled); //GET API Response getResponse = await _accountCollection.GetAsync(ResourceHelper.WORKSPACE_NAME); @@ -64,7 +66,8 @@ public async Task AccountOperationTests() Assert.IsTrue(accountResource.HasData); Assert.AreEqual(ResourceHelper.WORKSPACE_NAME, accountResource.Data.Name); Assert.AreEqual(ResourceHelper.RESOURCE_LOCATION, accountResource.Data.Location.Name); - Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, accountResource.Data.ProvisioningState); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, accountResource.Data.Properties.ProvisioningState); + Assert.IsNotNull(createResponse.Value.Data.Properties.ScalableExecution); //GETALL API List getAllResponse = await _accountCollection.GetAllAsync().ToEnumerableAsync(); @@ -76,7 +79,8 @@ public async Task AccountOperationTests() Assert.IsTrue(resource.HasData); Assert.IsNotNull(resource.Data.Id); Assert.IsNotNull(resource.Data.Name); - Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, resource.Data.ProvisioningState); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, resource.Data.Properties.ProvisioningState); + Assert.IsNotNull(createResponse.Value.Data.Properties.ScalableExecution); } //GET RESOURCE GROUP API @@ -87,22 +91,18 @@ public async Task AccountOperationTests() Assert.IsTrue(accountResource.HasData); Assert.AreEqual(ResourceHelper.WORKSPACE_NAME, accountResource.Data.Name); Assert.AreEqual(ResourceHelper.RESOURCE_LOCATION, accountResource.Data.Location.Name); - Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, accountResource.Data.ProvisioningState); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, accountResource.Data.Properties.ProvisioningState); //UPDATE API - PlaywrightTestingAccountPatch resourcePatchPayload = new PlaywrightTestingAccountPatch - { - RegionalAffinity= EnablementStatus.Enabled, - }; - + PlaywrightTestingAccountPatch resourcePatchPayload = new PlaywrightTestingAccountPatch(); Response updateResponse = await accountResource.UpdateAsync(resourcePatchPayload); PlaywrightTestingAccountResource updateResponseValue = updateResponse.Value; Assert.IsNotNull(updateResponseValue); Assert.IsTrue(updateResponseValue.HasData); Assert.AreEqual(ResourceHelper.WORKSPACE_NAME, updateResponseValue.Data.Name); Assert.AreEqual(ResourceHelper.RESOURCE_LOCATION, updateResponseValue.Data.Location.Name); - Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, updateResponseValue.Data.ProvisioningState); - Assert.IsTrue(updateResponseValue.Data.RegionalAffinity == EnablementStatus.Enabled); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, updateResponseValue.Data.Properties.ProvisioningState); + Assert.IsTrue(updateResponseValue.Data.Properties.RegionalAffinity == PlaywrightTestingEnablementStatus.Enabled); //DELETE API ArmOperation deleteResponse = await updateResponseValue.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountQuotaOperations.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountQuotaOperations.cs new file mode 100644 index 000000000000..3e11ce87961a --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingAccountQuotaOperations.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.PlaywrightTesting.Models; +using Azure.ResourceManager.PlaywrightTesting.Tests.Helper; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlaywrightTesting.Tests.Scenario +{ + public class PlaywrightTestingAccountQuotaOperations : PlaywrightTestingManagementTestBase + { + private PlaywrightTestingAccountQuotaCollection _quotaCollection { get; set; } + private PlaywrightTestingAccountQuotaResource _quotaResource { get; set; } + private PlaywrightTestingAccountQuotaData _quotaData { get; set; } + + public PlaywrightTestingAccountQuotaOperations(bool isAsync) : base(isAsync)//, RecordedTestMode.Record) + { + } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await CreateCommonClient(); + } + + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + ResourceIdentifier playwrightTestingAccountResourceId = PlaywrightTestingAccountResource.CreateResourceIdentifier(subscription.Id.SubscriptionId, ResourceHelper.RESOURCE_GROUP_NAME_TEST, ResourceHelper.WORKSPACE_NAME); + PlaywrightTestingAccountResource playwrightTestingAccount = new PlaywrightTestingAccountResource(Client, playwrightTestingAccountResourceId); + + _quotaCollection = playwrightTestingAccount.GetAllPlaywrightTestingAccountQuota(); + } + + [OneTimeTearDown] + public void Cleanup() + { + CleanupResourceGroups(); + } + + [TestCase] + [RecordedTest] + public async Task AccountQuotaOperationTestsScalable() + { + //GET API + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.ScalableExecution; + + try + { + Response getResponse = await _quotaCollection.GetAsync(quotaName); + Assert.IsNotNull(getResponse, "The response should not be null."); + Assert.IsNotNull(getResponse.Value, "The response value should not be null."); + } + catch (RequestFailedException ex) + { + Assert.AreEqual(404, ex.Status, "Expected a 404 status code."); + Assert.AreEqual("NotFound", ex.ErrorCode, "Expected the error code to be 'NotFound'."); + StringAssert.Contains( + "The data for the account or free-trial was not found. Please check the request and try again.", + ex.Message, + "The error message did not match the expected text." + ); + + Assert.IsTrue(ex.Message.Contains("NotFound"), "The error message should contain 'NotFound'."); + return; + } + + Assert.Fail("Expected a RequestFailedException with a 404 status, but the API returned a valid response."); + + //List API + List listResponse = await _quotaCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(listResponse); + } + + [TestCase] + [RecordedTest] + public async Task AccountQuotaOperationTestsReporting() + { + //GET API + PlaywrightTestingQuotaName quotaName = PlaywrightTestingQuotaName.Reporting; + + try + { + Response getResponse = await _quotaCollection.GetAsync(quotaName); + Assert.IsNotNull(getResponse, "The response should not be null."); + Assert.IsNotNull(getResponse.Value, "The response value should not be null."); + } + catch (RequestFailedException ex) + { + Assert.AreEqual(404, ex.Status, "Expected a 404 status code."); + Assert.AreEqual("NotFound", ex.ErrorCode, "Expected the error code to be 'NotFound'."); + StringAssert.Contains( + "The data for the account or free-trial was not found. Please check the request and try again.", + ex.Message, + "The error message did not match the expected text." + ); + + Assert.IsTrue(ex.Message.Contains("NotFound"), "The error message should contain 'NotFound'."); + return; + } + + Assert.Fail("Expected a RequestFailedException with a 404 status, but the API returned a valid response."); + } + } +} diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingQuotaOperations.cs b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingQuotaOperations.cs index 329bfcf98e12..25afc08171d1 100644 --- a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingQuotaOperations.cs +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tests/Scenario/PlaywrightTestingQuotaOperations.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; +using System.Net; using System.Threading.Tasks; using Azure.Core.TestFramework; using Azure.ResourceManager.PlaywrightTesting.Models; @@ -41,7 +42,7 @@ public void Cleanup() [TestCase] [RecordedTest] - public async Task QuotaOperationTests() + public async Task QuotaOperationTestsScalable() { //GET API Response getResponse = await _quotaCollection.GetAsync(PlaywrightTestingQuotaName.ScalableExecution); @@ -49,9 +50,11 @@ public async Task QuotaOperationTests() Assert.IsNotNull(getResponse.Value); Assert.IsNotNull(getResponse.Value.Data); Assert.IsNotNull(getResponse.Value.Data.Name); + Assert.IsNotNull(getResponse.Value.Data.Properties); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, getResponse.Value.Data.Properties.ProvisioningState); + Assert.IsNotNull(getResponse.Value.Data.Properties.FreeTrial); + Assert.IsNotNull(getResponse.Value.Data.Properties.FreeTrial.AccountId); Assert.AreEqual(PlaywrightTestingQuotaName.ScalableExecution.ToString(), getResponse.Value.Data.Name); - Assert.IsNotNull(getResponse.Value.Data.FreeTrial); - Assert.IsNotNull(getResponse.Value.Data.FreeTrial.AccountId); //List API List listResponse = await _quotaCollection.GetAllAsync().ToEnumerableAsync(); @@ -62,9 +65,26 @@ public async Task QuotaOperationTests() Assert.IsNotNull(resource.Data); Assert.IsNotNull(resource.Data.Name); Assert.IsNotNull(resource.Data.Id); - Assert.IsNotNull(resource.Data.FreeTrial); - Assert.IsNotNull(resource.Data.FreeTrial.AccountId); + Assert.IsNotNull(resource.Data.Properties.FreeTrial); + Assert.IsNotNull(resource.Data.Properties.FreeTrial.AccountId); } } + + [TestCase] + [RecordedTest] + public async Task QuotaOperationTestsReporting() + { + //GET API + Response getResponseReporting = await _quotaCollection.GetAsync(PlaywrightTestingQuotaName.Reporting); + Assert.NotNull(getResponseReporting); + Assert.IsNotNull(getResponseReporting.Value); + Assert.IsNotNull(getResponseReporting.Value.Data); + Assert.IsNotNull(getResponseReporting.Value.Data.Name); + Assert.AreEqual(PlaywrightTestingQuotaName.Reporting.ToString(), getResponseReporting.Value.Data.Name); + Assert.IsNotNull(getResponseReporting.Value.Data.Properties); + Assert.AreEqual(PlaywrightTestingProvisioningState.Succeeded, getResponseReporting.Value.Data.Properties.ProvisioningState); + Assert.IsNotNull(getResponseReporting.Value.Data.Properties.FreeTrial); + Assert.IsNotNull(getResponseReporting.Value.Data.Properties.FreeTrial.AccountId); + } } } diff --git a/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml new file mode 100644 index 000000000000..bfaa02c7b55e --- /dev/null +++ b/sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/playwrighttesting +commit: c39acac0b3b7ceeee03b594a7b49c9bad6b8e9f2 +repo: Azure/azure-rest-api-specs diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/CHANGELOG.md b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/CHANGELOG.md index 0cf4e59beeb2..b5011cd6c9de 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/CHANGELOG.md +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/CHANGELOG.md @@ -95,5 +95,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/README.md b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/README.md index 2dfc6ed97937..e7c584e82da3 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/README.md +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/CHANGELOG.md b/sdk/postgresql/Azure.ResourceManager.PostgreSql/CHANGELOG.md index c9f80cd9ba71..0fe144d32a09 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/CHANGELOG.md +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/CHANGELOG.md @@ -162,8 +162,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -194,4 +194,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/README.md b/sdk/postgresql/Azure.ResourceManager.PostgreSql/README.md index 812821dc012f..55acf4dbe571 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/README.md +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/CHANGELOG.md b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/CHANGELOG.md index 18513751016d..d75f74129ca4 100644 --- a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/CHANGELOG.md +++ b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/CHANGELOG.md @@ -63,4 +63,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/README.md b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/README.md index 14353c4dcbca..121086c5787e 100644 --- a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/README.md +++ b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/CHANGELOG.md b/sdk/privatedns/Azure.ResourceManager.PrivateDns/CHANGELOG.md index 4ad01aa7f6f2..2ef950b6ff9e 100644 --- a/sdk/privatedns/Azure.ResourceManager.PrivateDns/CHANGELOG.md +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/CHANGELOG.md @@ -95,4 +95,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/README.md b/sdk/privatedns/Azure.ResourceManager.PrivateDns/README.md index 6bc08ec81efa..12178f93c2a3 100644 --- a/sdk/privatedns/Azure.ResourceManager.PrivateDns/README.md +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/CHANGELOG.md b/sdk/providerhub/Azure.ResourceManager.ProviderHub/CHANGELOG.md index de69aae43283..1d0133fcb30a 100644 --- a/sdk/providerhub/Azure.ResourceManager.ProviderHub/CHANGELOG.md +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/CHANGELOG.md @@ -48,8 +48,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -80,4 +80,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/README.md b/sdk/providerhub/Azure.ResourceManager.ProviderHub/README.md index 0a3fa5be78d0..b483c639b88b 100644 --- a/sdk/providerhub/Azure.ResourceManager.ProviderHub/README.md +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/purview/Azure.Analytics.Purview.Account/README.md b/sdk/purview/Azure.Analytics.Purview.Account/README.md index 9a902f1c8bc0..ab83a5f9171f 100644 --- a/sdk/purview/Azure.Analytics.Purview.Account/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Account/README.md @@ -102,9 +102,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [account_product_documentation]: https://azure.microsoft.com/services/purview/ [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart -[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[default_cred_ref]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview +[purview_resource]: https://learn.microsoft.com/azure/purview [azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/README.md b/sdk/purview/Azure.Analytics.Purview.Administration/README.md index e1a3417aefc3..6aefb85aa50f 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Administration/README.md @@ -120,9 +120,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [account_product_documentation]: https://azure.microsoft.com/services/purview/ [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart -[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[default_cred_ref]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview +[purview_resource]: https://learn.microsoft.com/azure/purview [azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/purview/Azure.Analytics.Purview.Catalog/README.md b/sdk/purview/Azure.Analytics.Purview.Catalog/README.md index 14e217c09660..8046582638ca 100644 --- a/sdk/purview/Azure.Analytics.Purview.Catalog/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Catalog/README.md @@ -104,12 +104,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source_code]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/purview/Azure.Analytics.Purview.Catalog/src [client_nuget_package]: https://www.nuget.org/packages?q=Azure.Analytics.Purview.Catalog [catalog_service_documentation]: https://azure.microsoft.com/services/purview/ -[catalog_product_documentation]: https://docs.microsoft.com/azure/purview/ +[catalog_product_documentation]: https://learn.microsoft.com/azure/purview/ [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart -[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[default_cred_ref]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/purview/Azure.Analytics.Purview.DataMap/README.md b/sdk/purview/Azure.Analytics.Purview.DataMap/README.md index da87d15abf0f..55ec1a6bd3ae 100644 --- a/sdk/purview/Azure.Analytics.Purview.DataMap/README.md +++ b/sdk/purview/Azure.Analytics.Purview.DataMap/README.md @@ -4,7 +4,7 @@ Microsoft Purview Data Map provides the foundation for data discovery and data g **Please rely heavily on the [service's documentation][catalog_service_documentation] and our [protocol client docs][protocol_client_quickstart] to use this library** -[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/purview/Azure.Analytics.Purview.DataMap/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://learn.microsoft.com/rest/api/purview/datamapdataplane/operation-groups?view=rest-purview-datamapdataplane-2023-09-01) | [Product documentation](https://docs.microsoft.com/azure) +[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/purview/Azure.Analytics.Purview.DataMap/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://learn.microsoft.com/rest/api/purview/datamapdataplane/operation-groups?view=rest-purview-datamapdataplane-2023-09-01) | [Product documentation](https://learn.microsoft.com/azure) ## Getting started @@ -114,15 +114,15 @@ When you submit a pull request, a CLA-bot will automatically determine whether y This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization [style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide -[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[default_cred_ref]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [catalog_service_documentation]: https://azure.microsoft.com/services/purview/ -[catalog_product_documentation]: https://docs.microsoft.com/azure/purview/ +[catalog_product_documentation]: https://learn.microsoft.com/azure/purview/ [protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByName.md b/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByName.md index 43f33001b983..7cfca251fd82 100644 --- a/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByName.md +++ b/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByName.md @@ -6,7 +6,7 @@ This sample demonstrates how to call type related API using `TypeDefinitionClien First we need to create the DataMapClient using `Azure.Identity`. -The [Azure Identity library](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md) provides [role-based access control](https://docs.microsoft.com/azure/role-based-access-control/overview) support for authentication using Azure Active Directory.In order to leverage role-based access control for Service Bus, please refer to the [role-based access control documentation](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-role-based-access-control). The simplest way to get started using the `Azure.Identity` library is to use the [DefaultAzureCredential](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). +The [Azure Identity library](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md) provides [role-based access control](https://learn.microsoft.com/azure/role-based-access-control/overview) support for authentication using Azure Active Directory.In order to leverage role-based access control for Service Bus, please refer to the [role-based access control documentation](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-role-based-access-control). The simplest way to get started using the `Azure.Identity` library is to use the [DefaultAzureCredential](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). ```C# Snippet:CreateDataMapClient Uri endpoint = TestEnvironment.Endpoint; diff --git a/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByNameAsync.md b/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByNameAsync.md index 384c533a0e6b..cef6d45a23d2 100644 --- a/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByNameAsync.md +++ b/sdk/purview/Azure.Analytics.Purview.DataMap/samples/Sample1_GetTypeByNameAsync.md @@ -6,7 +6,7 @@ This sample demonstrates how to call type related API using `TypeDefinitionClien First we need to create the DataMapClient using `Azure.Identity`. -The [Azure Identity library](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md) provides [role-based access control](https://docs.microsoft.com/azure/role-based-access-control/overview) support for authentication using Azure Active Directory.In order to leverage role-based access control for Service Bus, please refer to the [role-based access control documentation](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-role-based-access-control). The simplest way to get started using the `Azure.Identity` library is to use the [DefaultAzureCredential](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). +The [Azure Identity library](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md) provides [role-based access control](https://learn.microsoft.com/azure/role-based-access-control/overview) support for authentication using Azure Active Directory.In order to leverage role-based access control for Service Bus, please refer to the [role-based access control documentation](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-role-based-access-control). The simplest way to get started using the `Azure.Identity` library is to use the [DefaultAzureCredential](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). ```C# Snippet:CreateDataMapClient Uri endpoint = TestEnvironment.Endpoint; diff --git a/sdk/purview/Azure.Analytics.Purview.Scanning/README.md b/sdk/purview/Azure.Analytics.Purview.Scanning/README.md index 6ed8a7461e00..3de1ca0a2b6f 100644 --- a/sdk/purview/Azure.Analytics.Purview.Scanning/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Scanning/README.md @@ -104,12 +104,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source_code]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/purview/Azure.Analytics.Purview.Scanning/src [client_nuget_package]: https://www.nuget.org/packages?q=Azure.Analytics.Purview.Scanning [catalog_service_documentation]: https://azure.microsoft.com/services/purview/ -[catalog_product_documentation]: https://docs.microsoft.com/azure/purview/ +[catalog_product_documentation]: https://learn.microsoft.com/azure/purview/ [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart -[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[default_cred_ref]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/purview/Azure.Analytics.Purview.Sharing/README.md b/sdk/purview/Azure.Analytics.Purview.Sharing/README.md index 7ede43b1b81b..28b5ac7db9c6 100644 --- a/sdk/purview/Azure.Analytics.Purview.Sharing/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Sharing/README.md @@ -380,12 +380,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [source_code]: https://azure.microsoft.com/services/purview/ [client_nuget_package]: https://www.nuget.org/packages?q=Azure.Analytics.Purview.Sharing -[share_product_documentation]: https://docs.microsoft.com/azure/purview/concept-data-share +[share_product_documentation]: https://learn.microsoft.com/azure/purview/concept-data-share [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity [protocol_client_quickstart]: https://aka.ms/azsdk/net/protocol/quickstart -[default_cred_ref]: https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet +[default_cred_ref]: https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview +[purview_resource]: https://learn.microsoft.com/azure/purview [azure_core_diagnostics]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/purview/Azure.Analytics.Purview.Workflows/README.md b/sdk/purview/Azure.Analytics.Purview.Workflows/README.md index 322397a7cb94..705debf43d01 100644 --- a/sdk/purview/Azure.Analytics.Purview.Workflows/README.md +++ b/sdk/purview/Azure.Analytics.Purview.Workflows/README.md @@ -105,7 +105,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [product_documentation]: https://learn.microsoft.com/azure/purview/concept-workflow [azure_subscription]: https://azure.microsoft.com/free/dotnet/ -[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal +[purview_resource]: https://learn.microsoft.com/azure/purview/create-catalog-portal [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md [app_registration]: https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app [username_password_credential]: https://learn.microsoft.com/dotnet/api/azure.identity.usernamepasswordcredential?view=azure-dotnet diff --git a/sdk/purview/Azure.ResourceManager.Purview/CHANGELOG.md b/sdk/purview/Azure.ResourceManager.Purview/CHANGELOG.md index b88990c00a3e..c9b5cd35988f 100644 --- a/sdk/purview/Azure.ResourceManager.Purview/CHANGELOG.md +++ b/sdk/purview/Azure.ResourceManager.Purview/CHANGELOG.md @@ -91,4 +91,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/purview/Azure.ResourceManager.Purview/README.md b/sdk/purview/Azure.ResourceManager.Purview/README.md index 39ceef412054..d62a1ea4cb20 100644 --- a/sdk/purview/Azure.ResourceManager.Purview/README.md +++ b/sdk/purview/Azure.ResourceManager.Purview/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/quantum/Azure.Quantum.Jobs/README.md b/sdk/quantum/Azure.Quantum.Jobs/README.md index 1cb65e9b8da8..f987ae9114a1 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/README.md +++ b/sdk/quantum/Azure.Quantum.Jobs/README.md @@ -4,7 +4,7 @@ Azure Quantum is a Microsoft Azure service that you can use to run quantum compu - Create, enumerate, and cancel quantum jobs - Enumerate provider status and quotas - [Source code][source] | [API reference documentation](https://docs.microsoft.com/qsharp/api/) | [Product documentation](https://docs.microsoft.com/azure/quantum/) + [Source code][source] | [API reference documentation](https://learn.microsoft.com/qsharp/api/) | [Product documentation](https://learn.microsoft.com/azure/quantum/) ## Getting started @@ -22,13 +22,13 @@ dotnet add package Azure.Quantum.Jobs --prerelease 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/), [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API), and [Python 3.6+](https://www.python.org/downloads/) to use this package. +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/), [Cosmos DB account](https://learn.microsoft.com/azure/cosmos-db/account-overview) (SQL API), and [Python 3.6+](https://www.python.org/downloads/) to use this package. ### Authenticate the client -To authenticate with the service, the workspace will use [DefaultAzureCredential](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet) internally. This will try different authentication mechanisms based on the environment (e.g. Environment Variables, ManagedIdentity, CachedTokens) and finally it will fallback to [InteractiveBrowserCredential](https://docs.microsoft.com/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet). +To authenticate with the service, the workspace will use [DefaultAzureCredential](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet) internally. This will try different authentication mechanisms based on the environment (e.g. Environment Variables, ManagedIdentity, CachedTokens) and finally it will fallback to [InteractiveBrowserCredential](https://learn.microsoft.com/dotnet/api/azure.identity.interactivebrowsercredential?view=azure-dotnet). -Workspace will also allow the user to override the above behavior by passing their own [TokenCredential](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet). +Workspace will also allow the user to override the above behavior by passing their own [TokenCredential](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet). `TokenCredential` is the default Authentication mechanism used by Azure SDKs. @@ -202,7 +202,7 @@ All Quantum Jobs service operations will throw a RequestFailedException on failu ## Next steps -* Visit our [Product documentation](https://docs.microsoft.com/azure/quantum/) to learn more about Azure Quantum. +* Visit our [Product documentation](https://learn.microsoft.com/azure/quantum/) to learn more about Azure Quantum. ## Contributing See the [CONTRIBUTING.md][contributing] for details on building, @@ -223,14 +223,14 @@ additional questions or comments. [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/quantum/Azure.Quantum.Jobs/src -[resource-groups]: https://docs.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal -[workspaces]: https://docs.microsoft.com/azure/quantum/how-to-create-quantum-workspaces-with-the-azure-portal +[resource-groups]: https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal +[workspaces]: https://learn.microsoft.com/azure/quantum/how-to-create-quantum-workspaces-with-the-azure-portal [location]: https://azure.microsoft.com/global-infrastructure/services/?products=quantum -[blob-storage]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-introduction +[blob-storage]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction [contributing]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md [subscriptions]: https://ms.portal.azure.com/#blade/Microsoft_Azure_Billing/SubscriptionsBlade -[credentials]: https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme#credentials -[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[credentials]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme#credentials +[style-guide-msft]: https://learn.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%2Fsdk%2Fquantum%2FAzure.Quantum.Jobs%2FREADME.png) diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md b/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md index 5a1fe211b9e7..50ac5e28ed35 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md +++ b/sdk/quantum/Azure.ResourceManager.Quantum/CHANGELOG.md @@ -74,4 +74,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/README.md b/sdk/quantum/Azure.ResourceManager.Quantum/README.md index f879371c17ba..50ac65448ad8 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/README.md +++ b/sdk/quantum/Azure.ResourceManager.Quantum/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/CHANGELOG.md b/sdk/qumulo/Azure.ResourceManager.Qumulo/CHANGELOG.md index 98cf3e48196f..fb31291da2cb 100644 --- a/sdk/qumulo/Azure.ResourceManager.Qumulo/CHANGELOG.md +++ b/sdk/qumulo/Azure.ResourceManager.Qumulo/CHANGELOG.md @@ -48,8 +48,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -72,4 +72,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/README.md b/sdk/qumulo/Azure.ResourceManager.Qumulo/README.md index 7fdaa3712b17..771632b1df0b 100644 --- a/sdk/qumulo/Azure.ResourceManager.Qumulo/README.md +++ b/sdk/qumulo/Azure.ResourceManager.Qumulo/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/quota/Azure.ResourceManager.Quota/CHANGELOG.md b/sdk/quota/Azure.ResourceManager.Quota/CHANGELOG.md index 72bbb454e5ff..027de2afd39a 100644 --- a/sdk/quota/Azure.ResourceManager.Quota/CHANGELOG.md +++ b/sdk/quota/Azure.ResourceManager.Quota/CHANGELOG.md @@ -85,4 +85,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/quota/Azure.ResourceManager.Quota/README.md b/sdk/quota/Azure.ResourceManager.Quota/README.md index 3461aba88e65..63ba9dce7619 100644 --- a/sdk/quota/Azure.ResourceManager.Quota/README.md +++ b/sdk/quota/Azure.ResourceManager.Quota/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/CHANGELOG.md b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/CHANGELOG.md index 43b9ab193896..e85531e522be 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/CHANGELOG.md +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/CHANGELOG.md @@ -74,8 +74,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -108,4 +108,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/README.md b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/README.md index 7b00ff690d70..127acabdede0 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/README.md +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md index 90ed524cf07f..958b18900e50 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md index f9a1842b1c84..4a9a6d7f89d6 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/CHANGELOG.md b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/CHANGELOG.md index 82fb0e5ae7e2..d2efda013a72 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/CHANGELOG.md +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/CHANGELOG.md @@ -61,8 +61,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -115,4 +115,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/README.md b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/README.md index 90fb4ece7819..ac7c2031aea8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/README.md +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/CHANGELOG.md b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/CHANGELOG.md index 6f8726d1627c..848f7dbbe9e8 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/CHANGELOG.md +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/CHANGELOG.md @@ -71,8 +71,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -105,4 +105,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/README.md b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/README.md index 5b9c7b7a698b..08211cfa1753 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/README.md +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md b/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md index b8708ece169d..3ffe044efff3 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md +++ b/sdk/redis/Azure.ResourceManager.Redis/CHANGELOG.md @@ -1,16 +1,11 @@ # Release History -## 1.5.0-beta.1 (Unreleased) +## 1.5.0 (2024-12-18) ### Features Added -- Exposed `JsonModelWriteCore` for model serialization procedure. - -### Breaking Changes - -### Bugs Fixed - -### Other Changes + - Exposed `JsonModelWriteCore` for model serialization procedure. + - Adds support for choosing ZonalAllocationPolicy for your Azure Cache for Redis instance. ## 1.4.0 (2024-07-11) @@ -133,8 +128,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -165,4 +160,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/redis/Azure.ResourceManager.Redis/README.md b/sdk/redis/Azure.ResourceManager.Redis/README.md index 3a8268e4f684..db59621e9391 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/README.md +++ b/sdk/redis/Azure.ResourceManager.Redis/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs index e27043acab5b..8af39ce52546 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.net8.0.cs @@ -142,6 +142,7 @@ public RedisData(Azure.Core.AzureLocation location, Azure.ResourceManager.Redis. public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } public System.Collections.Generic.IDictionary TenantSettings { get { throw null; } } public Azure.ResourceManager.Redis.Models.UpdateChannel? UpdateChannel { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? ZonalAllocationPolicy { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Redis.RedisData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -540,12 +541,16 @@ public static partial class ArmRedisModelFactory public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string notifyKeyspaceEvents = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, string isAadEnabled = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones, Azure.Core.AzureLocation location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP) { throw null; } - public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones, Azure.Core.AzureLocation location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? zonalAllocationPolicy = default(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } - public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? zonalAllocationPolicy = default(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.Redis.RedisFirewallRuleData RedisFirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Net.IPAddress startIP = null, System.Net.IPAddress endIP = null) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisForceRebootResult RedisForceRebootResult(string message = null) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisInstanceDetails RedisInstanceDetails(int? sslPort = default(int?), int? nonSslPort = default(int?), string zone = null, int? shardId = default(int?), bool? isMaster = default(bool?), bool? isPrimary = default(bool?)) { throw null; } @@ -648,6 +653,7 @@ public RedisCreateOrUpdateContent(Azure.Core.AzureLocation location, Azure.Resou public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IDictionary TenantSettings { get { throw null; } } public Azure.ResourceManager.Redis.Models.UpdateChannel? UpdateChannel { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? ZonalAllocationPolicy { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -755,6 +761,7 @@ public RedisPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IDictionary TenantSettings { get { throw null; } } public Azure.ResourceManager.Redis.Models.UpdateChannel? UpdateChannel { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? ZonalAllocationPolicy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Redis.Models.RedisPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1052,4 +1059,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Redis.Models.UpdateChannel left, Azure.ResourceManager.Redis.Models.UpdateChannel right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZonalAllocationPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZonalAllocationPolicy(string value) { throw null; } + public static Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy Automatic { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy NoZones { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy UserDefined { get { throw null; } } + public bool Equals(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy 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.ResourceManager.Redis.Models.ZonalAllocationPolicy left, Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy left, Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs index e27043acab5b..8af39ce52546 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs @@ -142,6 +142,7 @@ public RedisData(Azure.Core.AzureLocation location, Azure.ResourceManager.Redis. public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } public System.Collections.Generic.IDictionary TenantSettings { get { throw null; } } public Azure.ResourceManager.Redis.Models.UpdateChannel? UpdateChannel { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? ZonalAllocationPolicy { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Redis.RedisData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -540,12 +541,16 @@ public static partial class ArmRedisModelFactory public static Azure.ResourceManager.Redis.Models.RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBackupEnabled = default(bool?), string rdbBackupFrequency = null, int? rdbBackupMaxSnapshotCount = default(int?), string rdbStorageConnectionString = null, bool? isAofBackupEnabled = default(bool?), string aofStorageConnectionString0 = null, string aofStorageConnectionString1 = null, string maxFragmentationMemoryReserved = null, string maxMemoryPolicy = null, string maxMemoryReserved = null, string maxMemoryDelta = null, string maxClients = null, string notifyKeyspaceEvents = null, string preferredDataArchiveAuthMethod = null, string preferredDataPersistenceAuthMethod = null, string zonalConfiguration = null, string authNotRequired = null, string storageSubscriptionId = null, string isAadEnabled = null, System.Collections.Generic.IDictionary additionalProperties = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones, Azure.Core.AzureLocation location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP) { throw null; } - public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones, Azure.Core.AzureLocation location, System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP) { throw null; } + public static Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent RedisCreateOrUpdateContent(System.Collections.Generic.IEnumerable zones = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? zonalAllocationPolicy = default(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } - public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, System.Collections.Generic.IDictionary tenantSettings, int? shardCount, Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion, Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, Azure.ResourceManager.Redis.Models.RedisSku sku, Azure.Core.ResourceIdentifier subnetId, System.Net.IPAddress staticIP, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys, System.Collections.Generic.IEnumerable linkedServers, System.Collections.Generic.IEnumerable instances, System.Collections.Generic.IEnumerable privateEndpointConnections) { throw null; } + public static Azure.ResourceManager.Redis.RedisData RedisData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Redis.Models.RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), System.Collections.Generic.IDictionary tenantSettings = null, int? shardCount = default(int?), Azure.ResourceManager.Redis.Models.RedisTlsVersion? minimumTlsVersion = default(Azure.ResourceManager.Redis.Models.RedisTlsVersion?), Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Redis.Models.RedisPublicNetworkAccess?), Azure.ResourceManager.Redis.Models.UpdateChannel? updateChannel = default(Azure.ResourceManager.Redis.Models.UpdateChannel?), bool? isAccessKeyAuthenticationDisabled = default(bool?), Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? zonalAllocationPolicy = default(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy?), Azure.ResourceManager.Redis.Models.RedisSku sku = null, Azure.Core.ResourceIdentifier subnetId = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.Redis.Models.RedisProvisioningState? provisioningState = default(Azure.ResourceManager.Redis.Models.RedisProvisioningState?), string hostName = null, int? port = default(int?), int? sslPort = default(int?), Azure.ResourceManager.Redis.Models.RedisAccessKeys accessKeys = null, System.Collections.Generic.IEnumerable linkedServers = null, System.Collections.Generic.IEnumerable instances = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.Redis.RedisFirewallRuleData RedisFirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Net.IPAddress startIP = null, System.Net.IPAddress endIP = null) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisForceRebootResult RedisForceRebootResult(string message = null) { throw null; } public static Azure.ResourceManager.Redis.Models.RedisInstanceDetails RedisInstanceDetails(int? sslPort = default(int?), int? nonSslPort = default(int?), string zone = null, int? shardId = default(int?), bool? isMaster = default(bool?), bool? isPrimary = default(bool?)) { throw null; } @@ -648,6 +653,7 @@ public RedisCreateOrUpdateContent(Azure.Core.AzureLocation location, Azure.Resou public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IDictionary TenantSettings { get { throw null; } } public Azure.ResourceManager.Redis.Models.UpdateChannel? UpdateChannel { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? ZonalAllocationPolicy { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Redis.Models.RedisCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -755,6 +761,7 @@ public RedisPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IDictionary TenantSettings { get { throw null; } } public Azure.ResourceManager.Redis.Models.UpdateChannel? UpdateChannel { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy? ZonalAllocationPolicy { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Redis.Models.RedisPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1052,4 +1059,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.Redis.Models.UpdateChannel left, Azure.ResourceManager.Redis.Models.UpdateChannel right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZonalAllocationPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZonalAllocationPolicy(string value) { throw null; } + public static Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy Automatic { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy NoZones { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy UserDefined { get { throw null; } } + public bool Equals(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy 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.ResourceManager.Redis.Models.ZonalAllocationPolicy left, Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy left, Azure.ResourceManager.Redis.Models.ZonalAllocationPolicy right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/assets.json b/sdk/redis/Azure.ResourceManager.Redis/assets.json index 2f0eb378b21c..04b5a33c08ca 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/assets.json +++ b/sdk/redis/Azure.ResourceManager.Redis/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/redis/Azure.ResourceManager.Redis", - "Tag": "net/redis/Azure.ResourceManager.Redis_9f9dcdb5df" + "Tag": "net/redis/Azure.ResourceManager.Redis_14b33586e3" } diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentCollection.cs index 8136fcb2fd0c..f8d771500278 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RedisCacheAccessPolicyAssignmentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCacheAccessPolicyAssignmentCreateUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json // this example is just showing the usage of "AccessPolicyAssignment_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_RedisCacheAccessPolicyAssignmentCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheAccessPolicyAssignmentGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json // this example is just showing the usage of "AccessPolicyAssignment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_RedisCacheAccessPolicyAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisCacheAccessPolicyAssignmentList() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentList.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentList.json // this example is just showing the usage of "AccessPolicyAssignment_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_RedisCacheAccessPolicyAssignmentList() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisCacheAccessPolicyAssignmentGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json // this example is just showing the usage of "AccessPolicyAssignment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_RedisCacheAccessPolicyAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisCacheAccessPolicyAssignmentGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json // this example is just showing the usage of "AccessPolicyAssignment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentResource.cs index 107beeb2e863..cb50385c8208 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyAssignmentResource.cs @@ -19,7 +19,7 @@ public partial class Sample_RedisCacheAccessPolicyAssignmentResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheAccessPolicyAssignmentGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json // this example is just showing the usage of "AccessPolicyAssignment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_RedisCacheAccessPolicyAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisCacheAccessPolicyAssignmentDelete() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentDelete.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentDelete.json // this example is just showing the usage of "AccessPolicyAssignment_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_RedisCacheAccessPolicyAssignmentDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisCacheAccessPolicyAssignmentCreateUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json // this example is just showing the usage of "AccessPolicyAssignment_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyCollection.cs index a747d2488a80..38756975d0cb 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RedisCacheAccessPolicyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCacheAccessPolicyCreateUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyCreateUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json // this example is just showing the usage of "AccessPolicy_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task CreateOrUpdate_RedisCacheAccessPolicyCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheAccessPolicyGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json // this example is just showing the usage of "AccessPolicy_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_RedisCacheAccessPolicyGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisCacheAccessPolicyList() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyList.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyList.json // this example is just showing the usage of "AccessPolicy_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task GetAll_RedisCacheAccessPolicyList() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisCacheAccessPolicyGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json // this example is just showing the usage of "AccessPolicy_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +158,7 @@ public async Task Exists_RedisCacheAccessPolicyGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisCacheAccessPolicyGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json // this example is just showing the usage of "AccessPolicy_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyResource.cs index f970bb58d76f..ca75be9e6f69 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCacheAccessPolicyResource.cs @@ -19,7 +19,7 @@ public partial class Sample_RedisCacheAccessPolicyResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheAccessPolicyGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json // this example is just showing the usage of "AccessPolicy_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_RedisCacheAccessPolicyGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisCacheAccessPolicyDelete() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyDelete.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyDelete.json // this example is just showing the usage of "AccessPolicy_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_RedisCacheAccessPolicyDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisCacheAccessPolicyCreateUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAccessPolicyCreateUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json // this example is just showing the usage of "AccessPolicy_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCollection.cs index 26c9f9f7521b..0dc2b284a28a 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_RedisCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCacheCreate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheCreate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreate.json // this example is just showing the usage of "Redis_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -42,7 +42,7 @@ public async Task CreateOrUpdate_RedisCacheCreate() // invoke the operation string name = "cache1"; - RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("West US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("East US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) { Zones = { "1" }, RedisConfiguration = new RedisCommonConfiguration @@ -67,11 +67,59 @@ public async Task CreateOrUpdate_RedisCacheCreate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RedisCacheCreateAutomaticZonalAllocationPolicy() + { + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateAutomaticZonalAllocationPolicy.json + // this example is just showing the usage of "Redis_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this RedisResource + RedisCollection collection = resourceGroupResource.GetAllRedis(); + + // invoke the operation + string name = "cache1"; + RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("East US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + RedisConfiguration = new RedisCommonConfiguration + { + MaxMemoryPolicy = "allkeys-lru", + }, + EnableNonSslPort = true, + ReplicasPerPrimary = 2, + ShardCount = 2, + MinimumTlsVersion = RedisTlsVersion.Tls1_2, + ZonalAllocationPolicy = ZonalAllocationPolicy.Automatic, + SubnetId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), + StaticIP = IPAddress.Parse("192.168.0.5"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, content); + RedisResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RedisData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCacheCreateDefaultVersion() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheCreateDefaultVersion.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateDefaultVersion.json // this example is just showing the usage of "Redis_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +139,7 @@ public async Task CreateOrUpdate_RedisCacheCreateDefaultVersion() // invoke the operation string name = "cache1"; - RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("West US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("East US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) { Zones = { "1" }, RedisConfiguration = new RedisCommonConfiguration @@ -119,7 +167,104 @@ public async Task CreateOrUpdate_RedisCacheCreateDefaultVersion() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCacheCreateLatestVersion() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheCreateLatestVersion.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateLatestVersion.json + // this example is just showing the usage of "Redis_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this RedisResource + RedisCollection collection = resourceGroupResource.GetAllRedis(); + + // invoke the operation + string name = "cache1"; + RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("East US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + Zones = { "1" }, + RedisConfiguration = new RedisCommonConfiguration + { + MaxMemoryPolicy = "allkeys-lru", + }, + RedisVersion = "Latest", + EnableNonSslPort = true, + ReplicasPerPrimary = 2, + ShardCount = 2, + MinimumTlsVersion = RedisTlsVersion.Tls1_2, + SubnetId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), + StaticIP = IPAddress.Parse("192.168.0.5"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, content); + RedisResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RedisData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RedisCacheCreateNoZonesZonalAllocationPolicy() + { + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateNoZonesZonalAllocationPolicy.json + // this example is just showing the usage of "Redis_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this RedisResource + RedisCollection collection = resourceGroupResource.GetAllRedis(); + + // invoke the operation + string name = "cache1"; + RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("East US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + RedisConfiguration = new RedisCommonConfiguration + { + MaxMemoryPolicy = "allkeys-lru", + }, + EnableNonSslPort = true, + ReplicasPerPrimary = 2, + ShardCount = 2, + MinimumTlsVersion = RedisTlsVersion.Tls1_2, + ZonalAllocationPolicy = ZonalAllocationPolicy.NoZones, + SubnetId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), + StaticIP = IPAddress.Parse("192.168.0.5"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, content); + RedisResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RedisData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_RedisCacheCreateUserDefinedZonalAllocationPolicy() + { + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateUserDefinedZonalAllocationPolicy.json // this example is just showing the usage of "Redis_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +284,7 @@ public async Task CreateOrUpdate_RedisCacheCreateLatestVersion() // invoke the operation string name = "cache1"; - RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("West US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + RedisCreateOrUpdateContent content = new RedisCreateOrUpdateContent(new AzureLocation("East US"), new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) { Zones = { "1" }, RedisConfiguration = new RedisCommonConfiguration @@ -151,6 +296,7 @@ public async Task CreateOrUpdate_RedisCacheCreateLatestVersion() ReplicasPerPrimary = 2, ShardCount = 2, MinimumTlsVersion = RedisTlsVersion.Tls1_2, + ZonalAllocationPolicy = ZonalAllocationPolicy.UserDefined, SubnetId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1"), StaticIP = IPAddress.Parse("192.168.0.5"), }; @@ -168,7 +314,7 @@ public async Task CreateOrUpdate_RedisCacheCreateLatestVersion() [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json // this example is just showing the usage of "Redis_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -201,7 +347,7 @@ public async Task Get_RedisCacheGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisCacheListByResourceGroup() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheListByResourceGroup.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListByResourceGroup.json // this example is just showing the usage of "Redis_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -236,7 +382,7 @@ public async Task GetAll_RedisCacheListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisCacheGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json // this example is just showing the usage of "Redis_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -265,7 +411,7 @@ public async Task Exists_RedisCacheGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisCacheGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json // this example is just showing the usage of "Redis_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleCollection.cs index 85113b993f49..beb16f44dba3 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisFirewallRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCacheFirewallRuleCreate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleCreate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json // this example is just showing the usage of "FirewallRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task CreateOrUpdate_RedisCacheFirewallRuleCreate() [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheFirewallRuleGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json // this example is just showing the usage of "FirewallRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_RedisCacheFirewallRuleGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisCacheFirewallRulesList() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRulesList.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRulesList.json // this example is just showing the usage of "FirewallRules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task GetAll_RedisCacheFirewallRulesList() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisCacheFirewallRuleGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json // this example is just showing the usage of "FirewallRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Exists_RedisCacheFirewallRuleGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisCacheFirewallRuleGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json // this example is just showing the usage of "FirewallRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleResource.cs index 6ba2391377f1..e5d1902509d4 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisFirewallRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisFirewallRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheFirewallRuleGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json // this example is just showing the usage of "FirewallRules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_RedisCacheFirewallRuleGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisCacheFirewallRuleDelete() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleDelete.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleDelete.json // this example is just showing the usage of "FirewallRules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_RedisCacheFirewallRuleDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisCacheFirewallRuleCreate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFirewallRuleCreate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json // this example is just showing the usage of "FirewallRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyCollection.cs index c9da194390d7..67bd945b34e5 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisLinkedServerWithPropertyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_LinkedServerCreate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Create.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json // this example is just showing the usage of "LinkedServer_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task CreateOrUpdate_LinkedServerCreate() [Ignore("Only validating compilation of examples")] public async Task Get_LinkedServerGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Get.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json // this example is just showing the usage of "LinkedServer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_LinkedServerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_LinkedServerList() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_List.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_List.json // this example is just showing the usage of "LinkedServer_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task GetAll_LinkedServerList() [Ignore("Only validating compilation of examples")] public async Task Exists_LinkedServerGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Get.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json // this example is just showing the usage of "LinkedServer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Exists_LinkedServerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_LinkedServerGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Get.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json // this example is just showing the usage of "LinkedServer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyResource.cs index a2d361faed58..ca8a069eff22 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisLinkedServerWithPropertyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisLinkedServerWithPropertyResource [Ignore("Only validating compilation of examples")] public async Task Get_LinkedServerGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Get.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json // this example is just showing the usage of "LinkedServer_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_LinkedServerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_LinkedServerDelete() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Delete.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Delete.json // this example is just showing the usage of "LinkedServer_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_LinkedServerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_LinkedServerCreate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheLinkedServer_Create.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json // this example is just showing the usage of "LinkedServer_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleCollection.cs index 87d459f0f790..b82c091e7f76 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_RedisPatchScheduleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCachePatchSchedulesCreateOrUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json // this example is just showing the usage of "PatchSchedules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_RedisCachePatchSchedulesCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_RedisCachePatchSchedulesGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json // this example is just showing the usage of "PatchSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_RedisCachePatchSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisCachePatchSchedulesList() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesList.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesList.json // this example is just showing the usage of "PatchSchedules_ListByRedisResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task GetAll_RedisCachePatchSchedulesList() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisCachePatchSchedulesGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json // this example is just showing the usage of "PatchSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_RedisCachePatchSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisCachePatchSchedulesGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json // this example is just showing the usage of "PatchSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleResource.cs index 2e806a78eec3..aa403ba1940d 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPatchScheduleResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RedisPatchScheduleResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisCachePatchSchedulesGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json // this example is just showing the usage of "PatchSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_RedisCachePatchSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisCachePatchSchedulesDelete() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesDelete.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesDelete.json // this example is just showing the usage of "PatchSchedules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task Delete_RedisCachePatchSchedulesDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisCachePatchSchedulesCreateOrUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json // this example is just showing the usage of "PatchSchedules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionCollection.cs index 3ff512e79e23..684c599d1a01 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_RedisCachePutPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePutPrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_RedisCachePutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheGetPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGetPrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_RedisCacheGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_RedisCacheListPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheListPrivateEndpointConnections.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateEndpointConnections.json // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_RedisCacheListPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_RedisCacheGetPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGetPrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_RedisCacheGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RedisCacheGetPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGetPrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionResource.cs index 0220526db1f1..fc202ebd3845 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RedisPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheGetPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGetPrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_RedisCacheGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisCacheDeletePrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheDeletePrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDeletePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_RedisCacheDeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_RedisCachePutPrivateEndpointConnection() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCachePutPrivateEndpointConnection.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisResource.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisResource.cs index 46b10e68d6b3..92bfbfa04f46 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_RedisResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RedisResource [Ignore("Only validating compilation of examples")] public async Task Get_RedisCacheGet() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheGet.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json // this example is just showing the usage of "Redis_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_RedisCacheGet() [Ignore("Only validating compilation of examples")] public async Task Delete_RedisCacheDelete() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheDelete.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDelete.json // this example is just showing the usage of "Redis_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_RedisCacheDelete() [Ignore("Only validating compilation of examples")] public async Task Update_RedisCacheUpdate() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheUpdate.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheUpdate.json // this example is just showing the usage of "Redis_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Update_RedisCacheUpdate() [Ignore("Only validating compilation of examples")] public async Task GetUpgradeNotifications_RedisCacheListUpgradeNotifications() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheListUpgradeNotifications.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListUpgradeNotifications.json // this example is just showing the usage of "Redis_ListUpgradeNotifications" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task GetUpgradeNotifications_RedisCacheListUpgradeNotifications() [Ignore("Only validating compilation of examples")] public async Task GetKeys_RedisCacheListKeys() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheListKeys.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListKeys.json // this example is just showing the usage of "Redis_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task GetKeys_RedisCacheListKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKey_RedisCacheRegenerateKey() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheRegenerateKey.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheRegenerateKey.json // this example is just showing the usage of "Redis_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task RegenerateKey_RedisCacheRegenerateKey() [Ignore("Only validating compilation of examples")] public async Task ForceReboot_RedisCacheForceReboot() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheForceReboot.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheForceReboot.json // this example is just showing the usage of "Redis_ForceReboot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -228,7 +228,7 @@ public async Task ForceReboot_RedisCacheForceReboot() [Ignore("Only validating compilation of examples")] public async Task ImportData_RedisCacheImport() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheImport.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheImport.json // this example is just showing the usage of "Redis_ImportData" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -259,7 +259,7 @@ public async Task ImportData_RedisCacheImport() [Ignore("Only validating compilation of examples")] public async Task ExportData_RedisCacheExport() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheExport.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheExport.json // this example is just showing the usage of "Redis_ExportData" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -290,7 +290,7 @@ public async Task ExportData_RedisCacheExport() [Ignore("Only validating compilation of examples")] public async Task FlushCache_RedisCacheFlush() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheFlush.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFlush.json // this example is just showing the usage of "Redis_FlushCache" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -317,7 +317,7 @@ public async Task FlushCache_RedisCacheFlush() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResourcesByRedisCache_StorageAccountListPrivateLinkResources() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheListPrivateLinkResources.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateLinkResources.json // this example is just showing the usage of "PrivateLinkResources_ListByRedisCache" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 160092cc2744..e950416c04fe 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckRedisNameAvailability_RedisCacheCheckNameAvailability() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheCheckNameAvailability.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCheckNameAvailability.json // this example is just showing the usage of "Redis_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -46,7 +46,7 @@ public async Task CheckRedisNameAvailability_RedisCacheCheckNameAvailability() [Ignore("Only validating compilation of examples")] public async Task GetAllRedis_RedisCacheList() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheList.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheList.json // this example is just showing the usage of "Redis_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task GetAllRedis_RedisCacheList() [Ignore("Only validating compilation of examples")] public async Task GetAsyncOperationStatus_RedisCacheAsyncOperationStatus() { - // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-03-01/examples/RedisCacheAsyncOperationStatus.json + // Generated from example definition: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAsyncOperationStatus.json // this example is just showing the usage of "AsyncOperationStatus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Azure.ResourceManager.Redis.csproj b/sdk/redis/Azure.ResourceManager.Redis/src/Azure.ResourceManager.Redis.csproj index 04fcea2d32ac..272aadde6a7b 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Azure.ResourceManager.Redis.csproj +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Azure.ResourceManager.Redis.csproj @@ -1,6 +1,6 @@ - 1.5.0-beta.1 + 1.5.0 1.4.0 Azure.ResourceManager.Redis diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs index c72b40465d46..6eee442a43e2 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/ArmRedisModelFactory.cs @@ -47,11 +47,12 @@ public static RedisUpgradeNotification RedisUpgradeNotification(string name = nu /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. /// The SKU of the Redis cache to deploy. /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. /// A new instance for mocking. - public static RedisCreateOrUpdateContent RedisCreateOrUpdateContent(IEnumerable zones = null, AzureLocation location = default, IDictionary tags = null, ManagedServiceIdentity identity = null, RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = null, int? replicasPerMaster = null, int? replicasPerPrimary = null, IDictionary tenantSettings = null, int? shardCount = null, RedisTlsVersion? minimumTlsVersion = null, RedisPublicNetworkAccess? publicNetworkAccess = null, UpdateChannel? updateChannel = null, bool? isAccessKeyAuthenticationDisabled = null, RedisSku sku = null, ResourceIdentifier subnetId = null, IPAddress staticIP = null) + public static RedisCreateOrUpdateContent RedisCreateOrUpdateContent(IEnumerable zones = null, AzureLocation location = default, IDictionary tags = null, ManagedServiceIdentity identity = null, RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = null, int? replicasPerMaster = null, int? replicasPerPrimary = null, IDictionary tenantSettings = null, int? shardCount = null, RedisTlsVersion? minimumTlsVersion = null, RedisPublicNetworkAccess? publicNetworkAccess = null, UpdateChannel? updateChannel = null, bool? isAccessKeyAuthenticationDisabled = null, ZonalAllocationPolicy? zonalAllocationPolicy = null, RedisSku sku = null, ResourceIdentifier subnetId = null, IPAddress staticIP = null) { zones ??= new List(); tags ??= new Dictionary(); @@ -73,6 +74,7 @@ public static RedisCreateOrUpdateContent RedisCreateOrUpdateContent(IEnumerable< publicNetworkAccess, updateChannel, isAccessKeyAuthenticationDisabled, + zonalAllocationPolicy, sku, subnetId, staticIP, @@ -148,6 +150,7 @@ public static RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBacku /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. /// The SKU of the Redis cache to deploy. /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. @@ -160,7 +163,7 @@ public static RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBacku /// List of the Redis instances associated with the cache. /// List of private endpoint connection associated with the specified redis cache. /// A new instance for mocking. - public static RedisData RedisData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = null, int? replicasPerMaster = null, int? replicasPerPrimary = null, IDictionary tenantSettings = null, int? shardCount = null, RedisTlsVersion? minimumTlsVersion = null, RedisPublicNetworkAccess? publicNetworkAccess = null, UpdateChannel? updateChannel = null, bool? isAccessKeyAuthenticationDisabled = null, RedisSku sku = null, ResourceIdentifier subnetId = null, IPAddress staticIP = null, RedisProvisioningState? provisioningState = null, string hostName = null, int? port = null, int? sslPort = null, RedisAccessKeys accessKeys = null, IEnumerable linkedServers = null, IEnumerable instances = null, IEnumerable privateEndpointConnections = null) + public static RedisData RedisData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable zones = null, ManagedServiceIdentity identity = null, RedisCommonConfiguration redisConfiguration = null, string redisVersion = null, bool? enableNonSslPort = null, int? replicasPerMaster = null, int? replicasPerPrimary = null, IDictionary tenantSettings = null, int? shardCount = null, RedisTlsVersion? minimumTlsVersion = null, RedisPublicNetworkAccess? publicNetworkAccess = null, UpdateChannel? updateChannel = null, bool? isAccessKeyAuthenticationDisabled = null, ZonalAllocationPolicy? zonalAllocationPolicy = null, RedisSku sku = null, ResourceIdentifier subnetId = null, IPAddress staticIP = null, RedisProvisioningState? provisioningState = null, string hostName = null, int? port = null, int? sslPort = null, RedisAccessKeys accessKeys = null, IEnumerable linkedServers = null, IEnumerable instances = null, IEnumerable privateEndpointConnections = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -189,6 +192,7 @@ public static RedisData RedisData(ResourceIdentifier id = null, string name = nu publicNetworkAccess, updateChannel, isAccessKeyAuthenticationDisabled, + zonalAllocationPolicy, sku, subnetId, staticIP, @@ -468,6 +472,70 @@ public static RedisCacheAccessPolicyAssignmentData RedisCacheAccessPolicyAssignm serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// A list of availability zones denoting where the resource needs to come from. + /// The geo-location where the resource lives. + /// Resource tags. + /// The identity of the resource. + /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. + /// Specifies whether the non-ssl Redis server port (6379) is enabled. + /// The number of replicas to be created per primary. + /// The number of replicas to be created per primary. + /// A dictionary of tenant settings. + /// The number of shards to be created on a Premium Cluster Cache. + /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. + /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. + /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// The SKU of the Redis cache to deploy. + /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RedisCreateOrUpdateContent RedisCreateOrUpdateContent(IEnumerable zones, AzureLocation location, IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP) + { + return RedisCreateOrUpdateContent(zones: zones, location: location, tags: tags, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: isAccessKeyAuthenticationDisabled, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A list of availability zones denoting where the resource needs to come from. + /// The identity of the resource. + /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. + /// Specifies whether the non-ssl Redis server port (6379) is enabled. + /// The number of replicas to be created per primary. + /// The number of replicas to be created per primary. + /// A dictionary of tenant settings. + /// The number of shards to be created on a Premium Cluster Cache. + /// Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. + /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. + /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// The SKU of the Redis cache to deploy. + /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. + /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. + /// Redis instance provisioning status. + /// Redis host name. + /// Redis non-SSL port. + /// Redis SSL port. + /// The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache. + /// List of the linked servers associated with the cache. + /// List of the Redis instances associated with the cache. + /// List of private endpoint connection associated with the specified redis cache. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RedisData RedisData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable zones, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, RedisAccessKeys accessKeys, IEnumerable linkedServers, IEnumerable instances, IEnumerable privateEndpointConnections) + { + return RedisData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, zones: zones, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: isAccessKeyAuthenticationDisabled, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP, provisioningState: provisioningState, hostName: hostName, port: port, sslPort: sslPort, accessKeys: accessKeys, linkedServers: linkedServers, instances: instances, privateEndpointConnections: privateEndpointConnections); + } + /// Initializes a new instance of . /// A list of availability zones denoting where the resource needs to come from. /// The geo-location where the resource lives. @@ -490,7 +558,7 @@ public static RedisCacheAccessPolicyAssignmentData RedisCacheAccessPolicyAssignm [EditorBrowsable(EditorBrowsableState.Never)] public static RedisCreateOrUpdateContent RedisCreateOrUpdateContent(IEnumerable zones, AzureLocation location, IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP) { - return RedisCreateOrUpdateContent(zones: zones, location: location, tags: tags, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: default, sku: sku, subnetId: subnetId, staticIP: staticIP); + return RedisCreateOrUpdateContent(zones: zones, location: location, tags: tags, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: default, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP); } /// Initializes a new instance of . @@ -554,7 +622,7 @@ public static RedisCommonConfiguration RedisCommonConfiguration(bool? isRdbBacku [EditorBrowsable(EditorBrowsableState.Never)] public static RedisData RedisData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable zones, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, RedisAccessKeys accessKeys, IEnumerable linkedServers, IEnumerable instances, IEnumerable privateEndpointConnections) { - return RedisData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, zones: zones, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: default, sku: sku, subnetId: subnetId, staticIP: staticIP, provisioningState: provisioningState, hostName: hostName, port: port, sslPort: sslPort, accessKeys: accessKeys, linkedServers: linkedServers, instances: instances, privateEndpointConnections: privateEndpointConnections); + return RedisData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, zones: zones, identity: identity, redisConfiguration: redisConfiguration, redisVersion: redisVersion, enableNonSslPort: enableNonSslPort, replicasPerMaster: replicasPerMaster, replicasPerPrimary: replicasPerPrimary, tenantSettings: tenantSettings, shardCount: shardCount, minimumTlsVersion: minimumTlsVersion, publicNetworkAccess: publicNetworkAccess, updateChannel: updateChannel, isAccessKeyAuthenticationDisabled: default, zonalAllocationPolicy: default, sku: sku, subnetId: subnetId, staticIP: staticIP, provisioningState: provisioningState, hostName: hostName, port: port, sslPort: sslPort, accessKeys: accessKeys, linkedServers: linkedServers, instances: instances, privateEndpointConnections: privateEndpointConnections); } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisResourceGroupResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisResourceGroupResource.cs index 94c881d1ef86..9e73be9b6305 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisResourceGroupResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual RedisCollection GetAllRedis() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetRedisAsync(string name, Ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisSubscriptionResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisSubscriptionResource.cs index f940dd0bd9f3..a341e54aaa08 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisSubscriptionResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/MockableRedisSubscriptionResource.cs @@ -59,7 +59,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -101,7 +101,7 @@ public virtual async Task CheckRedisNameAvailabilityAsync(RedisNameAva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual Response CheckRedisNameAvailability(RedisNameAvailabilityContent /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -173,7 +173,7 @@ public virtual AsyncPageable GetAllRedisAsync(CancellationToken c /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -203,7 +203,7 @@ public virtual Pageable GetAllRedis(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -243,7 +243,7 @@ public virtual async Task> GetAsyncOperationStatu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs index 71e6edf9a5b8..c15adfc30d89 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs @@ -196,7 +196,7 @@ public static RedisCollection GetAllRedis(this ResourceGroupResource resourceGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -234,7 +234,7 @@ public static async Task> GetRedisAsync(this ResourceGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -272,7 +272,7 @@ public static Response GetRedis(this ResourceGroupResource resour /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -308,7 +308,7 @@ public static async Task CheckRedisNameAvailabilityAsync(this Subscrip /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -344,7 +344,7 @@ public static Response CheckRedisNameAvailability(this SubscriptionResource subs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -380,7 +380,7 @@ public static AsyncPageable GetAllRedisAsync(this SubscriptionRes /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -416,7 +416,7 @@ public static Pageable GetAllRedis(this SubscriptionResource subs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -450,7 +450,7 @@ public static async Task> GetAsyncOperationStatus /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.Serialization.cs index bfc66dca1848..dea8bc74684f 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.Serialization.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.Serialization.cs @@ -127,6 +127,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("disableAccessKeyAuthentication"u8); writer.WriteBooleanValue(IsAccessKeyAuthenticationDisabled.Value); } + if (Optional.IsDefined(ZonalAllocationPolicy)) + { + writer.WritePropertyName("zonalAllocationPolicy"u8); + writer.WriteStringValue(ZonalAllocationPolicy.Value.ToString()); + } writer.WritePropertyName("sku"u8); writer.WriteObjectValue(Sku, options); if (Optional.IsDefined(SubnetId)) @@ -192,6 +197,7 @@ internal static RedisCreateOrUpdateContent DeserializeRedisCreateOrUpdateContent RedisPublicNetworkAccess? publicNetworkAccess = default; UpdateChannel? updateChannel = default; bool? disableAccessKeyAuthentication = default; + ZonalAllocationPolicy? zonalAllocationPolicy = default; RedisSku sku = default; ResourceIdentifier subnetId = default; IPAddress staticIP = default; @@ -350,6 +356,15 @@ internal static RedisCreateOrUpdateContent DeserializeRedisCreateOrUpdateContent disableAccessKeyAuthentication = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("zonalAllocationPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalAllocationPolicy = new ZonalAllocationPolicy(property0.Value.GetString()); + continue; + } if (property0.NameEquals("sku"u8)) { sku = RedisSku.DeserializeRedisSku(property0.Value, options); @@ -398,6 +413,7 @@ internal static RedisCreateOrUpdateContent DeserializeRedisCreateOrUpdateContent publicNetworkAccess, updateChannel, disableAccessKeyAuthentication, + zonalAllocationPolicy, sku, subnetId, staticIP, diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs index c57665f72e3e..aaa0dc790154 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs @@ -79,11 +79,12 @@ public RedisCreateOrUpdateContent(AzureLocation location, RedisSku sku) /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. /// The SKU of the Redis cache to deploy. /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. /// Keeps track of any properties unknown to the library. - internal RedisCreateOrUpdateContent(IList zones, AzureLocation location, IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, IDictionary serializedAdditionalRawData) + internal RedisCreateOrUpdateContent(IList zones, AzureLocation location, IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, ZonalAllocationPolicy? zonalAllocationPolicy, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, IDictionary serializedAdditionalRawData) { Zones = zones; Location = location; @@ -100,6 +101,7 @@ internal RedisCreateOrUpdateContent(IList zones, AzureLocation location, PublicNetworkAccess = publicNetworkAccess; UpdateChannel = updateChannel; IsAccessKeyAuthenticationDisabled = isAccessKeyAuthenticationDisabled; + ZonalAllocationPolicy = zonalAllocationPolicy; Sku = sku; SubnetId = subnetId; StaticIP = staticIP; @@ -156,6 +158,9 @@ internal RedisCreateOrUpdateContent() /// Authentication to Redis through access keys is disabled when set as true. Default value is false. [WirePath("properties.disableAccessKeyAuthentication")] public bool? IsAccessKeyAuthenticationDisabled { get; set; } + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. + [WirePath("properties.zonalAllocationPolicy")] + public ZonalAllocationPolicy? ZonalAllocationPolicy { get; set; } /// The SKU of the Redis cache to deploy. [WirePath("properties.sku")] public RedisSku Sku { get; } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.Serialization.cs index f6ba2b2c3c00..f384ed2c2b65 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.Serialization.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.Serialization.cs @@ -114,6 +114,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("disableAccessKeyAuthentication"u8); writer.WriteBooleanValue(IsAccessKeyAuthenticationDisabled.Value); } + if (Optional.IsDefined(ZonalAllocationPolicy)) + { + writer.WritePropertyName("zonalAllocationPolicy"u8); + writer.WriteStringValue(ZonalAllocationPolicy.Value.ToString()); + } if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -170,6 +175,7 @@ internal static RedisPatch DeserializeRedisPatch(JsonElement element, ModelReade RedisPublicNetworkAccess? publicNetworkAccess = default; UpdateChannel? updateChannel = default; bool? disableAccessKeyAuthentication = default; + ZonalAllocationPolicy? zonalAllocationPolicy = default; RedisSku sku = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -307,6 +313,15 @@ internal static RedisPatch DeserializeRedisPatch(JsonElement element, ModelReade disableAccessKeyAuthentication = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("zonalAllocationPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalAllocationPolicy = new ZonalAllocationPolicy(property0.Value.GetString()); + continue; + } if (property0.NameEquals("sku"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -339,6 +354,7 @@ internal static RedisPatch DeserializeRedisPatch(JsonElement element, ModelReade publicNetworkAccess, updateChannel, disableAccessKeyAuthentication, + zonalAllocationPolicy, sku, serializedAdditionalRawData); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs index 88e08b747e0c..424516d4834d 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs @@ -67,9 +67,10 @@ public RedisPatch() /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. /// The SKU of the Redis cache to deploy. /// Keeps track of any properties unknown to the library. - internal RedisPatch(IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, IDictionary serializedAdditionalRawData) + internal RedisPatch(IDictionary tags, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, ZonalAllocationPolicy? zonalAllocationPolicy, RedisSku sku, IDictionary serializedAdditionalRawData) { Tags = tags; Identity = identity; @@ -84,6 +85,7 @@ internal RedisPatch(IDictionary tags, ManagedServiceIdentity ide PublicNetworkAccess = publicNetworkAccess; UpdateChannel = updateChannel; IsAccessKeyAuthenticationDisabled = isAccessKeyAuthenticationDisabled; + ZonalAllocationPolicy = zonalAllocationPolicy; Sku = sku; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -127,6 +129,9 @@ internal RedisPatch(IDictionary tags, ManagedServiceIdentity ide /// Authentication to Redis through access keys is disabled when set as true. Default value is false. [WirePath("properties.disableAccessKeyAuthentication")] public bool? IsAccessKeyAuthenticationDisabled { get; set; } + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. + [WirePath("properties.zonalAllocationPolicy")] + public ZonalAllocationPolicy? ZonalAllocationPolicy { get; set; } /// The SKU of the Redis cache to deploy. [WirePath("properties.sku")] public RedisSku Sku { get; set; } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ZonalAllocationPolicy.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ZonalAllocationPolicy.cs new file mode 100644 index 000000000000..a2a99e3ba8d1 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ZonalAllocationPolicy.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Redis.Models +{ + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. + public readonly partial struct ZonalAllocationPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZonalAllocationPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string UserDefinedValue = "UserDefined"; + private const string NoZonesValue = "NoZones"; + + /// Automatic. + public static ZonalAllocationPolicy Automatic { get; } = new ZonalAllocationPolicy(AutomaticValue); + /// UserDefined. + public static ZonalAllocationPolicy UserDefined { get; } = new ZonalAllocationPolicy(UserDefinedValue); + /// NoZones. + public static ZonalAllocationPolicy NoZones { get; } = new ZonalAllocationPolicy(NoZonesValue); + /// Determines if two values are the same. + public static bool operator ==(ZonalAllocationPolicy left, ZonalAllocationPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZonalAllocationPolicy left, ZonalAllocationPolicy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ZonalAllocationPolicy(string value) => new ZonalAllocationPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZonalAllocationPolicy other && Equals(other); + /// + public bool Equals(ZonalAllocationPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentCollection.cs index 2140cf2f28bb..c0029f2408d9 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string acc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accessPolicyAssignm /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accessPolicyAssignmentName, Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentResource.cs index fd5475a7570d..65814a450349 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs index 84be67cbe674..e5aefb8c5c0b 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string accessPolicyN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accessPolicyName, C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accessPolicyName, CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs index cc42b3bf7216..a06f2cbd8a82 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCollection.cs index a3b2a8c44ff4..51dd810f0e6d 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string name, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string name, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task> GetIfExistsAsync(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.Serialization.cs index bcdafcfab61c..4e92425bdbb6 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.Serialization.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.Serialization.cs @@ -119,6 +119,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("disableAccessKeyAuthentication"u8); writer.WriteBooleanValue(IsAccessKeyAuthenticationDisabled.Value); } + if (Optional.IsDefined(ZonalAllocationPolicy)) + { + writer.WritePropertyName("zonalAllocationPolicy"u8); + writer.WriteStringValue(ZonalAllocationPolicy.Value.ToString()); + } writer.WritePropertyName("sku"u8); writer.WriteObjectValue(Sku, options); if (Optional.IsDefined(SubnetId)) @@ -235,6 +240,7 @@ internal static RedisData DeserializeRedisData(JsonElement element, ModelReaderW RedisPublicNetworkAccess? publicNetworkAccess = default; UpdateChannel? updateChannel = default; bool? disableAccessKeyAuthentication = default; + ZonalAllocationPolicy? zonalAllocationPolicy = default; RedisSku sku = default; ResourceIdentifier subnetId = default; IPAddress staticIP = default; @@ -425,6 +431,15 @@ internal static RedisData DeserializeRedisData(JsonElement element, ModelReaderW disableAccessKeyAuthentication = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("zonalAllocationPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalAllocationPolicy = new ZonalAllocationPolicy(property0.Value.GetString()); + continue; + } if (property0.NameEquals("sku"u8)) { sku = RedisSku.DeserializeRedisSku(property0.Value, options); @@ -561,6 +576,7 @@ internal static RedisData DeserializeRedisData(JsonElement element, ModelReaderW publicNetworkAccess, updateChannel, disableAccessKeyAuthentication, + zonalAllocationPolicy, sku, subnetId, staticIP, @@ -938,6 +954,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ZonalAllocationPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" zonalAllocationPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ZonalAllocationPolicy)) + { + builder.Append(" zonalAllocationPolicy: "); + builder.AppendLine($"'{ZonalAllocationPolicy.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Sku), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs index bc879c24f330..74b4b3b58549 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs @@ -89,6 +89,7 @@ public RedisData(AzureLocation location, RedisSku sku) : base(location) /// Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. /// Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. /// Authentication to Redis through access keys is disabled when set as true. Default value is false. + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. /// The SKU of the Redis cache to deploy. /// The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1. /// Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. @@ -101,7 +102,7 @@ public RedisData(AzureLocation location, RedisSku sku) : base(location) /// List of the Redis instances associated with the cache. /// List of private endpoint connection associated with the specified redis cache. /// Keeps track of any properties unknown to the library. - internal RedisData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList zones, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, RedisAccessKeys accessKeys, IReadOnlyList linkedServers, IReadOnlyList instances, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal RedisData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList zones, ManagedServiceIdentity identity, RedisCommonConfiguration redisConfiguration, string redisVersion, bool? enableNonSslPort, int? replicasPerMaster, int? replicasPerPrimary, IDictionary tenantSettings, int? shardCount, RedisTlsVersion? minimumTlsVersion, RedisPublicNetworkAccess? publicNetworkAccess, UpdateChannel? updateChannel, bool? isAccessKeyAuthenticationDisabled, ZonalAllocationPolicy? zonalAllocationPolicy, RedisSku sku, ResourceIdentifier subnetId, IPAddress staticIP, RedisProvisioningState? provisioningState, string hostName, int? port, int? sslPort, RedisAccessKeys accessKeys, IReadOnlyList linkedServers, IReadOnlyList instances, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Zones = zones; Identity = identity; @@ -116,6 +117,7 @@ internal RedisData(ResourceIdentifier id, string name, ResourceType resourceType PublicNetworkAccess = publicNetworkAccess; UpdateChannel = updateChannel; IsAccessKeyAuthenticationDisabled = isAccessKeyAuthenticationDisabled; + ZonalAllocationPolicy = zonalAllocationPolicy; Sku = sku; SubnetId = subnetId; StaticIP = staticIP; @@ -174,6 +176,9 @@ internal RedisData() /// Authentication to Redis through access keys is disabled when set as true. Default value is false. [WirePath("properties.disableAccessKeyAuthentication")] public bool? IsAccessKeyAuthenticationDisabled { get; set; } + /// Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. + [WirePath("properties.zonalAllocationPolicy")] + public ZonalAllocationPolicy? ZonalAllocationPolicy { get; set; } /// The SKU of the Redis cache to deploy. [WirePath("properties.sku")] public RedisSku Sku { get; set; } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleCollection.cs index 81af3b1faad3..ab6f683d98d6 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string ruleName, Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string ruleName, Cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string ruleName, CancellationToken cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleResource.cs index 00cffefdd687..3c291441b206 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisFirewallRuleResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyCollection.cs index 6f5d1829f38f..f0c8bacba046 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string linked /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string linkedServerName, C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string linkedServerName, CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs index 9ef97cfbd3af..d50c219eb3c2 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleCollection.cs index 627048b6d832..8ea3cc3d129f 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual async Task> GetAsync(RedisPa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -245,7 +245,7 @@ public virtual Response Get(RedisPatchScheduleDefaul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -305,7 +305,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual async Task> ExistsAsync(RedisPatchScheduleDefaultN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual Response Exists(RedisPatchScheduleDefaultName defaultName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -424,7 +424,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleResource.cs index eb05be81d642..671ba1039eb2 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPatchScheduleResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionCollection.cs index 41d1e09142ac..0d5e18e56631 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionCollection.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string priva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionResource.cs index b9c8f2aba046..d430aeda86db 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs index 46434414da26..272d460ece5d 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs @@ -116,7 +116,7 @@ public virtual RedisFirewallRuleCollection GetRedisFirewallRules() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual async Task> GetRedisFirewallR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual RedisPatchScheduleCollection GetRedisPatchSchedules() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetRedisPatchSch /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -250,7 +250,7 @@ public virtual RedisLinkedServerWithPropertyCollection GetRedisLinkedServerWithP /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual async Task> GetRe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual RedisPrivateEndpointConnectionCollection GetRedisPrivateEndpointC /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -350,7 +350,7 @@ public virtual async Task> GetR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -388,7 +388,7 @@ public virtual RedisCacheAccessPolicyCollection GetRedisCacheAccessPolicies() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> GetRedisCach /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -457,7 +457,7 @@ public virtual RedisCacheAccessPolicyAssignmentCollection GetRedisCacheAccessPol /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -488,7 +488,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -519,7 +519,7 @@ public virtual Response GetRedisCacheA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual async Task> GetAsync(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response Get(CancellationToken cancellationToken = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -641,7 +641,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -683,7 +683,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -729,7 +729,7 @@ public virtual async Task> UpdateAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -775,7 +775,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, RedisPatc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -806,7 +806,7 @@ public virtual AsyncPageable GetUpgradeNotificationsAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -837,7 +837,7 @@ public virtual Pageable GetUpgradeNotifications(double /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -875,7 +875,7 @@ public virtual async Task> GetKeysAsync(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -913,7 +913,7 @@ public virtual Response GetKeys(CancellationToken cancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -955,7 +955,7 @@ public virtual async Task> RegenerateKeyAsync(RedisReg /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -997,7 +997,7 @@ public virtual Response RegenerateKey(RedisRegenerateKeyContent /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1039,7 +1039,7 @@ public virtual async Task> ForceRebootAsync(Red /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1081,7 +1081,7 @@ public virtual Response ForceReboot(RedisRebootContent c /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1127,7 +1127,7 @@ public virtual async Task ImportDataAsync(WaitUntil waitUntil, Imp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1173,7 +1173,7 @@ public virtual ArmOperation ImportData(WaitUntil waitUntil, ImportRdbContent con /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1219,7 +1219,7 @@ public virtual async Task ExportDataAsync(WaitUntil waitUntil, Exp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1265,7 +1265,7 @@ public virtual ArmOperation ExportData(WaitUntil waitUntil, ExportRdbContent con /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1307,7 +1307,7 @@ public virtual async Task> FlushCacheAsync(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1349,7 +1349,7 @@ public virtual ArmOperation FlushCache(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -1374,7 +1374,7 @@ public virtual AsyncPageable GetPrivateLinkResourcesBy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// @@ -1399,7 +1399,7 @@ public virtual Pageable GetPrivateLinkResourcesByRedis /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1461,7 +1461,7 @@ public virtual async Task> AddTagAsync(string key, strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1523,7 +1523,7 @@ public virtual Response AddTag(string key, string value, Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1580,7 +1580,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1637,7 +1637,7 @@ public virtual Response SetTags(IDictionary tags, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource @@ -1697,7 +1697,7 @@ public virtual async Task> RemoveTagAsync(string key, Ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs index d40fc992fe61..82f3da828fde 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs @@ -32,7 +32,7 @@ public AccessPolicyAssignmentRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs index be99b6b63053..5ac37aa1ddcf 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs @@ -32,7 +32,7 @@ public AccessPolicyRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs index b0c4061afdcd..745f1bacaf20 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs @@ -32,7 +32,7 @@ public AsyncOperationStatusRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs index 95ea57be94bd..c93a776fffc8 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -32,7 +32,7 @@ public FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs index b17d570b0543..96dd28a91d19 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs @@ -32,7 +32,7 @@ public LinkedServerRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs index ea1d944187db..5e85fe8ae7f8 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs @@ -32,7 +32,7 @@ public PatchSchedulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 907974e3c07d..33e5a04bcfc3 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 1952dfbeef8d..ab45f8b4958f 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs index edd3b0c8dd4a..62b9ce63e3c8 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs @@ -32,7 +32,7 @@ public RedisRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md index d3e0752de0f8..5e75dd68d0ba 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md +++ b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Redis namespace: Azure.ResourceManager.Redis -require: https://github.com/Azure/azure-rest-api-specs/blob/3cb1b51638616435470fc10ea00de92512186ece/specification/redis/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/9069559e0fe5ed52b884ddc658fa539ec67c7ef8/specification/redis/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -20,7 +20,6 @@ modelerfour: lenient-model-deduplication: true use-model-reader-writer: true enable-bicep-serialization: true -tag: package-2024-03 rename-mapping: CheckNameAvailabilityParameters: RedisNameAvailabilityContent diff --git a/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/FirewallFunctionalTests.cs b/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/FirewallFunctionalTests.cs index 7daf04d14e48..12084e598c93 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/FirewallFunctionalTests.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/FirewallFunctionalTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Net; using System.Threading.Tasks; using Azure.Core.TestFramework; @@ -71,8 +72,10 @@ public async Task CreateUpdateDeleteTest() // Delete await ruleTwo.DeleteAsync(WaitUntil.Completed); + rules = await firewallCollection.GetAllAsync().ToEnumerableAsync(); + Assert.AreEqual(1, rules.Count); var falseResult = (await firewallCollection.ExistsAsync("RuleTwo")).Value; - Assert.IsTrue(falseResult); + Assert.IsFalse(falseResult); } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/ZonalAllocationPolicyFunctionalTests.cs b/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/ZonalAllocationPolicyFunctionalTests.cs new file mode 100644 index 000000000000..7fdfbb3d4226 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/tests/ScenarioTests/ZonalAllocationPolicyFunctionalTests.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.ResourceManager.Redis.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Redis.Tests +{ + public class ZonalAllocationPolicyFunctionalTests : RedisManagementTestBase + { + public ZonalAllocationPolicyFunctionalTests(bool isAsync) + : base(isAsync) // RecordedTestMode.Record) + { + } + + private ResourceGroupResource ResourceGroup { get; set; } + + private RedisCollection Collection { get; set; } + + private async Task SetCollectionsAsync() + { + ResourceGroup = await CreateResourceGroupAsync(); + Collection = ResourceGroup.GetAllRedis(); + } + + [Test] + public async Task AutomaticZonalAllocationStandardCacheCreationTest() + { + await SetCollectionsAsync(); + + var redisCacheName = Recording.GenerateAssetName("RedisZonalAllocationPolicy"); + var parameter = new RedisCreateOrUpdateContent(DefaultLocation, new RedisSku(RedisSkuName.Standard, RedisSkuFamily.BasicOrStandard, 0)) + { + ZonalAllocationPolicy = ZonalAllocationPolicy.Automatic + }; + + var responseCreate = (await Collection.CreateOrUpdateAsync(WaitUntil.Completed, redisCacheName, parameter)).Value; + + Assert.AreEqual(DefaultLocation, responseCreate.Data.Location); + Assert.AreEqual(redisCacheName, responseCreate.Data.Name); + Assert.AreEqual(RedisSkuName.Standard, responseCreate.Data.Sku.Name); + Assert.AreEqual(RedisSkuFamily.BasicOrStandard, responseCreate.Data.Sku.Family); + Assert.AreEqual(0, responseCreate.Data.Sku.Capacity); + Assert.AreEqual(ZonalAllocationPolicy.Automatic, responseCreate.Data.ZonalAllocationPolicy); + Assert.IsEmpty(responseCreate.Data.Zones); + + await responseCreate.DeleteAsync(WaitUntil.Completed); + var falseResult = (await Collection.ExistsAsync(redisCacheName)).Value; + Assert.IsFalse(falseResult); + } + + [Test] + public async Task AutomaticZonalAllocationPremiumCacheCreationTest() + { + await SetCollectionsAsync(); + + var redisCacheName = Recording.GenerateAssetName("RedisZonalAllocationPolicy"); + var parameter = new RedisCreateOrUpdateContent(DefaultLocation, new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + ZonalAllocationPolicy = ZonalAllocationPolicy.Automatic + }; + + var responseCreate = (await Collection.CreateOrUpdateAsync(WaitUntil.Completed, redisCacheName, parameter)).Value; + + Assert.AreEqual(DefaultLocation, responseCreate.Data.Location); + Assert.AreEqual(redisCacheName, responseCreate.Data.Name); + Assert.AreEqual(RedisSkuName.Premium, responseCreate.Data.Sku.Name); + Assert.AreEqual(RedisSkuFamily.Premium, responseCreate.Data.Sku.Family); + Assert.AreEqual(1, responseCreate.Data.Sku.Capacity); + Assert.AreEqual(ZonalAllocationPolicy.Automatic, responseCreate.Data.ZonalAllocationPolicy); + Assert.IsEmpty(responseCreate.Data.Zones); + + await responseCreate.DeleteAsync(WaitUntil.Completed); + var falseResult = (await Collection.ExistsAsync(redisCacheName)).Value; + Assert.IsFalse(falseResult); + } + + [Test] + public async Task NoZonesZonalAllocationPremiumCacheCreationTest() + { + await SetCollectionsAsync(); + + var redisCacheName = Recording.GenerateAssetName("RedisZonalAllocationPolicy"); + var parameter = new RedisCreateOrUpdateContent(DefaultLocation, new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + ZonalAllocationPolicy = ZonalAllocationPolicy.NoZones + }; + + var responseCreate = (await Collection.CreateOrUpdateAsync(WaitUntil.Completed, redisCacheName, parameter)).Value; + + Assert.AreEqual(DefaultLocation, responseCreate.Data.Location); + Assert.AreEqual(redisCacheName, responseCreate.Data.Name); + Assert.AreEqual(RedisSkuName.Premium, responseCreate.Data.Sku.Name); + Assert.AreEqual(RedisSkuFamily.Premium, responseCreate.Data.Sku.Family); + Assert.AreEqual(1, responseCreate.Data.Sku.Capacity); + Assert.AreEqual(ZonalAllocationPolicy.NoZones, responseCreate.Data.ZonalAllocationPolicy); + Assert.IsEmpty(responseCreate.Data.Zones); + + await responseCreate.DeleteAsync(WaitUntil.Completed); + var falseResult = (await Collection.ExistsAsync(redisCacheName)).Value; + Assert.IsFalse(falseResult); + } + + [Test] + public async Task UserDefinedZonalAllocationPremiumCacheCreationTest() + { + await SetCollectionsAsync(); + + var redisCacheName = Recording.GenerateAssetName("RedisZonalAllocationPolicy"); + var parameter = new RedisCreateOrUpdateContent(DefaultLocation, new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + Zones = { "1", "2" }, + ZonalAllocationPolicy = ZonalAllocationPolicy.UserDefined + }; + + var responseCreate = (await Collection.CreateOrUpdateAsync(WaitUntil.Completed, redisCacheName, parameter)).Value; + + Assert.AreEqual(DefaultLocation, responseCreate.Data.Location); + Assert.AreEqual(redisCacheName, responseCreate.Data.Name); + Assert.AreEqual(RedisSkuName.Premium, responseCreate.Data.Sku.Name); + Assert.AreEqual(RedisSkuFamily.Premium, responseCreate.Data.Sku.Family); + Assert.AreEqual(1, responseCreate.Data.Sku.Capacity); + Assert.AreEqual(ZonalAllocationPolicy.UserDefined, responseCreate.Data.ZonalAllocationPolicy); + Assert.AreEqual(new List { "1", "2" }, responseCreate.Data.Zones); + + await responseCreate.DeleteAsync(WaitUntil.Completed); + var falseResult = (await Collection.ExistsAsync(redisCacheName)).Value; + Assert.IsFalse(falseResult); + } + + [Test] + public async Task UpdateToAutomaticZonalAllocationPolicyTest() + { + await SetCollectionsAsync(); + + var redisCacheName = Recording.GenerateAssetName("RedisZonalAllocationPolicy"); + var parameter = new RedisCreateOrUpdateContent(DefaultLocation, new RedisSku(RedisSkuName.Premium, RedisSkuFamily.Premium, 1)) + { + ZonalAllocationPolicy = ZonalAllocationPolicy.NoZones + }; + + var responseCreate = (await Collection.CreateOrUpdateAsync(WaitUntil.Completed, redisCacheName, parameter)).Value; + + Assert.AreEqual(DefaultLocation, responseCreate.Data.Location); + Assert.AreEqual(redisCacheName, responseCreate.Data.Name); + Assert.AreEqual(RedisSkuName.Premium, responseCreate.Data.Sku.Name); + Assert.AreEqual(RedisSkuFamily.Premium, responseCreate.Data.Sku.Family); + Assert.AreEqual(1, responseCreate.Data.Sku.Capacity); + Assert.AreEqual(ZonalAllocationPolicy.NoZones, responseCreate.Data.ZonalAllocationPolicy); + Assert.IsEmpty(responseCreate.Data.Zones); + + var patch = new RedisPatch() + { + ZonalAllocationPolicy = ZonalAllocationPolicy.Automatic + }; + + var responseUpdate = (await responseCreate.UpdateAsync(WaitUntil.Completed, patch)).Value; + var response = (await ResourceGroup.GetAllRedis().GetAsync(redisCacheName)).Value; + Assert.AreEqual(ZonalAllocationPolicy.Automatic, response.Data.ZonalAllocationPolicy); + + await responseUpdate.DeleteAsync(WaitUntil.Completed); + var falseResult = (await Collection.ExistsAsync(redisCacheName)).Value; + Assert.IsFalse(falseResult); + } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md index 3a4bd24461e2..215569028edd 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/CHANGELOG.md @@ -104,8 +104,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -136,5 +136,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/README.md b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/README.md index 13162689f9ba..66df876babf6 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/README.md +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md b/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md index 0158d89184d7..706521940099 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md +++ b/sdk/relay/Azure.ResourceManager.Relay/CHANGELOG.md @@ -87,4 +87,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/relay/Azure.ResourceManager.Relay/README.md b/sdk/relay/Azure.ResourceManager.Relay/README.md index 5aa38b2dac48..a643b20804dd 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/README.md +++ b/sdk/relay/Azure.ResourceManager.Relay/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/remoterendering/Azure.MixedReality.RemoteRendering/README.md b/sdk/remoterendering/Azure.MixedReality.RemoteRendering/README.md index 2a8af891f098..a0e09191d51f 100644 --- a/sdk/remoterendering/Azure.MixedReality.RemoteRendering/README.md +++ b/sdk/remoterendering/Azure.MixedReality.RemoteRendering/README.md @@ -7,10 +7,10 @@ the lifetime of remote rendering sessions. > NOTE: Once a session is running, a client application will connect to it using one of the "runtime SDKs". > These SDKs are designed to best support the needs of an interactive application doing 3d rendering. -> They are available in ([.net](https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering) -> or ([C++](https://docs.microsoft.com/cpp/api/remote-rendering/)). +> They are available in ([.net](https://learn.microsoft.com/dotnet/api/microsoft.azure.remoterendering) +> or ([C++](https://learn.microsoft.com/cpp/api/remote-rendering/)). -[Product documentation](https://docs.microsoft.com/azure/remote-rendering/) +[Product documentation](https://learn.microsoft.com/azure/remote-rendering/) ## Getting started @@ -30,7 +30,7 @@ Add a package reference: ### Prerequisites -You will need an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an [Azure Remote Rendering account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package. +You will need an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an [Azure Remote Rendering account](https://learn.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package. ### Authenticate the client @@ -49,7 +49,7 @@ There are several different forms of authentication: method for production applications because it allows you to avoid embedding the credentials for access to Azure Spatial Anchors in your client application. -See [here](https://docs.microsoft.com/azure/remote-rendering/how-tos/authentication) for detailed instructions and information. +See [here](https://learn.microsoft.com/azure/remote-rendering/how-tos/authentication) for detailed instructions and information. In all the following examples, the client is constructed with a `remoteRenderingEndpoint` Uri object. The available endpoints correspond to regions, and the choice of endpoint determines the region in which the service performs its work. @@ -307,7 +307,7 @@ client.StopSession(sessionId); ## Troubleshooting -For general troubleshooting advice concerning Azure Remote Rendering, see [the Troubleshoot page](https://docs.microsoft.com/azure/remote-rendering/resources/troubleshoot) for remote rendering at docs.microsoft.com. +For general troubleshooting advice concerning Azure Remote Rendering, see [the Troubleshoot page](https://learn.microsoft.com/azure/remote-rendering/resources/troubleshoot) for remote rendering at learn.microsoft.com. The client methods will throw exceptions if the request cannot be made. However, in the case of both conversions and sessions, the requests can succeed but the requested operation may not be successful. @@ -324,10 +324,10 @@ RemoteRenderingServiceError with details. ## Next steps -- Read the [Product documentation](https://docs.microsoft.com/azure/remote-rendering/) +- Read the [Product documentation](https://learn.microsoft.com/azure/remote-rendering/) - Learn about the runtime SDKs: - - .NET: https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering - - C++: https://docs.microsoft.com/cpp/api/remote-rendering/ + - .NET: https://learn.microsoft.com/dotnet/api/microsoft.azure.remoterendering + - C++: https://learn.microsoft.com/cpp/api/remote-rendering/ ## Contributing diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md b/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md index c06b70184032..912eb8a72699 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md +++ b/sdk/reservations/Azure.ResourceManager.Reservations/CHANGELOG.md @@ -86,8 +86,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -118,4 +118,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/README.md b/sdk/reservations/Azure.ResourceManager.Reservations/README.md index 7bc657b9bf31..3e4128a82d1c 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/README.md +++ b/sdk/reservations/Azure.ResourceManager.Reservations/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/CHANGELOG.md b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/CHANGELOG.md index 26a625844bb1..ed5cde69869b 100644 --- a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/CHANGELOG.md +++ b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/CHANGELOG.md @@ -37,4 +37,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/README.md b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/README.md index b286c1553e89..f055508dcb15 100644 --- a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/README.md +++ b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/README.md @@ -40,7 +40,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md index e420a7db014d..4effe3553a47 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/CHANGELOG.md @@ -78,4 +78,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/README.md b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/README.md index 000ccac3967d..ec9ad784234d 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/README.md +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md index e6188c614912..dc754572bf8d 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/CHANGELOG.md @@ -66,8 +66,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -92,4 +92,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/README.md b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/README.md index 8d418d5a589a..c8fb34847c09 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/README.md +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md index a765afc8554f..8944825231ab 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md +++ b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md @@ -332,4 +332,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/resourcemanager/Azure.ResourceManager/README.md b/sdk/resourcemanager/Azure.ResourceManager/README.md index 3a064ef04b60..03bcbc914250 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/README.md +++ b/sdk/resourcemanager/Azure.ResourceManager/README.md @@ -29,11 +29,11 @@ dotnet add package Azure.ResourceManager - Set up a way to authenticate to Azure with Azure Identity. Some options are: - - Through the [Azure CLI sign in](https://docs.microsoft.com/cli/azure/authenticate-azure-cli). - - Via [Visual Studio](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#authenticating-via-visual-studio). + - Through the [Azure CLI sign in](https://learn.microsoft.com/cli/azure/authenticate-azure-cli). + - Via [Visual Studio](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#authenticating-via-visual-studio). - Setting [Environment Variables](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/AuthUsingEnvironmentVariables.md). - More information and different authentication approaches using Azure Identity can be found in [this document](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). + More information and different authentication approaches using Azure Identity can be found in [this document](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). ### Authenticate the Client @@ -70,7 +70,7 @@ TokenCredential credential = new ClientSecretCredential(tenantId, clientId, clie ArmClient client = new ArmClient(credential, subscriptionId, armOptions); ``` -More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). +More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). ## Key concepts @@ -493,7 +493,7 @@ To run test with code coverage and auto generate an html report with just a sing - [Managing Resource Groups](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/Sample2_ManagingResourceGroups.md) - [Creating a Virtual Network](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md) -- [.NET Management Library Code Samples](https://docs.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) +- [.NET Management Library Code Samples](https://learn.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) ### Other Documentation diff --git a/sdk/resourcemanager/Azure.ResourceManager/docs/MigrationGuide.md b/sdk/resourcemanager/Azure.ResourceManager/docs/MigrationGuide.md index 119a434f27a3..78d8d27afbdf 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/docs/MigrationGuide.md +++ b/sdk/resourcemanager/Azure.ResourceManager/docs/MigrationGuide.md @@ -718,4 +718,4 @@ await virtualNetwork.DeleteAsync(WaitUntil.Completed); ## Next steps -Check out [more .NET Management Library Code Samples](https://docs.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) we have available. +Check out [more .NET Management Library Code Samples](https://learn.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) we have available. diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/CHANGELOG.md b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/CHANGELOG.md index 2b3dd1f3cee5..e7934b4f0f53 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/CHANGELOG.md +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/CHANGELOG.md @@ -87,8 +87,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -119,4 +119,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/README.md b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/README.md index 54b97c638a64..7eaac984f1a8 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/README.md +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md index 83c0020aeaed..152a53373060 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md +++ b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md @@ -181,4 +181,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/resources/Azure.ResourceManager.Resources/README.md b/sdk/resources/Azure.ResourceManager.Resources/README.md index 8799317ddc36..dba200751460 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/README.md +++ b/sdk/resources/Azure.ResourceManager.Resources/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/resources/Azure.ResourceManager.Resources/samples/Sample2_ManagingDeployments.md b/sdk/resources/Azure.ResourceManager.Resources/samples/Sample2_ManagingDeployments.md index a57d30f54805..2704a7941db5 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/samples/Sample2_ManagingDeployments.md +++ b/sdk/resources/Azure.ResourceManager.Resources/samples/Sample2_ManagingDeployments.md @@ -130,4 +130,4 @@ await deployment.DeleteAsync(WaitUntil.Completed); ## Learn more -Take a look at the [ARM template documentation](https://docs.microsoft.com/azure/azure-resource-manager/templates/). +Take a look at the [ARM template documentation](https://learn.microsoft.com/azure/azure-resource-manager/templates/). diff --git a/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md b/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md index 1fc42ca2f6a7..a71384177287 100644 --- a/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md +++ b/sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md @@ -171,10 +171,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [nuget]: https://www.nuget.org/ -[event_hubs_namespace]: https://docs.microsoft.com/azure/event-hubs/event-hubs-about +[event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-about [create_schema_group]: https://learn.microsoft.com/azure/event-hubs/create-schema-registry#create-a-schema-group -[azure_powershell]: https://docs.microsoft.com/powershell/azure/ -[create_event_hubs_namespace]: https://docs.microsoft.com/azure/event-hubs/event-hubs-quickstart-powershell#create-an-event-hubs-namespace +[azure_powershell]: https://learn.microsoft.com/powershell/azure/ +[create_event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-quickstart-powershell#create-an-event-hubs-namespace [quickstart_guide]: https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet [schema_registry_client]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/schemaregistry/Azure.Data.SchemaRegistry/src/SchemaRegistryClient.cs [azure_portal]: https://ms.portal.azure.com/ diff --git a/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md b/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md index dcff7cd86dbf..49d98ac5c0cf 100644 --- a/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md +++ b/sdk/schemaregistry/Azure.Data.SchemaRegistry/samples/Sample02_Serialization.md @@ -168,13 +168,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [nuget]: https://www.nuget.org/ -[event_hubs_namespace]: https://docs.microsoft.com/azure/event-hubs/event-hubs-about -[object_serializer]: https://docs.microsoft.com/dotnet/api/azure.core.serialization.objectserializer?view=azure-dotnet -[json_serializer]: https://docs.microsoft.com/dotnet/api/azure.core.serialization.jsonobjectserializer?view=azure-dotnet -[newtonsoft_serializer]: https://docs.microsoft.com/dotnet/api/azure.core.serialization.newtonsoftjsonobjectserializer?view=azure-dotnet +[event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-about +[object_serializer]: https://learn.microsoft.com/dotnet/api/azure.core.serialization.objectserializer?view=azure-dotnet +[json_serializer]: https://learn.microsoft.com/dotnet/api/azure.core.serialization.jsonobjectserializer?view=azure-dotnet +[newtonsoft_serializer]: https://learn.microsoft.com/dotnet/api/azure.core.serialization.newtonsoftjsonobjectserializer?view=azure-dotnet [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [email_opencode]: mailto:opencode@microsoft.com [azure_schema_registry]: https://aka.ms/schemaregistry -[request_failed_exception]: https://docs.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet +[request_failed_exception]: https://learn.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet diff --git a/sdk/schemaregistry/Azure.Data.SchemaRegistry/tsp-location.yaml b/sdk/schemaregistry/Azure.Data.SchemaRegistry/tsp-location.yaml index 93dfddce7393..dbc6151dfb95 100644 --- a/sdk/schemaregistry/Azure.Data.SchemaRegistry/tsp-location.yaml +++ b/sdk/schemaregistry/Azure.Data.SchemaRegistry/tsp-location.yaml @@ -1,4 +1,4 @@ repo: Azure/azure-rest-api-specs directory: specification/schemaregistry/SchemaRegistry additionalDirectories: [] -commit: ab064e0047ec560a700d6b501097d99471ad817b \ No newline at end of file +commit: 7e22a66617633d162735fe65388c2852127b4aac diff --git a/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md b/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md index 973a1a25362b..95789f4032fb 100644 --- a/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md +++ b/sdk/schemaregistry/Microsoft.Azure.Data.SchemaRegistry.ApacheAvro/README.md @@ -172,9 +172,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [nuget]: https://www.nuget.org/ -[event_hubs_namespace]: https://docs.microsoft.com/azure/event-hubs/event-hubs-about -[azure_powershell]: https://docs.microsoft.com/powershell/azure/ -[create_event_hubs_namespace]: https://docs.microsoft.com/azure/event-hubs/event-hubs-quickstart-powershell#create-an-event-hubs-namespace +[event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-about +[azure_powershell]: https://learn.microsoft.com/powershell/azure/ +[create_event_hubs_namespace]: https://learn.microsoft.com/azure/event-hubs/event-hubs-quickstart-powershell#create-an-event-hubs-namespace [quickstart_guide]: https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md [schema_registry_client]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/schemaregistry/Azure.Data.SchemaRegistry/src/SchemaRegistryClient.cs [azure_portal]: https://ms.portal.azure.com/ @@ -192,4 +192,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [specific_record]: https://avro.apache.org/docs/++version++/api/csharp/html/interfaceAvro_1_1Specific_1_1ISpecificRecord.html [azure_sub]: https://azure.microsoft.com/free/dotnet/ [azure_schema_registry]: https://aka.ms/schemaregistry -[request_failed_exception]: https://docs.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet +[request_failed_exception]: https://learn.microsoft.com/dotnet/api/azure.requestfailedexception?view=azure-dotnet diff --git a/sdk/search/Azure.ResourceManager.Search/CHANGELOG.md b/sdk/search/Azure.ResourceManager.Search/CHANGELOG.md index 5298696002c1..2dd191650556 100644 --- a/sdk/search/Azure.ResourceManager.Search/CHANGELOG.md +++ b/sdk/search/Azure.ResourceManager.Search/CHANGELOG.md @@ -87,8 +87,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -120,4 +120,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/search/Azure.ResourceManager.Search/README.md b/sdk/search/Azure.ResourceManager.Search/README.md index c8ccf74bef1e..4677a1490bad 100644 --- a/sdk/search/Azure.ResourceManager.Search/README.md +++ b/sdk/search/Azure.ResourceManager.Search/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/search/Azure.Search.Documents/CHANGELOG.md b/sdk/search/Azure.Search.Documents/CHANGELOG.md index f74a722d5e6f..b9a1f18f271e 100644 --- a/sdk/search/Azure.Search.Documents/CHANGELOG.md +++ b/sdk/search/Azure.Search.Documents/CHANGELOG.md @@ -111,7 +111,7 @@ - Added support for [Vector Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/samples/Sample07_VectorSearch.md). - Added support for [Semantic Search](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/samples/Sample08_SemanticSearch.md). - Added support for [`PiiDetectionSkill`](https://learn.microsoft.com/azure/search/cognitive-search-skill-pii-detection). It allows you extracts personal information from an input text and gives you the option of masking it using the Text Analytics API. -- Added new languages for `OcrSkill` and `ImageAnalysisSkill` as we have upgraded them to use Cognitive Services Computer Vision v3.2, which now includes support for additional languages. Refer to the language lists [here](https://docs.microsoft.com/azure/cognitive-services/computer-vision/language-support). +- Added new languages for `OcrSkill` and `ImageAnalysisSkill` as we have upgraded them to use Cognitive Services Computer Vision v3.2, which now includes support for additional languages. Refer to the language lists [here](https://learn.microsoft.com/azure/cognitive-services/computer-vision/language-support). - Added new languages for ` SplitSkill`. Language lists can be found [here](https://learn.microsoft.com/azure/search/cognitive-search-skill-textsplit#skill-parameters). - Deprecated `SentimentSkill.SkillVersion.V1` and `EntityRecognitionSkill.SkillVersion.V1`; use `SentimentSkill.SkillVersion.V3` and `EntityRecognitionSkill.SkillVersion.V3` instead. @@ -150,7 +150,7 @@ ## 11.5.0-beta.2 (2022-10-11) ### Features Added -- Added new languages for `OcrSkill` and `ImageAnalysisSkill` as we have upgraded them to use Cognitive Services Computer Vision v3.2 which supports a lot more languages for both APIs. Language lists can be found [here](https://docs.microsoft.com/azure/cognitive-services/computer-vision/language-support). +- Added new languages for `OcrSkill` and `ImageAnalysisSkill` as we have upgraded them to use Cognitive Services Computer Vision v3.2 which supports a lot more languages for both APIs. Language lists can be found [here](https://learn.microsoft.com/azure/cognitive-services/computer-vision/language-support). ### Bugs Fixed - Fixed user-assigned identity type names ([#29813](https://github.com/Azure/azure-sdk-for-net/issues/29813)). @@ -163,7 +163,7 @@ ## 11.4.0 (2022-09-06) ### Features Added -- Support for [Azure Active Directory](https://docs.microsoft.com/azure/active-directory/authentication/) based authentication. Users can specify a [`TokenCredential`](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential) when creating a `SearchClient`, `SearchIndexClient` or a `SearchIndexerClient`. For example, you can get started with `new SearchClient(endpoint, new DefaultAzureCredential())` to authenticate via AAD using [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). For more details see [how to use role-based authentication in Azure Cognitive Search](https://docs.microsoft.com/azure/search/search-security-rbac?tabs=config-svc-portal%2Crbac-portal). +- Support for [Azure Active Directory](https://learn.microsoft.com/azure/active-directory/authentication/) based authentication. Users can specify a [`TokenCredential`](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) when creating a `SearchClient`, `SearchIndexClient` or a `SearchIndexerClient`. For example, you can get started with `new SearchClient(endpoint, new DefaultAzureCredential())` to authenticate via AAD using [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). For more details see [how to use role-based authentication in Azure Cognitive Search](https://learn.microsoft.com/azure/search/search-security-rbac?tabs=config-svc-portal%2Crbac-portal). - Added multi-cloud support via `SearchClientOptions.Audience` to allow users to select the Azure cloud where the resource is located ([#30306](https://github.com/Azure/azure-sdk-for-net/issues/30306)). ### Bugs Fixed @@ -179,7 +179,7 @@ ## 11.4.0-beta.9 (2022-08-08) ### Features Added -- Added support for [Lexical normalizers](https://docs.microsoft.com/azure/search/search-normalizers#normalizers) in `SimpleField` and `SearchableField`. +- Added support for [Lexical normalizers](https://learn.microsoft.com/azure/search/search-normalizers#normalizers) in `SimpleField` and `SearchableField`. - Added multi-cloud support via `SearchClientOptions.Audience` to allow users to select the Azure cloud where the resource is located ([#30306](https://github.com/Azure/azure-sdk-for-net/issues/30306)). ## 11.4.0-beta.8 (2022-07-07) @@ -198,13 +198,13 @@ ## 11.4.0-beta.6 (2022-02-08) ### Features Added -- Added `Unk` as an `OcrSkillLanguage` value. The values are used to set the default language code for the [OCR cognitive skill](https://docs.microsoft.com/azure/search/cognitive-search-skill-ocr). -- Support for [`AzureMachineLearningSkill`](https://docs.microsoft.com/azure/search/cognitive-search-aml-skill). The AML skill allows you to extend AI enrichment with a custom [Azure Machine Learning](https://docs.microsoft.com/azure/machine-learning/overview-what-is-azure-machine-learning) (AML) model. Once an AML model is [trained and deployed](https://docs.microsoft.com/azure/machine-learning/concept-azure-machine-learning-architecture#workspace), an AML skill integrates it into AI enrichment. +- Added `Unk` as an `OcrSkillLanguage` value. The values are used to set the default language code for the [OCR cognitive skill](https://learn.microsoft.com/azure/search/cognitive-search-skill-ocr). +- Support for [`AzureMachineLearningSkill`](https://learn.microsoft.com/azure/search/cognitive-search-aml-skill). The AML skill allows you to extend AI enrichment with a custom [Azure Machine Learning](https://learn.microsoft.com/azure/machine-learning/overview-what-is-azure-machine-learning) (AML) model. Once an AML model is [trained and deployed](https://learn.microsoft.com/azure/machine-learning/concept-azure-machine-learning-architecture#workspace), an AML skill integrates it into AI enrichment. ## 11.4.0-beta.5 (2021-11-09) ### Features Added -- Added support for [Semantic Search](https://docs.microsoft.com/azure/search/semantic-search-overview). `SearchOptions` now support specifying `SemanticSettings` to influence the search behavior. +- Added support for [Semantic Search](https://learn.microsoft.com/azure/search/semantic-search-overview). `SearchOptions` now support specifying `SemanticSettings` to influence the search behavior. ### Breaking Changes - Renamed `IndexerStateHighWaterMark` to `IndexerChangeTrackingState`. @@ -213,7 +213,7 @@ ## 11.4.0-beta.4 (2021-10-05) ### Features Added -- Added APIs to [reset documents](https://docs.microsoft.com/azure/search/search-howto-run-reset-indexers#reset-docs-preview) and [skills](https://docs.microsoft.com/azure/search/search-howto-run-reset-indexers#reset-skills-preview). +- Added APIs to [reset documents](https://learn.microsoft.com/azure/search/search-howto-run-reset-indexers#reset-docs-preview) and [skills](https://learn.microsoft.com/azure/search/search-howto-run-reset-indexers#reset-skills-preview). ### Breaking Changes - Renamed `QueryAnswer` to `QueryAnswerType` in `SearchOptions`. @@ -224,12 +224,12 @@ ## 11.4.0-beta.3 (2021-09-07) ### Features Added -- Support for [Lexical normalizers](https://docs.microsoft.com/azure/search/search-normalizers#normalizers) in [text analysers](https://docs.microsoft.com/rest/api/searchservice/test-analyzer) via `AnalyzeTextOptions`. +- Support for [Lexical normalizers](https://learn.microsoft.com/azure/search/search-normalizers#normalizers) in [text analysers](https://learn.microsoft.com/rest/api/searchservice/test-analyzer) via `AnalyzeTextOptions`. ## 11.4.0-beta.2 (2021-08-10) ### Features Added -- Support for [Azure Active Directory](https://docs.microsoft.com/azure/active-directory/authentication/) based authentication. Users can specify a [`TokenCredential`](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential) when creating a `SearchClient`, `SearchIndexClient` or a `SearchIndexerClient`. For example, you can get started with `new SearchClient(endpoint, new DefaultAzureCredential())` to authenticate via AAD using [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). For more details see [how to use role-based authentication in Azure Cognitive Search](https://docs.microsoft.com/azure/search/search-security-rbac?tabs=config-svc-portal%2Crbac-portal). +- Support for [Azure Active Directory](https://learn.microsoft.com/azure/active-directory/authentication/) based authentication. Users can specify a [`TokenCredential`](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) when creating a `SearchClient`, `SearchIndexClient` or a `SearchIndexerClient`. For example, you can get started with `new SearchClient(endpoint, new DefaultAzureCredential())` to authenticate via AAD using [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). For more details see [how to use role-based authentication in Azure Cognitive Search](https://learn.microsoft.com/azure/search/search-security-rbac?tabs=config-svc-portal%2Crbac-portal). ### Bugs Fixed - Enhanced the documentation of some `SearchOptions` properties by adding links to REST docs - https://github.com/Azure/azure-sdk-for-net/issues/22808 @@ -237,8 +237,8 @@ ## 11.4.0-beta.1 (2021-07-06) ### Features Added -- Support for additional/enhanced skills - [EntityLinkingSkill](https://docs.microsoft.com/azure/search/cognitive-search-skill-entity-linking-v3), [EntityRecognitionSkill](https://docs.microsoft.com/azure/search/cognitive-search-skill-entity-recognition-v3), [PiiDetectionSkill](https://docs.microsoft.com/azure/search/cognitive-search-skill-pii-detection), [SentimentSkill](https://docs.microsoft.com/azure/search/cognitive-search-skill-sentiment-v3) -- Use managed identities in Azure Active Directory with [SearchIndexerDataIdentity](https://docs.microsoft.com/azure/search/search-howto-managed-identities-data-sources) +- Support for additional/enhanced skills - [EntityLinkingSkill](https://learn.microsoft.com/azure/search/cognitive-search-skill-entity-linking-v3), [EntityRecognitionSkill](https://learn.microsoft.com/azure/search/cognitive-search-skill-entity-recognition-v3), [PiiDetectionSkill](https://learn.microsoft.com/azure/search/cognitive-search-skill-pii-detection), [SentimentSkill](https://learn.microsoft.com/azure/search/cognitive-search-skill-sentiment-v3) +- Use managed identities in Azure Active Directory with [SearchIndexerDataIdentity](https://learn.microsoft.com/azure/search/search-howto-managed-identities-data-sources) ## 11.3.0 (2021-06-08) @@ -248,16 +248,16 @@ ## 11.3.0-beta.2 (2021-05-11) ### Added -- Added support for [Semantic Search](https://docs.microsoft.com/azure/search/semantic-search-overview). +- Added support for [Semantic Search](https://learn.microsoft.com/azure/search/semantic-search-overview). ## 11.3.0-beta.1 (2021-04-06) ### Added -- Added support for [`Azure.Core.GeoJson`](https://docs.microsoft.com/dotnet/api/azure.core.geojson) types in `SearchDocument`, `SearchFilter` and `FieldBuilder`. -- Added [`EventSource`](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource) based logging. Event source name is **Azure-Search-Documents**. Current set of events are focused on tuning batch sizes for [`SearchIndexingBufferedSender`](https://docs.microsoft.com/dotnet/api/azure.search.documents.searchindexingbufferedsender-1). -- Added [`CustomEntityLookupSkill`](https://docs.microsoft.com/azure/search/cognitive-search-skill-custom-entity-lookup) and [`DocumentExtractionSkill`](https://docs.microsoft.com/azure/search/cognitive-search-skill-document-extraction). Added `DefaultCountryHint` in [`LanguageDetectionSkill`](https://docs.microsoft.com/azure/search/cognitive-search-skill-language-detection). -- Added [`LexicalNormalizer`](https://docs.microsoft.com/azure/search/search-normalizers#predefined-normalizers) to include predefined set of normalizers. See [here](https://docs.microsoft.com/azure/search/search-normalizers) for more details on search normalizers. Added `Normalizer` as a [`SearchField`](https://docs.microsoft.com/dotnet/api/azure.search.documents.indexes.models.searchfield) in an index definition. -- Added support for Azure Data Lake Storage Gen2 - [`AdlsGen2`](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-introduction) in [`SearchIndexerDataSourceType`](https://docs.microsoft.com/dotnet/api/azure.search.documents.indexes.models.searchindexerdatasourcetype). +- Added support for [`Azure.Core.GeoJson`](https://learn.microsoft.com/dotnet/api/azure.core.geojson) types in `SearchDocument`, `SearchFilter` and `FieldBuilder`. +- Added [`EventSource`](https://learn.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource) based logging. Event source name is **Azure-Search-Documents**. Current set of events are focused on tuning batch sizes for [`SearchIndexingBufferedSender`](https://learn.microsoft.com/dotnet/api/azure.search.documents.searchindexingbufferedsender-1). +- Added [`CustomEntityLookupSkill`](https://learn.microsoft.com/azure/search/cognitive-search-skill-custom-entity-lookup) and [`DocumentExtractionSkill`](https://learn.microsoft.com/azure/search/cognitive-search-skill-document-extraction). Added `DefaultCountryHint` in [`LanguageDetectionSkill`](https://learn.microsoft.com/azure/search/cognitive-search-skill-language-detection). +- Added [`LexicalNormalizer`](https://learn.microsoft.com/azure/search/search-normalizers#predefined-normalizers) to include predefined set of normalizers. See [here](https://learn.microsoft.com/azure/search/search-normalizers) for more details on search normalizers. Added `Normalizer` as a [`SearchField`](https://learn.microsoft.com/dotnet/api/azure.search.documents.indexes.models.searchfield) in an index definition. +- Added support for Azure Data Lake Storage Gen2 - [`AdlsGen2`](https://learn.microsoft.com/azure/storage/blobs/data-lake-storage-introduction) in [`SearchIndexerDataSourceType`](https://learn.microsoft.com/dotnet/api/azure.search.documents.indexes.models.searchindexerdatasourcetype). ## 11.2.0 (2021-02-10) diff --git a/sdk/search/Azure.Search.Documents/MigrationGuide.md b/sdk/search/Azure.Search.Documents/MigrationGuide.md index 478e587ead14..6156ad592eb0 100644 --- a/sdk/search/Azure.Search.Documents/MigrationGuide.md +++ b/sdk/search/Azure.Search.Documents/MigrationGuide.md @@ -5,7 +5,7 @@ This guide is intended to assist in the migration to version 11 of the Azure Cog To learn more about the Azure Cognitive Search client library for .NET, please refer to the [`Azure.Search.Documents` README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/README.md) and [`Azure.Search.Documents` samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Azure.Search.Documents/samples) for the `Azure.Search.Documents` library. ## Migration Guide -Details about the migration can be found in the [upgrade document](https://docs.microsoft.com/azure/search/search-dotnet-sdk-migration-version-11). It describes the API differences, code changes involved in the upgrade and the breaking changes. +Details about the migration can be found in the [upgrade document](https://learn.microsoft.com/azure/search/search-dotnet-sdk-migration-version-11). It describes the API differences, code changes involved in the upgrade and the breaking changes. ## Migration benefits diff --git a/sdk/search/Azure.Search.Documents/README.md b/sdk/search/Azure.Search.Documents/README.md index 1819012dfb9b..f3d98c45f559 100644 --- a/sdk/search/Azure.Search.Documents/README.md +++ b/sdk/search/Azure.Search.Documents/README.md @@ -1,6 +1,6 @@ # Azure AI Search client library for .NET -[Azure AI Search](https://docs.microsoft.com/azure/search/) (formerly known as "Azure Cognitive Search") is an AI-powered information retrieval platform that helps developers build rich search experiences and generative AI apps that combine large language models with enterprise data. +[Azure AI Search](https://learn.microsoft.com/azure/search/) (formerly known as "Azure Cognitive Search") is an AI-powered information retrieval platform that helps developers build rich search experiences and generative AI apps that combine large language models with enterprise data. The Azure AI Search service is well suited for the following application scenarios: @@ -54,7 +54,7 @@ Here's an example using the Azure CLI to create a free instance for getting star az search service create --name --resource-group --sku free --location westus ``` -See [choosing a pricing tier](https://docs.microsoft.com/azure/search/search-sku-tier) +See [choosing a pricing tier](https://learn.microsoft.com/azure/search/search-sku-tier) for more information about available options. ### Authenticate the client @@ -65,7 +65,7 @@ To interact with the search service, you'll need to create an instance of the ap An API key can be an easier approach to start with because it doesn't require pre-existing role assignments. -You can get the **endpoint** and an **API key** from the search service in the [Azure portal](https://portal.azure.com/). Please refer the [documentation](https://docs.microsoft.com/azure/search/search-security-api-keys) for instructions on how to get an API key. +You can get the **endpoint** and an **API key** from the search service in the [Azure portal](https://portal.azure.com/). Please refer the [documentation](https://learn.microsoft.com/azure/search/search-security-api-keys) for instructions on how to get an API key. Alternatively, you can use the following [Azure CLI](https://learn.microsoft.com/cli/azure/) command to retrieve the API key from the search service: @@ -151,7 +151,7 @@ To use the preceding code, add this to your configuration: } } ``` -You'll also need to provide your resource key to authenticate the client, but you shouldn't be putting that information in the configuration. Instead, when in development, use [User-Secrets](https://docs.microsoft.com/aspnet/core/security/app-secrets?view=aspnetcore-5.0&tabs=windows#how-the-secret-manager-tool-works). Add the following to `secrets.json`: +You'll also need to provide your resource key to authenticate the client, but you shouldn't be putting that information in the configuration. Instead, when in development, use [User-Secrets](https://learn.microsoft.com/aspnet/core/security/app-secrets?view=aspnetcore-5.0&tabs=windows#how-the-secret-manager-tool-works). Add the following to `secrets.json`: ```json { @@ -160,14 +160,14 @@ You'll also need to provide your resource key to authenticate the client, but yo } } ``` -When running in production, it's preferable to use [environment variables](https://docs.microsoft.com/aspnet/core/security/app-secrets?view=aspnetcore-5.0&tabs=windows#environment-variables): +When running in production, it's preferable to use [environment variables](https://learn.microsoft.com/aspnet/core/security/app-secrets?view=aspnetcore-5.0&tabs=windows#environment-variables): ``` SEARCH__CREDENTIAL__KEY="..." ``` -Or use other secure ways of storing secrets like [Azure Key Vault](https://docs.microsoft.com/aspnet/core/security/key-vault-configuration?view=aspnetcore-5.0). +Or use other secure ways of storing secrets like [Azure Key Vault](https://learn.microsoft.com/aspnet/core/security/key-vault-configuration?view=aspnetcore-5.0). -For more details about Dependency Injection in ASP.NET Core apps, see [Dependency injection with the Azure SDK for .NET](https://docs.microsoft.com/dotnet/azure/sdk/dependency-injection). +For more details about Dependency Injection in ASP.NET Core apps, see [Dependency injection with the Azure SDK for .NET](https://learn.microsoft.com/dotnet/azure/sdk/dependency-injection). ## Key concepts @@ -178,26 +178,26 @@ indexes and database tables.)_ The Azure.Search.Documents client library exposes operations on these resources through three main client types. * `SearchClient` helps with: - * [Searching](https://docs.microsoft.com/azure/search/search-lucene-query-architecture) + * [Searching](https://learn.microsoft.com/azure/search/search-lucene-query-architecture) your indexed documents using [vector queries](https://learn.microsoft.com/azure/search/vector-search-how-to-query), [keyword queries](https://learn.microsoft.com/azure/search/search-query-create) and [hybrid queries](https://learn.microsoft.com/azure/search/hybrid-search-how-to-query) * [Vector query filters](https://learn.microsoft.com/azure/search/vector-search-filters) and [Text query filters](https://learn.microsoft.com/azure/search/search-filters) * [Semantic ranking](https://learn.microsoft.com/azure/search/semantic-how-to-query-request) and [scoring profiles](https://learn.microsoft.com/azure/search/index-add-scoring-profiles) for boosting relevance - * [Autocompleting](https://docs.microsoft.com/rest/api/searchservice/autocomplete) + * [Autocompleting](https://learn.microsoft.com/rest/api/searchservice/autocomplete) partially typed search terms based on documents in the index - * [Suggesting](https://docs.microsoft.com/rest/api/searchservice/suggestions) + * [Suggesting](https://learn.microsoft.com/rest/api/searchservice/suggestions) the most likely matching text in documents as a user types - * [Adding, Updating or Deleting Documents](https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents) + * [Adding, Updating or Deleting Documents](https://learn.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents) documents from an index * `SearchIndexClient` allows you to: - * [Create, delete, update, or configure a search index](https://docs.microsoft.com/rest/api/searchservice/index-operations) - * [Declare custom synonym maps to expand or rewrite queries](https://docs.microsoft.com/rest/api/searchservice/synonym-map-operations) + * [Create, delete, update, or configure a search index](https://learn.microsoft.com/rest/api/searchservice/index-operations) + * [Declare custom synonym maps to expand or rewrite queries](https://learn.microsoft.com/rest/api/searchservice/synonym-map-operations) * `SearchIndexerClient` allows you to: - * [Create indexers to automatically crawl data sources](https://docs.microsoft.com/rest/api/searchservice/indexer-operations) - * [Define AI powered Skillsets to transform and enrich your data](https://docs.microsoft.com/rest/api/searchservice/skillset-operations) + * [Create indexers to automatically crawl data sources](https://learn.microsoft.com/rest/api/searchservice/indexer-operations) + * [Define AI powered Skillsets to transform and enrich your data](https://learn.microsoft.com/rest/api/searchservice/skillset-operations) Azure AI Search provides two powerful features: @@ -241,7 +241,7 @@ We guarantee that all client instance methods are thread-safe and independent of ## Examples The following examples all use a simple [Hotel data set](https://github.com/Azure-Samples/azure-search-sample-data) -that you can [import into your own index from the Azure portal.](https://docs.microsoft.com/azure/search/search-get-started-portal#step-1---start-the-import-data-wizard-and-create-a-data-source) +that you can [import into your own index from the Azure portal.](https://learn.microsoft.com/azure/search/search-get-started-portal#step-1---start-the-import-data-wizard-and-create-a-data-source) These are just a few of the basics - please [check out our Samples][samples] for much more. @@ -286,7 +286,7 @@ Let's explore them with a search for a "luxury" hotel. #### Use C# types for search results -We can decorate our own C# types with [attributes from `System.Text.Json`](https://docs.microsoft.com/dotnet/standard/serialization/system-text-json-how-to): +We can decorate our own C# types with [attributes from `System.Text.Json`](https://learn.microsoft.com/dotnet/standard/serialization/system-text-json-how-to): ```C# Snippet:Azure_Search_Tests_Samples_Readme_StaticType public class Hotel @@ -444,7 +444,7 @@ client.CreateIndex(index); You can `Upload`, `Merge`, `MergeOrUpload`, and `Delete` multiple documents from an index in a single batched request. There are -[a few special rules for merging](https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents#document-actions) +[a few special rules for merging](https://learn.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents#document-actions) to be aware of. ```C# Snippet:Azure_Search_Tests_Samples_Readme_Index @@ -489,7 +489,7 @@ await foreach (SearchResult result in searchResponse.GetResultsAsync()) ### Authenticate in a National Cloud -To authenticate in a [National Cloud](https://docs.microsoft.com/azure/active-directory/develop/authentication-national-cloud), you will need to make the following additions to your client configuration: +To authenticate in a [National Cloud](https://learn.microsoft.com/azure/active-directory/develop/authentication-national-cloud), you will need to make the following additions to your client configuration: - Set the `AuthorityHost` in the credential options or via the `AZURE_AUTHORITY_HOST` environment variable - Set the `Audience` in `SearchClientOptions` @@ -537,7 +537,7 @@ See our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-net/blob/ ## Next steps * Go further with Azure.Search.Documents and our [samples][samples] -* Read more about the [Azure AI Search service](https://docs.microsoft.com/azure/search/search-what-is-azure-search) +* Read more about the [Azure AI Search service](https://learn.microsoft.com/azure/search/search-what-is-azure-search) ## Contributing @@ -559,17 +559,17 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Azure.Search.Documents/src [package]: https://www.nuget.org/packages/Azure.Search.Documents/ -[docs]: https://docs.microsoft.com/dotnet/api/Azure.Search.Documents -[rest_docs]: https://docs.microsoft.com/rest/api/searchservice/ -[product_docs]: https://docs.microsoft.com/azure/search/ +[docs]: https://learn.microsoft.com/dotnet/api/Azure.Search.Documents +[rest_docs]: https://learn.microsoft.com/rest/api/searchservice/ +[product_docs]: https://learn.microsoft.com/azure/search/ [nuget]: https://www.nuget.org/ -[create_search_service_docs]: https://docs.microsoft.com/azure/search/search-create-service-portal -[create_search_service_ps]: https://docs.microsoft.com/azure/search/search-manage-powershell#create-or-delete-a-service -[create_search_service_cli]: https://docs.microsoft.com/cli/azure/search/service?view=azure-cli-latest#az-search-service-create -[azure_cli]: https://docs.microsoft.com/cli/azure +[create_search_service_docs]: https://learn.microsoft.com/azure/search/search-create-service-portal +[create_search_service_ps]: https://learn.microsoft.com/azure/search/search-manage-powershell#create-or-delete-a-service +[create_search_service_cli]: https://learn.microsoft.com/cli/azure/search/service?view=azure-cli-latest#az-search-service-create +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[status_codes]: https://docs.microsoft.com/rest/api/searchservice/http-status-codes +[status_codes]: https://learn.microsoft.com/rest/api/searchservice/http-status-codes [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/samples/ [search_contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/search/Azure.Search.Documents/TROUBLESHOOTING.md b/sdk/search/Azure.Search.Documents/TROUBLESHOOTING.md index 1d6ce1f43a2c..3541416c6422 100644 --- a/sdk/search/Azure.Search.Documents/TROUBLESHOOTING.md +++ b/sdk/search/Azure.Search.Documents/TROUBLESHOOTING.md @@ -1,6 +1,6 @@ # Troubleshooting Azure Search SDK Issues -The `Azure.Search.Documents` package provides APIs for operations on the [Azure Cognitive Search](https://docs.microsoft.com/azure/search/search-what-is-azure-search) cloud service. +The `Azure.Search.Documents` package provides APIs for operations on the [Azure Cognitive Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search) cloud service. See [Azure SDK diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) for help diagnosing various problems across all our Azure SDKs for .NET. @@ -14,26 +14,26 @@ See [Azure SDK diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main * [Limits imposed by the Search service](#limits-imposed-by-the-service) # Troubleshooting Issues By Response Code -See [this page](https://docs.microsoft.com/rest/api/searchservice/http-status-codes) for the common response status codes sent by the Azure Cognitive Search service. +See [this page](https://learn.microsoft.com/rest/api/searchservice/http-status-codes) for the common response status codes sent by the Azure Cognitive Search service. ## 207 Multi-Status -This response status indicates a partial success for an indexing operation. Some documents were successfully processed, but at least one failed. Details of the failed documents are present in the individual `IndexingResult` objects within the `IndexDocumentsResult` of the `Azure.Response`. If you want the [`IndexDocumentsAsync()`](https://docs.microsoft.com/dotnet/api/azure.search.documents.searchclient.indexdocumentsasync) method call to throw an exception on any failure, set [`IndexDocumentsOptions.ThrowOnAnyError`](https://docs.microsoft.com/dotnet/api/azure.search.documents.indexdocumentsoptions.throwonanyerror) to `true`. Each failure is then recorded in a separate `RequestFailedException` and a single `AggregateException` is thrown by the method. +This response status indicates a partial success for an indexing operation. Some documents were successfully processed, but at least one failed. Details of the failed documents are present in the individual `IndexingResult` objects within the `IndexDocumentsResult` of the `Azure.Response`. If you want the [`IndexDocumentsAsync()`](https://learn.microsoft.com/dotnet/api/azure.search.documents.searchclient.indexdocumentsasync) method call to throw an exception on any failure, set [`IndexDocumentsOptions.ThrowOnAnyError`](https://learn.microsoft.com/dotnet/api/azure.search.documents.indexdocumentsoptions.throwonanyerror) to `true`. Each failure is then recorded in a separate `RequestFailedException` and a single `AggregateException` is thrown by the method. ## 403 Forbidden -Returned when you pass an invalid api-key. Search service uses two types of keys to control access: admin (read-write) and query (read-only). The **admin key** grants full rights to all operations, including the ability to manage the service, create and delete indexes, indexers, and data sources. The **query key** grants read-only access to indexes and documents. Ensure that the key used for an API call provides sufficient privileges for the operation. See [here](https://docs.microsoft.com/azure/search/search-security-api-keys) for details about managing API keys. +Returned when you pass an invalid api-key. Search service uses two types of keys to control access: admin (read-write) and query (read-only). The **admin key** grants full rights to all operations, including the ability to manage the service, create and delete indexes, indexers, and data sources. The **query key** grants read-only access to indexes and documents. Ensure that the key used for an API call provides sufficient privileges for the operation. See [here](https://learn.microsoft.com/azure/search/search-security-api-keys) for details about managing API keys. ## 404 Not Found Returned when a resource does not exist on the server. If you are managing or querying an index, check the syntax and verify the index name is specified correctly. ## 429 too many requests -If this error occurs while you are trying to create an index, it means you already have the maximum number of indexes allowed for your pricing tier. A count of the indexes stored in Azure Cognitive Search is visible in the search service dashboard on the [Azure portal](https://portal.azure.com/). To view the indexes by name, click the Index tile. Alternatively, you can also get a list of the indexes by name using the [GetIndexNames() method](https://docs.microsoft.com/dotnet/api/azure.search.documents.indexes.searchindexclient.getindexnamesasync). +If this error occurs while you are trying to create an index, it means you already have the maximum number of indexes allowed for your pricing tier. A count of the indexes stored in Azure Cognitive Search is visible in the search service dashboard on the [Azure portal](https://portal.azure.com/). To view the indexes by name, click the Index tile. Alternatively, you can also get a list of the indexes by name using the [GetIndexNames() method](https://learn.microsoft.com/dotnet/api/azure.search.documents.indexes.searchindexclient.getindexnamesasync). If this error occurs during document upload, it indicates that you've exceeded your quota on the number of documents per index. You must either create a new index or upgrade for higher capacity limits. # Unexpected Search Query Results -A common class of issues when using the Search SDK is that the result set of a search query is different than expected. For such cases, you should start by running the search query in the portal to rule out any service-side issues with the search query or any parameter(s). Review the [OData syntax](https://docs.microsoft.com/azure/search/query-odata-filter-orderby-syntax), if any, used in the query. +A common class of issues when using the Search SDK is that the result set of a search query is different than expected. For such cases, you should start by running the search query in the portal to rule out any service-side issues with the search query or any parameter(s). Review the [OData syntax](https://learn.microsoft.com/azure/search/query-odata-filter-orderby-syntax), if any, used in the query. -Once the result looks good in the portal, use that as the template to populate the objects and parameters in the search request APIs. You should also verify that the correct set of documents have been indexed and are being searched on the service side. One tip would be to start with a 'broad' query (one that returns a superset of desired results, possibly by giving a large value for or entirely removing, some [query parameters](https://docs.microsoft.com/rest/api/searchservice/search-documents#query-parameters)) and then progressively refining the query till it expresses the desired intent. +Once the result looks good in the portal, use that as the template to populate the objects and parameters in the search request APIs. You should also verify that the correct set of documents have been indexed and are being searched on the service side. One tip would be to start with a 'broad' query (one that returns a superset of desired results, possibly by giving a large value for or entirely removing, some [query parameters](https://learn.microsoft.com/rest/api/searchservice/search-documents#query-parameters)) and then progressively refining the query till it expresses the desired intent. # Limits imposed by the service -The service imposes limits on storage, workloads, and quantities of indexes and other objects depending on whether you provision Azure Cognitive Search at Free, Basic, Standard, or Storage Optimized pricing tiers. See [this page](https://docs.microsoft.com/azure/search/search-limits-quotas-capacity) for details. +The service imposes limits on storage, workloads, and quantities of indexes and other objects depending on whether you provision Azure Cognitive Search at Free, Basic, Standard, or Storage Optimized pricing tiers. See [this page](https://learn.microsoft.com/azure/search/search-limits-quotas-capacity) for details. diff --git a/sdk/search/Azure.Search.Documents/samples/Sample02_Service.md b/sdk/search/Azure.Search.Documents/samples/Sample02_Service.md index aca3bcf6eb08..f49d2584267a 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample02_Service.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample02_Service.md @@ -39,7 +39,7 @@ to French if not a human translation is not already defined. First we'll create a synonym map for country names and abbreviations. A synonym map contains aliases and other transformations using the -[Solr format](https://docs.microsoft.com/rest/api/searchservice/create-synonym-map#apache-solr-synonym-format), +[Solr format](https://learn.microsoft.com/rest/api/searchservice/create-synonym-map#apache-solr-synonym-format), for example: ``` @@ -155,15 +155,15 @@ indexerClient = new SearchIndexerClient(endpoint, credential, options); ### Create a Skillset -To provide French translations of descriptions, we'll define a [translation skill](https://docs.microsoft.com/azure/search/cognitive-search-skill-text-translation) to translate from English. -We'll also define a [conditional skill](https://docs.microsoft.com/azure/search/cognitive-search-skill-conditional) to use a human-translated descriptions instead if available. +To provide French translations of descriptions, we'll define a [translation skill](https://learn.microsoft.com/azure/search/cognitive-search-skill-text-translation) to translate from English. +We'll also define a [conditional skill](https://learn.microsoft.com/azure/search/cognitive-search-skill-conditional) to use a human-translated descriptions instead if available. -See all [built-in skills](https://docs.microsoft.com/azure/search/cognitive-search-predefined-skills) for more information +See all [built-in skills](https://learn.microsoft.com/azure/search/cognitive-search-predefined-skills) for more information about all available skills. ```C# Snippet:Azure_Search_Tests_Samples_CreateIndexerAsync_Skillset // Translate English descriptions to French. -// See https://docs.microsoft.com/azure/search/cognitive-search-skill-text-translation for details of the Text Translation skill. +// See https://learn.microsoft.com/azure/search/cognitive-search-skill-text-translation for details of the Text Translation skill. TextTranslationSkill translationSkill = new TextTranslationSkill( inputs: new[] { @@ -181,7 +181,7 @@ TextTranslationSkill translationSkill = new TextTranslationSkill( }; // Use the human-translated French description if available; otherwise, use the translated description. -// See https://docs.microsoft.com/azure/search/cognitive-search-skill-conditional for details of the Conditional skill. +// See https://learn.microsoft.com/azure/search/cognitive-search-skill-conditional for details of the Conditional skill. ConditionalSkill conditionalSkill = new ConditionalSkill( inputs: new[] { diff --git a/sdk/search/Azure.Search.Documents/samples/Sample06_EncryptedIndex.md b/sdk/search/Azure.Search.Documents/samples/Sample06_EncryptedIndex.md index 2d21708822fa..bd41bcd6639f 100644 --- a/sdk/search/Azure.Search.Documents/samples/Sample06_EncryptedIndex.md +++ b/sdk/search/Azure.Search.Documents/samples/Sample06_EncryptedIndex.md @@ -1,10 +1,10 @@ # Azure.Search.Documents Samples - Customer-managed Encryption Keys -Azure AI Search automatically encrypts indexed content at rest with [service-managed keys](https://docs.microsoft.com/azure/security/fundamentals/encryption-atrest#azure-encryption-at-rest-components). If more protection is needed, you can supplement default encryption with an additional encryption layer using keys that you create and manage in Azure Key Vault. This sample shows you how to set up and use customer-managed keys to further encrypt your data source connections, skillsets, indexers, and indexes for additional security. +Azure AI Search automatically encrypts indexed content at rest with [service-managed keys](https://learn.microsoft.com/azure/security/fundamentals/encryption-atrest#azure-encryption-at-rest-components). If more protection is needed, you can supplement default encryption with an additional encryption layer using keys that you create and manage in Azure Key Vault. This sample shows you how to set up and use customer-managed keys to further encrypt your data source connections, skillsets, indexers, and indexes for additional security. ## Getting started -To begin using Customer-Managed Keys (CMK), follow steps 1 through 5 to [configure customer-managed keys for data encryption](https://docs.microsoft.com/azure/search/search-security-manage-encryption-keys). This will guide you how to configure your Key Vault, register a service principal if necessary, and grant appropriate access to a service principal for a Key Vault key. This can be a key you created previously, or you can create a key that can wrap and unwrap service keys, including AES and RSA keys like in the following example: +To begin using Customer-Managed Keys (CMK), follow steps 1 through 5 to [configure customer-managed keys for data encryption](https://learn.microsoft.com/azure/search/search-security-manage-encryption-keys). This will guide you how to configure your Key Vault, register a service principal if necessary, and grant appropriate access to a service principal for a Key Vault key. This can be a key you created previously, or you can create a key that can wrap and unwrap service keys, including AES and RSA keys like in the following example: ```bash # Create a resource group for your Key Vault and Azure AI Search service. diff --git a/sdk/search/README.md b/sdk/search/README.md index 31d1ac460062..94f649d2e23a 100644 --- a/sdk/search/README.md +++ b/sdk/search/README.md @@ -1,6 +1,6 @@ # Azure Cognitive Search libraries for .NET -Azure Cognitive Search ([formerly known as "Azure Search"](https://docs.microsoft.com/azure/search/whats-new#new-service-name)) +Azure Cognitive Search ([formerly known as "Azure Search"](https://learn.microsoft.com/azure/search/whats-new#new-service-name)) is a search-as-a-service cloud solution that gives developers APIs and tools for adding a rich search experience over private, heterogeneous content in web, mobile, and enterprise applications. Your code or a tool invokes data ingestion diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md index b5d03ee2a0e0..e1d76976a474 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md @@ -94,7 +94,7 @@ Polishing since last public beta release: - Corrected the format of all `Guid` type properties / parameters. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [.NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Optimized the name of some models and functions. @@ -125,4 +125,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/README.md b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/README.md index 66e7706ed683..819c05ce88e4 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/README.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/CHANGELOG.md b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/CHANGELOG.md index 8485942fbcb8..9349998de5c9 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/CHANGELOG.md +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/CHANGELOG.md @@ -59,4 +59,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/README.md b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/README.md index 31780d0d1e96..6cfaa063e48d 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/README.md +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/CHANGELOG.md b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/CHANGELOG.md index 90873d1cfb72..b59744da112c 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/CHANGELOG.md +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/CHANGELOG.md @@ -71,8 +71,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -104,4 +104,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/README.md b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/README.md index f42d321a09ff..8c9a7ab3978d 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/README.md +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.net8.0.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.net8.0.cs index bc05d7dc60c6..c2380cd3c8d0 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.net8.0.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.net8.0.cs @@ -2815,6 +2815,8 @@ public static partial class ArmSecurityInsightsModelFactory public static Azure.ResourceManager.SecurityInsights.SecurityInsightsThreatIntelligenceIndicatorBaseData SecurityInsightsThreatIntelligenceIndicatorBaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsThreatIntelligenceIndicatorData SecurityInsightsThreatIntelligenceIndicatorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IReadOnlyDictionary additionalData = null, string friendlyName = null, System.Collections.Generic.IEnumerable threatIntelligenceTags = null, System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), string source = null, string displayName = null, string description = null, System.Collections.Generic.IEnumerable indicatorTypes = null, string pattern = null, string patternType = null, string patternVersion = null, System.Collections.Generic.IEnumerable killChainPhases = null, System.Collections.Generic.IEnumerable parsedPattern = null, string externalId = null, string createdByRef = null, bool? isDefanged = default(bool?), System.DateTimeOffset? externalLastUpdatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable externalReferences = null, System.Collections.Generic.IEnumerable granularMarkings = null, System.Collections.Generic.IEnumerable labels = null, bool? isRevoked = default(bool?), int? confidence = default(int?), System.Collections.Generic.IEnumerable objectMarkingRefs = null, string language = null, System.Collections.Generic.IEnumerable threatTypes = null, System.DateTimeOffset? validFrom = default(System.DateTimeOffset?), System.DateTimeOffset? validUntil = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string modified = null, System.Collections.Generic.IDictionary extensions = null) { throw null; } public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsTIDataConnector SecurityInsightsTIDataConnector(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Guid? tenantId = default(System.Guid?), System.DateTimeOffset? tipLookbackOn = default(System.DateTimeOffset?), Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsDataTypeConnectionState? indicatorsState = default(Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsDataTypeConnectionState?)) { throw null; } + public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUriEntity SecurityInsightsUriEntity(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IReadOnlyDictionary additionalData = null, string friendlyName = null, string uriString = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUriEntity SecurityInsightsUriEntity(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IReadOnlyDictionary additionalData = null, string friendlyName = null, System.Uri uri = null) { throw null; } public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUserInfo SecurityInsightsUserInfo(string email = null, string name = null, System.Guid? objectId = default(System.Guid?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -7877,7 +7879,10 @@ public partial class SecurityInsightsUriEntity : Azure.ResourceManager.SecurityI public SecurityInsightsUriEntity() { } public System.Collections.Generic.IReadOnlyDictionary AdditionalData { get { throw null; } } public string FriendlyName { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This property has been replaced by UriString", false)] public System.Uri Uri { get { throw null; } } + public string UriString { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUriEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.netstandard2.0.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.netstandard2.0.cs index bc05d7dc60c6..c2380cd3c8d0 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.netstandard2.0.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/api/Azure.ResourceManager.SecurityInsights.netstandard2.0.cs @@ -2815,6 +2815,8 @@ public static partial class ArmSecurityInsightsModelFactory public static Azure.ResourceManager.SecurityInsights.SecurityInsightsThreatIntelligenceIndicatorBaseData SecurityInsightsThreatIntelligenceIndicatorBaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsThreatIntelligenceIndicatorData SecurityInsightsThreatIntelligenceIndicatorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IReadOnlyDictionary additionalData = null, string friendlyName = null, System.Collections.Generic.IEnumerable threatIntelligenceTags = null, System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), string source = null, string displayName = null, string description = null, System.Collections.Generic.IEnumerable indicatorTypes = null, string pattern = null, string patternType = null, string patternVersion = null, System.Collections.Generic.IEnumerable killChainPhases = null, System.Collections.Generic.IEnumerable parsedPattern = null, string externalId = null, string createdByRef = null, bool? isDefanged = default(bool?), System.DateTimeOffset? externalLastUpdatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable externalReferences = null, System.Collections.Generic.IEnumerable granularMarkings = null, System.Collections.Generic.IEnumerable labels = null, bool? isRevoked = default(bool?), int? confidence = default(int?), System.Collections.Generic.IEnumerable objectMarkingRefs = null, string language = null, System.Collections.Generic.IEnumerable threatTypes = null, System.DateTimeOffset? validFrom = default(System.DateTimeOffset?), System.DateTimeOffset? validUntil = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string modified = null, System.Collections.Generic.IDictionary extensions = null) { throw null; } public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsTIDataConnector SecurityInsightsTIDataConnector(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Guid? tenantId = default(System.Guid?), System.DateTimeOffset? tipLookbackOn = default(System.DateTimeOffset?), Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsDataTypeConnectionState? indicatorsState = default(Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsDataTypeConnectionState?)) { throw null; } + public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUriEntity SecurityInsightsUriEntity(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IReadOnlyDictionary additionalData = null, string friendlyName = null, string uriString = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUriEntity SecurityInsightsUriEntity(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IReadOnlyDictionary additionalData = null, string friendlyName = null, System.Uri uri = null) { throw null; } public static Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUserInfo SecurityInsightsUserInfo(string email = null, string name = null, System.Guid? objectId = default(System.Guid?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -7877,7 +7879,10 @@ public partial class SecurityInsightsUriEntity : Azure.ResourceManager.SecurityI public SecurityInsightsUriEntity() { } public System.Collections.Generic.IReadOnlyDictionary AdditionalData { get { throw null; } } public string FriendlyName { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This property has been replaced by UriString", false)] public System.Uri Uri { get { throw null; } } + public string UriString { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsUriEntity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/ArmSecurityInsightsModelFactory.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/ArmSecurityInsightsModelFactory.cs index 094837b428f1..c300fbe1ba0a 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/ArmSecurityInsightsModelFactory.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/ArmSecurityInsightsModelFactory.cs @@ -87,6 +87,32 @@ public static SecurityInsightsIncidentEntitiesMetadata SecurityInsightsIncidentE return new SecurityInsightsIncidentEntitiesMetadata(entityKind, count, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A bag of custom fields that should be part of the entity and will be presented to the user. + /// The graph item display name which is a short humanly readable description of the graph item instance. This property is optional and might be system generated. + /// A full URL the entity points to. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SecurityInsightsUriEntity SecurityInsightsUriEntity(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IReadOnlyDictionary additionalData = null, string friendlyName = null, Uri uri = null) + { + additionalData ??= new Dictionary(); + + return new SecurityInsightsUriEntity( + id, + name, + resourceType, + systemData, + SecurityInsightsEntityKind.Uri, + serializedAdditionalRawData: null, + additionalData, + friendlyName, + uri?.AbsoluteUri); + } + /// Initializes a new instance of . /// The id. /// The name. diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/Models/SecurityInsightsUriEntity.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/Models/SecurityInsightsUriEntity.cs new file mode 100644 index 000000000000..5e67e2b0a68d --- /dev/null +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Customized/Models/SecurityInsightsUriEntity.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.SecurityInsights.Models +{ + public partial class SecurityInsightsUriEntity + { + /// A full URL the entity points to. + [EditorBrowsableAttribute(EditorBrowsableState.Never)] + [ObsoleteAttribute("This property has been replaced by UriString", false)] + public Uri Uri => string.IsNullOrEmpty(UriString) ? null : new Uri(UriString); + } +} diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/ArmSecurityInsightsModelFactory.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/ArmSecurityInsightsModelFactory.cs index 548eb39d35ff..2455c35e6339 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/ArmSecurityInsightsModelFactory.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/ArmSecurityInsightsModelFactory.cs @@ -5401,9 +5401,9 @@ public static SecurityInsightsSubmissionMailEntity SecurityInsightsSubmissionMai /// The systemData. /// A bag of custom fields that should be part of the entity and will be presented to the user. /// The graph item display name which is a short humanly readable description of the graph item instance. This property is optional and might be system generated. - /// A full URL the entity points to. + /// A full URL the entity points to. /// A new instance for mocking. - public static SecurityInsightsUriEntity SecurityInsightsUriEntity(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IReadOnlyDictionary additionalData = null, string friendlyName = null, Uri uri = null) + public static SecurityInsightsUriEntity SecurityInsightsUriEntity(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IReadOnlyDictionary additionalData = null, string friendlyName = null, string uriString = null) { additionalData ??= new Dictionary(); @@ -5416,7 +5416,7 @@ public static SecurityInsightsUriEntity SecurityInsightsUriEntity(ResourceIdenti serializedAdditionalRawData: null, additionalData, friendlyName, - uri); + uriString); } /// Initializes a new instance of . diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.Serialization.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.Serialization.cs index 1e65b98650ab..dbcc941f9920 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.Serialization.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.Serialization.cs @@ -68,10 +68,10 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("friendlyName"u8); writer.WriteStringValue(FriendlyName); } - if (options.Format != "W" && Optional.IsDefined(Uri)) + if (options.Format != "W" && Optional.IsDefined(UriString)) { writer.WritePropertyName("url"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WriteStringValue(UriString); } writer.WriteEndObject(); } @@ -103,7 +103,7 @@ internal static SecurityInsightsUriEntity DeserializeSecurityInsightsUriEntity(J SystemData systemData = default; IReadOnlyDictionary additionalData = default; string friendlyName = default; - Uri url = default; + string url = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -174,11 +174,7 @@ internal static SecurityInsightsUriEntity DeserializeSecurityInsightsUriEntity(J } if (property0.NameEquals("url"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - url = new Uri(property0.Value.GetString()); + url = property0.Value.GetString(); continue; } } @@ -332,7 +328,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UriString), out propertyOverride); if (hasPropertyOverride) { builder.Append(" url: "); @@ -340,10 +336,18 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - if (Optional.IsDefined(Uri)) + if (Optional.IsDefined(UriString)) { builder.Append(" url: "); - builder.AppendLine($"'{Uri.AbsoluteUri}'"); + if (UriString.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UriString}'''"); + } + else + { + builder.AppendLine($"'{UriString}'"); + } } } diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.cs index 1943d6dafdd8..b76a1fde0d36 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Models/SecurityInsightsUriEntity.cs @@ -31,12 +31,12 @@ public SecurityInsightsUriEntity() /// Keeps track of any properties unknown to the library. /// A bag of custom fields that should be part of the entity and will be presented to the user. /// The graph item display name which is a short humanly readable description of the graph item instance. This property is optional and might be system generated. - /// A full URL the entity points to. - internal SecurityInsightsUriEntity(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityInsightsEntityKind kind, IDictionary serializedAdditionalRawData, IReadOnlyDictionary additionalData, string friendlyName, Uri uri) : base(id, name, resourceType, systemData, kind, serializedAdditionalRawData) + /// A full URL the entity points to. + internal SecurityInsightsUriEntity(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityInsightsEntityKind kind, IDictionary serializedAdditionalRawData, IReadOnlyDictionary additionalData, string friendlyName, string uriString) : base(id, name, resourceType, systemData, kind, serializedAdditionalRawData) { AdditionalData = additionalData; FriendlyName = friendlyName; - Uri = uri; + UriString = uriString; Kind = kind; } @@ -77,6 +77,6 @@ internal SecurityInsightsUriEntity(ResourceIdentifier id, string name, ResourceT public string FriendlyName { get; } /// A full URL the entity points to. [WirePath("properties.url")] - public Uri Uri { get; } + public string UriString { get; } } } diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md index f8da76c8d0ef..714eb0f51a6a 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/autorest.md @@ -398,6 +398,7 @@ rename-mapping: TriggerOperator: SecurityInsightsAlertRuleTriggerOperator Ueba: UebaSettings UrlEntity: SecurityInsightsUriEntity + UrlEntity.properties.url: UriString UserInfo: SecurityInsightsUserInfo ValidationError: SecurityInsightsFileValidationError Version: SourceControlVersion @@ -511,7 +512,7 @@ directive: where: $.definitions transform: > $.Query['x-ms-client-name'] = 'ThreatIntelligenceQuery'; - $.UserInfo['x-ms-client-name'] = 'ThreatIntelligenceUserInfo'; + $.UserInfo['x-ms-client-name'] = 'ThreatIntelligenceUserInfo'; - from: ThreatIntelligenceCount.json where: $.definitions transform: > diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/CHANGELOG.md b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/CHANGELOG.md index a7c750e28f72..95f7695de94b 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/CHANGELOG.md +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/CHANGELOG.md @@ -63,8 +63,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -83,4 +83,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/README.md b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/README.md index dcee2397252b..c31d797e34d1 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/README.md +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md index 725a342fdc6d..7da680eaefbb 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md @@ -59,7 +59,7 @@ To build the sample: You can either run the executable you just build, or build and run the project at the same time. There are two ways to authenticate in the sample. ### Use Azure Activity Directory -You can use any of the [authentication mechanisms](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) that the `DefaultAzureCredential` from the Azure.Identity supports. +You can use any of the [authentication mechanisms](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) that the `DefaultAzureCredential` from the Azure.Identity supports. To run the sample using Azure Identity: diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample03_SendReceiveSessions.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample03_SendReceiveSessions.md index 1e4585a6c6ec..0e1c3e6619c4 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample03_SendReceiveSessions.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample03_SendReceiveSessions.md @@ -1,6 +1,6 @@ # Sending and receiving session messages -This sample demonstrates how to send and receive session messages from a session-enabled Service Bus queues. For concepts related to sessions, please refer to the [Service Bus sessions documentation](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions). +This sample demonstrates how to send and receive session messages from a session-enabled Service Bus queues. For concepts related to sessions, please refer to the [Service Bus sessions documentation](https://learn.microsoft.com/azure/service-bus-messaging/message-sessions). ## Receiving from next available session diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample10_ClaimCheck.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample10_ClaimCheck.md index b77496decfd7..13b0426762e7 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample10_ClaimCheck.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample10_ClaimCheck.md @@ -1,10 +1,10 @@ # Claim check pattern -This sample demonstrates the use of the [claim check pattern](https://docs.microsoft.com/azure/architecture/patterns/claim-check) which enables you to work with arbitrarily large message bodies. For standard namespaces, a message can be at most 256 KB. For Premium namespaces, the limit is 100 MB. If these limits don't work for your application you can leverage Azure Storage Blobs to implement this pattern. +This sample demonstrates the use of the [claim check pattern](https://learn.microsoft.com/azure/architecture/patterns/claim-check) which enables you to work with arbitrarily large message bodies. For standard namespaces, a message can be at most 256 KB. For Premium namespaces, the limit is 100 MB. If these limits don't work for your application you can leverage Azure Storage Blobs to implement this pattern. ## Sending the message -In our example, we will assume that the message body can fit in memory. This allows us to use the Storage Blob methods that let you work with `BinaryData`. If your message body cannot fit in memory, you can use the [stream-based](https://docs.microsoft.com/dotnet/api/azure.storage.blobs.blobcontainerclient.uploadblobasync?view=azure-dotnet#Azure_Storage_Blobs_BlobContainerClient_UploadBlobAsync_System_String_System_IO_Stream_System_Threading_CancellationToken_) Upload/Download methods instead. +In our example, we will assume that the message body can fit in memory. This allows us to use the Storage Blob methods that let you work with `BinaryData`. If your message body cannot fit in memory, you can use the [stream-based](https://learn.microsoft.com/dotnet/api/azure.storage.blobs.blobcontainerclient.uploadblobasync?view=azure-dotnet#Azure_Storage_Blobs_BlobContainerClient_UploadBlobAsync_System_String_System_IO_Stream_System_Threading_CancellationToken_) Upload/Download methods instead. First, we will create a `BlobContainerClient` and use the container name "claim-checks". We will be storing our message bodies in blobs within this container. ```C# Snippet:CreateBlobContainer diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample11_CloudEvents.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample11_CloudEvents.md index 393fe923b38c..0bd99e88e585 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample11_CloudEvents.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample11_CloudEvents.md @@ -1,6 +1,6 @@ # Integrating with the CloudEvent type -The Azure.Core library contains the [CloudEvent](https://docs.microsoft.com/dotnet/api/azure.messaging.cloudevent) type which conforms to the [CloudEvent JSON spec](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md). This type can be used in conjunction with the Service Bus library as shown below: +The Azure.Core library contains the [CloudEvent](https://learn.microsoft.com/dotnet/api/azure.messaging.cloudevent) type which conforms to the [CloudEvent JSON spec](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md). This type can be used in conjunction with the Service Bus library as shown below: ```C# Snippet:ServiceBusCloudEvents string fullyQualifiedNamespace = ""; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample13_AdvancedConfiguration.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample13_AdvancedConfiguration.md index 16e56a453b76..d48185f76073 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample13_AdvancedConfiguration.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample13_AdvancedConfiguration.md @@ -55,7 +55,7 @@ ServiceBusClient client = new(fullyQualifiedNamespace, credential, new ServiceBu ## Using prefetch -The [prefetch feature](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-prefetch?tabs=dotnet) allows the receiver and processor to request messages in the background before an actual receive operation is initiated. This can potentially increase the throughput of your application, but it comes with several large drawbacks that are outlined in this [document](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-prefetch?tabs=dotnet#why-is-prefetch-not-the-default-option). If you determine that prefetch makes sense for your application, here is how you would enable it: +The [prefetch feature](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-prefetch?tabs=dotnet) allows the receiver and processor to request messages in the background before an actual receive operation is initiated. This can potentially increase the throughput of your application, but it comes with several large drawbacks that are outlined in this [document](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-prefetch?tabs=dotnet#why-is-prefetch-not-the-default-option). If you determine that prefetch makes sense for your application, here is how you would enable it: ```C# Snippet:ServiceBusConfigurePrefetchReceiver string fullyQualifiedNamespace = ""; diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/CHANGELOG.md b/sdk/servicebus/Azure.ResourceManager.ServiceBus/CHANGELOG.md index ab37f0090da2..ee48f9cdb681 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/CHANGELOG.md +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/CHANGELOG.md @@ -100,8 +100,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -163,4 +163,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/README.md b/sdk/servicebus/Azure.ResourceManager.ServiceBus/README.md index bf6ac6ff8f63..0bb16926ecb1 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/README.md +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md b/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md index c711ab4c3d2d..8eb237bc69b5 100755 --- a/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md +++ b/sdk/servicebus/Microsoft.Azure.ServiceBus/README.md @@ -16,13 +16,13 @@ Use the client library for Azure Service Bus to: - Implement complex workflows: message sessions support scenarios that require message ordering or message deferral. -[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/servicebus/Microsoft.Azure.ServiceBus/src) | [Package (NuGet)](https://www.nuget.org/packages/Microsoft.Azure.ServiceBus/) | [API reference documentation](https://docs.microsoft.com/dotnet/api/overview/azure/service-bus?view=azure-dotnet) | [Product documentation](https://docs.microsoft.com/azure/service-bus-messaging/) +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/servicebus/Microsoft.Azure.ServiceBus/src) | [Package (NuGet)](https://www.nuget.org/packages/Microsoft.Azure.ServiceBus/) | [API reference documentation](https://learn.microsoft.com/dotnet/api/overview/azure/service-bus?view=azure-dotnet) | [Product documentation](https://learn.microsoft.com/azure/service-bus-messaging/) ## Getting started The complete Microsoft Azure SDK can be downloaded from the [Microsoft Azure Downloads Page](https://azure.microsoft.com/downloads/?sdk=net) and ships with support for building deployment packages, integrating with tooling, rich command line tooling, and more. -If you are not already familiar with Azure Service Bus, please review: [What is Azure Service Bus](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview). +If you are not already familiar with Azure Service Bus, please review: [What is Azure Service Bus](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview). For the best development experience, developers should use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and hotfixes. @@ -38,7 +38,7 @@ Code samples for the Azure Service Bus client library that detail how to get sta - [Azure Code Samples](https://azure.microsoft.com/resources/samples/?sort=0&service=service-bus&platform=dotnet) - [Azure Service Bus Sample Repository](https://github.com/Azure/azure-service-bus/tree/master/samples/) -- [Azure Service Bus Documentation](https://docs.microsoft.com/azure/service-bus-messaging/) +- [Azure Service Bus Documentation](https://learn.microsoft.com/azure/service-bus-messaging/) ## To build @@ -76,8 +76,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope ## Additional documentation -- [Azure Service Bus General Documentation](https://docs.microsoft.com/azure/service-bus-messaging/) -- [Azure Service Bus REST API Reference](https://docs.microsoft.com/rest/api/servicebus/) -- [Azure Service Bus SDK for .NET Documentation](https://docs.microsoft.com/dotnet/api/overview/azure/service-bus?view=azure-dotnet) +- [Azure Service Bus General Documentation](https://learn.microsoft.com/azure/service-bus-messaging/) +- [Azure Service Bus REST API Reference](https://learn.microsoft.com/rest/api/servicebus/) +- [Azure Service Bus SDK for .NET Documentation](https://learn.microsoft.com/dotnet/api/overview/azure/service-bus?view=azure-dotnet) ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fservicebus%2FMicrosoft.Azure.ServiceBus%2FREADME.png) diff --git a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md index f841fe3889e5..0aad238aa956 100644 --- a/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md +++ b/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md @@ -25,7 +25,7 @@ To quickly create the needed Service Bus resources in Azure and to receive a con ### Authenticate the Client -For the Service Bus client library to interact with a queue or topic, it will need to understand how to connect and authorize with it. The easiest means for doing so is to use a connection string, which is created automatically when creating a Service Bus namespace. If you aren't familiar with shared access policies in Azure, you may wish to follow the step-by-step guide to [get a Service Bus connection string](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-quickstart-topics-subscriptions-portal#get-the-connection-string). +For the Service Bus client library to interact with a queue or topic, it will need to understand how to connect and authorize with it. The easiest means for doing so is to use a connection string, which is created automatically when creating a Service Bus namespace. If you aren't familiar with shared access policies in Azure, you may wish to follow the step-by-step guide to [get a Service Bus connection string](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quickstart-topics-subscriptions-portal#get-the-connection-string). The `Connection` property of `ServiceBusAttribute` and `ServiceBusTriggerAttribute` is used to specify the configuration property that stores the connection string. If not specified, the property `AzureWebJobsServiceBus` is expected to contain the connection string. @@ -39,11 +39,11 @@ For local development, use the `local.settings.json` file to store the connectio } ``` -When deployed, use the [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. +When deployed, use the [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. #### Identity-based authentication -If your environment has [managed identity](https://docs.microsoft.com/azure/app-service/overview-managed-identity?tabs=dotnet) enabled you can use it to authenticate the Service Bus extension. Before doing so, you will need to ensure that permissions have been configured as described in the [Azure Functions developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference#grant-permission-to-the-identity). +If your environment has [managed identity](https://learn.microsoft.com/azure/app-service/overview-managed-identity?tabs=dotnet) enabled you can use it to authenticate the Service Bus extension. Before doing so, you will need to ensure that permissions have been configured as described in the [Azure Functions developer guide](https://learn.microsoft.com/azure/azure-functions/functions-reference#grant-permission-to-the-identity). To use identity-based authentication provide the `__fullyQualifiedNamespace` configuration setting. ```json @@ -55,7 +55,7 @@ To use identity-based authentication provide the `__fullyQualif } ``` -Or in the case of deployed app set the same setting in [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings): +Or in the case of deployed app set the same setting in [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings): ``` __fullyQualifiedNamespace=.servicebus.windows.net @@ -69,13 +69,13 @@ More details about configuring an identity-based connection can be found [here]( The Service Bus Trigger allows a function to be executed when a message is sent to a Service Bus queue or topic. -Please follow the [Azure Service Bus trigger tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-service-bus-trigger?tabs=csharp) to learn more about Service Bus triggers. +Please follow the [Azure Service Bus trigger tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-service-bus-trigger?tabs=csharp) to learn more about Service Bus triggers. ### Service Bus Output Binding The Service Bus Output Binding allows a function to send Service Bus messages. -Please follow the [Azure Service Bus output binding](https://docs.microsoft.com/azure/azure-functions/functions-bindings-service-bus-output?tabs=csharp) to learn more about Service Bus bindings. +Please follow the [Azure Service Bus output binding](https://learn.microsoft.com/azure/azure-functions/functions-bindings-service-bus-output?tabs=csharp) to learn more about Service Bus bindings. ## Examples @@ -281,11 +281,11 @@ public static async Task Run( If your function triggers an unhandled exception and you haven't already settled the message, the extension will attempt to abandon the message so that it becomes available for receiving again immediately. -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for more troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for more troubleshooting guidance. ## Next steps -Read the [introduction to Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -307,7 +307,7 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.ServiceBus +[docs]: https://learn.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.ServiceBus [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/CHANGELOG.md b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/CHANGELOG.md index a4fd0975730c..19e10c6b4232 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/CHANGELOG.md +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/CHANGELOG.md @@ -70,8 +70,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -102,4 +102,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/README.md b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/README.md index 3756d6645184..8af469279783 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/README.md +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/CHANGELOG.md b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/CHANGELOG.md index 358b89cfd1da..b491dac26858 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/CHANGELOG.md +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/CHANGELOG.md @@ -108,7 +108,7 @@ Polishing since last public beta release: - Corrected the format of all `IPAddress` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -140,4 +140,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md index 3974ad072182..390a64375bf3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/CHANGELOG.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/CHANGELOG.md index 2001e7bf972f..dcfba33b7eea 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/CHANGELOG.md +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/CHANGELOG.md @@ -73,8 +73,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -98,5 +98,5 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/README.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/README.md index e85d8f221cb4..1431caa7ec8d 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/README.md +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md index 83c5c4e1f5dc..e09598546a04 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/CHANGELOG.md @@ -55,4 +55,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/README.md b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/README.md index a45004793d6e..286e7a3e115b 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/README.md +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/CHANGELOG.md b/sdk/signalr/Azure.ResourceManager.SignalR/CHANGELOG.md index 99b9c5afa7b8..f674eb6512ca 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/CHANGELOG.md +++ b/sdk/signalr/Azure.ResourceManager.SignalR/CHANGELOG.md @@ -75,8 +75,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -108,4 +108,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/README.md b/sdk/signalr/Azure.ResourceManager.SignalR/README.md index 4ec6de6eb98e..bd633dc8404f 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/README.md +++ b/sdk/signalr/Azure.ResourceManager.SignalR/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md index 86a2efe2a677..3b77c7ef44fb 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/README.md @@ -28,7 +28,7 @@ dotnet add package Microsoft.Azure.WebJobs.Extensions.SignalRService ### Authenticate the client -In order for SignalR Service client to access SignalR resource, it will need to understand how to authenticate with it. The easiest means for doing so is to use a connection string which can be found in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://docs.microsoft.com/cli/azure) / [Azure PowerShell](https://docs.microsoft.com/powershell/azure/) snippet below. +In order for SignalR Service client to access SignalR resource, it will need to understand how to authenticate with it. The easiest means for doing so is to use a connection string which can be found in the [Azure Portal](https://portal.azure.com/) or by using the [Azure CLI](https://learn.microsoft.com/cli/azure) / [Azure PowerShell](https://learn.microsoft.com/powershell/azure/) snippet below. Azure CLI snippet: ```bash @@ -52,7 +52,7 @@ For local development, use the `local.settings.json` file to store the connectio } ``` -When deployed, use the [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. +When deployed, use the [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. @@ -63,13 +63,13 @@ SignalR **Service** client : It means this library. It provides *SignalR server* functionalities in a serverless style. SignalR client -: An opposite concept of *SignalR server*. See [ASP.NET Core SignalR clients](https://docs.microsoft.com/aspnet/core/signalr/client-features) for more information. +: An opposite concept of *SignalR server*. See [ASP.NET Core SignalR clients](https://learn.microsoft.com/aspnet/core/signalr/client-features) for more information. ### SignalR connection info input binding `SignalRConnectionInfo` input binding makes it easy to generate the token required for SignalR clients to initiate a connection to Azure SignalR Service. -Please follow the [Azure SignalR Connection Info input binding tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-input?tabs=csharp) to learn more about SignalR Connection Info input binding. +Please follow the [Azure SignalR Connection Info input binding tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-input?tabs=csharp) to learn more about SignalR Connection Info input binding. ### SignalR output binding @@ -77,13 +77,13 @@ Please follow the [Azure SignalR Connection Info input binding tutorial](https:/ * send messages to all connections, to a connection, to a user, to a group. * add/remove connections/users in a group. -Please follow the [Azure SignalR output binding](https://docs.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-output?tabs=csharp) to learn more about SignalR output binding. +Please follow the [Azure SignalR output binding](https://learn.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-output?tabs=csharp) to learn more about SignalR output binding. ### SignalR trigger The SignalR trigger allows a function to be executed when a message is sent to Azure SignalR Service. -Please follow the [Azure SignalR trigger](https://docs.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-trigger?tabs=csharp) to learn more about SignalR trigger. +Please follow the [Azure SignalR trigger](https://learn.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-trigger?tabs=csharp) to learn more about SignalR trigger. ## Supported scenarios - Negotiate for a SignalR client. @@ -205,12 +205,12 @@ public static void Run([SignalRTrigger("SignalRTest", "messages", "SendMessage") ## Troubleshooting -* Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for function troubleshooting guidance. -* [Troubleshooting guide for Azure SignalR Service](https://docs.microsoft.com/azure/azure-signalr/signalr-howto-troubleshoot-guide) +* Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for function troubleshooting guidance. +* [Troubleshooting guide for Azure SignalR Service](https://learn.microsoft.com/azure/azure-signalr/signalr-howto-troubleshoot-guide) ## Next steps -Read the [introduction to Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function) +Read the [introduction to Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function) ## Contributing diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/docs/sharding.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/docs/sharding.md index dfbb66f2bbed..0276d2823671 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/docs/sharding.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/docs/sharding.md @@ -64,13 +64,13 @@ Azure:SignalR:Endpoints:: } ``` -> * When you configure Azure SignalR endpoints in the App Service in the Azure portal, replace `":"` with `"__"` (the double underscore) in the keys. For reasons, see [Environment variables](https://docs.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0#environment-variables-1). +> * When you configure Azure SignalR endpoints in the App Service in the Azure portal, replace `":"` with `"__"` (the double underscore) in the keys. For reasons, see [Environment variables](https://learn.microsoft.com/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0#environment-variables-1). > > * A connection string configured with the key `{ConnectionStringSetting}` (defaults to "AzureSignalRConnectionString") is also recognized as a primary service endpoint with empty name. But this configuration style isn't recommended for multiple endpoints. #### Azure Identity support -The [SignalR Service Owner role](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#signalr-service-owner) is required to use an Identity-based connection. +The [SignalR Service Owner role](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#signalr-service-owner) is required to use an Identity-based connection. Here's an example to configure Azure Identity for a SignalR endpoint named "Endpoint1": @@ -87,7 +87,7 @@ Here's an example to configure Azure Identity for a SignalR endpoint named "Endp The `serviceUri` is required. Other items, such as `clientId` and `clientSecret`, are optional depending upon which credentials you want to use. -For more information, see [Common properties for Identity-based connections](https://docs.microsoft.com/azure/azure-functions/functions-reference?tabs=azurewebjobsstorage#common-properties-for-identity-based-connections). Note that you should replace `` there with `Azure__SignalR__Endpoints__`. +For more information, see [Common properties for Identity-based connections](https://learn.microsoft.com/azure/azure-functions/functions-reference?tabs=azurewebjobsstorage#common-properties-for-identity-based-connections). Note that you should replace `` there with `Azure__SignalR__Endpoints__`. ## Routing diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample01_StronglyTypedHub.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample01_StronglyTypedHub.md index 59386bf7fa6d..af0cde845449 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample01_StronglyTypedHub.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample01_StronglyTypedHub.md @@ -2,7 +2,7 @@ Strongly typed serverless hub is a programming model which allows you to define your SignalR client methods in an interface, and the RPC implementation will be done by SignalR. -This sample demonstrates how to create a strongly typed serverless hub and invoke SignalR client methods in it. To see more details on serverless hub, please go [here](https://docs.microsoft.com/azure/azure-signalr/signalr-concept-serverless-development-config#class-based-model). +This sample demonstrates how to create a strongly typed serverless hub and invoke SignalR client methods in it. To see more details on serverless hub, please go [here](https://learn.microsoft.com/azure/azure-signalr/signalr-concept-serverless-development-config#class-based-model). ## Define a strongly typed serverless hub class diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample02_CustomizingJsonSerialization.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample02_CustomizingJsonSerialization.md index 977c5b3ef14c..6689ddb8c77f 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample02_CustomizingJsonSerialization.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample02_CustomizingJsonSerialization.md @@ -1,6 +1,6 @@ # Customizing JSON serialization -The messages sent to SignalR clients are serialized into JSON. By default, the JSON library used is `Newtonsoft.Json` for "transient" transport type (the default one), and `System.Text.Json` for "persistent" transport type. If you want to customize the JSON serialization, you could set the `SignalROptions.JsonObjectSerializer` with [dependency injection](https://docs.microsoft.com/azure/azure-functions/functions-dotnet-dependency-injection#register-services). The `SignalROptions.JsonObjectSerializer` will be applied to all the service transport types. See the samples below: +The messages sent to SignalR clients are serialized into JSON. By default, the JSON library used is `Newtonsoft.Json` for "transient" transport type (the default one), and `System.Text.Json` for "persistent" transport type. If you want to customize the JSON serialization, you could set the `SignalROptions.JsonObjectSerializer` with [dependency injection](https://learn.microsoft.com/azure/azure-functions/functions-dotnet-dependency-injection#register-services). The `SignalROptions.JsonObjectSerializer` will be applied to all the service transport types. See the samples below: ## Use `System.Text.Json` library diff --git a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample03_IntegrationWithAppGateway.md b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample03_IntegrationWithAppGateway.md index be005ce5ca43..94e11c5f1469 100644 --- a/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample03_IntegrationWithAppGateway.md +++ b/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService/samples/Sample03_IntegrationWithAppGateway.md @@ -7,13 +7,13 @@ This way works if you want to auth with access key or managed identity. Just app `Endpoint=https://.service.signalr.net;AccessKey=;ServerEndpoint=https://;ClientEndpoint=https://;Version=1.0;` -To see more about connection string , go [here](https://docs.microsoft.com/azure/azure-signalr/concept-connection-string). +To see more about connection string , go [here](https://learn.microsoft.com/azure/azure-signalr/concept-connection-string). ## Option 2: Identity-based Connection Identity-based connection allows you to auth with multiple types of azure credentials including managed identity credentials. -Here is a sample to configure the identity-based connection when your [connectionStringSetting](https://docs.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-trigger?tabs=in-process&pivots=programming-language-csharp#attributes) has the default value `AzureSignalRConnectionString`. +Here is a sample to configure the identity-based connection when your [connectionStringSetting](https://learn.microsoft.com/azure/azure-functions/functions-bindings-signalr-service-trigger?tabs=in-process&pivots=programming-language-csharp#attributes) has the default value `AzureSignalRConnectionString`. ```properties AzureSignalRConnectionString__serviceUri = https://.service.signalr.net @@ -22,8 +22,8 @@ AzureSignalRConnectionString__clientEndpoint = https:// ``` Related docs: -* [Azure Application Identity](https://docs.microsoft.com/azure/azure-signalr/signalr-howto-authorize-application#azure-functions-signalr-bindings) -* [Managed identity](https://docs.microsoft.com/azure/azure-signalr/signalr-howto-authorize-managed-identity#azure-functions-signalr-bindings) +* [Azure Application Identity](https://learn.microsoft.com/azure/azure-signalr/signalr-howto-authorize-application#azure-functions-signalr-bindings) +* [Managed identity](https://learn.microsoft.com/azure/azure-signalr/signalr-howto-authorize-managed-identity#azure-functions-signalr-bindings) ## Option 3: Dependency injection (In-Process Model Runtime Only) This is the most flexible way for C# in-process model functions. Configure `SignalROptions.ServiceEndpoints` in your startup class as follows: diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md b/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md index 8081ba50e284..50ba74c648aa 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md +++ b/sdk/sphere/Azure.ResourceManager.Sphere/CHANGELOG.md @@ -50,4 +50,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/README.md b/sdk/sphere/Azure.ResourceManager.Sphere/README.md index 1c15e8c8841e..4c6ce95475c4 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/README.md +++ b/sdk/sphere/Azure.ResourceManager.Sphere/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/CHANGELOG.md b/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/CHANGELOG.md index 76bba26e68cc..37a87b7032bc 100644 --- a/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/CHANGELOG.md +++ b/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/CHANGELOG.md @@ -27,4 +27,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/README.md b/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/README.md index bf72aca24f9c..d7760d5f67d2 100644 --- a/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/README.md +++ b/sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/CHANGELOG.md b/sdk/sqlmanagement/Azure.ResourceManager.Sql/CHANGELOG.md index 3eb9f97cc794..388ae41b0419 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/CHANGELOG.md +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/CHANGELOG.md @@ -144,8 +144,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -238,4 +238,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/README.md b/sdk/sqlmanagement/Azure.ResourceManager.Sql/README.md index 866127fca613..bd751a368ec6 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/README.md +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/CHANGELOG.md b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/CHANGELOG.md index e2431ddf9775..f0983403d8f8 100644 --- a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/CHANGELOG.md +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/CHANGELOG.md @@ -55,8 +55,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -87,4 +87,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/README.md b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/README.md index 6e24937d71b8..427deb747f54 100644 --- a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/README.md +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/CHANGELOG.md b/sdk/standbypool/Azure.ResourceManager.StandbyPool/CHANGELOG.md index 4857d2f55e1a..3bdf59d0175b 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/CHANGELOG.md +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/CHANGELOG.md @@ -31,4 +31,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/README.md b/sdk/standbypool/Azure.ResourceManager.StandbyPool/README.md index 10d4112652ef..d21cf05d8ed6 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/README.md +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/README.md @@ -41,7 +41,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/storage/Azure.ResourceManager.Storage/CHANGELOG.md b/sdk/storage/Azure.ResourceManager.Storage/CHANGELOG.md index b068dcfd0d25..50e8d5858d32 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/CHANGELOG.md +++ b/sdk/storage/Azure.ResourceManager.Storage/CHANGELOG.md @@ -132,8 +132,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -257,7 +257,7 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). ### Management Client Changes diff --git a/sdk/storage/Azure.ResourceManager.Storage/README.md b/sdk/storage/Azure.ResourceManager.Storage/README.md index 2e925abfa970..78bf2deb4047 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/README.md +++ b/sdk/storage/Azure.ResourceManager.Storage/README.md @@ -24,7 +24,7 @@ dotnet add package Azure.ResourceManager.Storage ### Prerequisites -First, to install the [Microsoft Azure Identity](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) package: +First, to install the [Microsoft Azure Identity](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet) package: ```dotnetcli dotnet add package Azure.Identity @@ -33,11 +33,11 @@ dotnet add package Azure.Identity Set up a way to authenticate to Microsoft Azure with Azure Identity. Some options are: -- Through the [Azure CLI Sign in](https://docs.microsoft.com/cli/azure/authenticate-azure-cli). -- Via [Visual Studio](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#authenticating-via-visual-studio). +- Through the [Azure CLI Sign in](https://learn.microsoft.com/cli/azure/authenticate-azure-cli). +- Via [Visual Studio](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#authenticating-via-visual-studio). - Setting [Environment Variables](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/AuthUsingEnvironmentVariables.md). -More information and different authentication approaches using Microsoft Azure Identity can be found in [this document](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +More information and different authentication approaches using Microsoft Azure Identity can be found in [this document](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). ### Authenticate the Client @@ -53,7 +53,7 @@ using Azure.ResourceManager; ArmClient armClient = new ArmClient(new DefaultAzureCredential()); ``` -More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). +More documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential). ## Key concepts @@ -71,7 +71,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://git - If you find a bug or have a suggestion, file an issue via [GitHub issues](https://github.com/Azure/azure-sdk-for-net/issues), and make sure you add the "Preview" label to the issue. - If you need help, check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on StackOverflow using Azure and .NET tags. -- If having trouble with authentication, go to [DefaultAzureCredential documentation](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). +- If having trouble with authentication, go to [DefaultAzureCredential documentation](https://learn.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet). ## Next steps diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md index 440e95b4ea6e..f6bcf9e2b44f 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.21.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-05-05. ## 12.20.0 (2024-11-12) diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/README.md b/sdk/storage/Azure.Storage.Blobs.Batch/README.md index c2c52e5c10c9..532f5970e04b 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/README.md +++ b/sdk/storage/Azure.Storage.Blobs.Batch/README.md @@ -210,18 +210,18 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs.Batch/src [package]: https://www.nuget.org/packages/Azure.Storage.Blobs.Batch/ [docs]: https://azure.github.io/azure-sdk-for-net/storage.html -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md index eaa0dca1ce57..af2ef51643b1 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.0.0-preview.53 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-05-05. ## 12.0.0-preview.52 (2024-11-12) diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/README.md b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/README.md index 8e2fedea8756..1e414161fa6b 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/README.md +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/README.md @@ -149,16 +149,16 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src [package]: https://www.nuget.org/packages/Azure.Storage.Blobs.ChangeFeed/ -[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blob-change-feed +[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blob-change-feed [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [authenticating_with_blobs]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/ [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs index d65ba1264ce6..1edae8044c6a 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/ChangeFeedTestBase.cs @@ -33,6 +33,7 @@ namespace Azure.Storage.Blobs.ChangeFeed.Tests BlobClientOptions.ServiceVersion.V2024_08_04, BlobClientOptions.ServiceVersion.V2024_11_04, BlobClientOptions.ServiceVersion.V2025_01_05, + BlobClientOptions.ServiceVersion.V2025_05_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion, RecordingServiceVersion = StorageVersionExtensions.MaxVersion, diff --git a/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md b/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md index 8faad4f14059..d8d0f295b967 100644 --- a/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md +++ b/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md @@ -4,7 +4,7 @@ This guide intends to assist customers in migrating from legacy versions of the While this guide is generally applicable to older versions of the SDK, it was written with v11 in mind as the starting point. It will focus on side-by-side comparisons for similar operations between the v12 package, [`Azure.Storage.Blobs`](https://www.nuget.org/packages/Azure.Storage.Blobs) and v11 package, [`Microsoft.Azure.Storage.Blob`](https://www.nuget.org/packages/Microsoft.Azure.Storage.Blob/). -Familiarity with the legacy client library is assumed. For those new to the Azure Storage Blobs client library for .NET, please refer to the [Quickstart](https://docs.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-dotnet) for the v12 library rather than this guide. +Familiarity with the legacy client library is assumed. For those new to the Azure Storage Blobs client library for .NET, please refer to the [Quickstart](https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-dotnet) for the v12 library rather than this guide. ## Table of contents @@ -151,7 +151,7 @@ If you wish to rotate the key within your `BlobServiceClient` (and any derived c ### Shared Access Policies -To learn more, visit our article [Create a Stored Access Policy with .NET](https://docs.microsoft.com/azure/storage/common/storage-stored-access-policy-define-dotnet) or take a look at the code comparison below. +To learn more, visit our article [Create a Stored Access Policy with .NET](https://learn.microsoft.com/azure/storage/common/storage-stored-access-policy-define-dotnet) or take a look at the code comparison below. v11 ```csharp @@ -200,7 +200,7 @@ await containerClient.SetAccessPolicyAsync(permissions: signedIdentifiers); The modern SDK has taken a client-based approach. There are no objects designed to be representations of storage resources, but instead clients that act as your mechanism to interact with your storage resources in the cloud. **Clients hold no state of your resources.** This is most noticable when looking at [blob metadata](#managing-blob-metadata). The hierarchical structure of Azure Blob Storage can be understood by the following diagram: -![Blob Storage Hierarchy](https://docs.microsoft.com/en-us/azure/storage/blobs/media/storage-blobs-introduction/blob1.png) +![Blob Storage Hierarchy](https://learn.microsoft.com/en-us/azure/storage/blobs/media/storage-blobs-introduction/blob1.png) In the interest of simplifying the API surface, v12 uses three top level clients to match this structure that can be used to interact with a majority of your resources: `BlobServiceClient`, `BlobContainerClient`, and `BlobClient`. Note that blob-type-specific operations can still be accessed by their specific clients, as in v11. @@ -214,7 +214,7 @@ We recommend `BlobClient` as a starting place when migrating code that used v11' Note the absence of a v12 equivalent for v11's `CloudBlobDirectory`. Directories were an SDK-only concept that did not exist in Azure Blob Storage, and which were not brought forwards into the modern Storage SDK. As shown by the diagram in [Client Structure](#client-structure), containers only contain a flat list of blobs, but those blobs can be named and listed in ways that imply a folder-like structure. See our [Listing Blobs in a Container](#listing-blobs-in-a-container) migration samples later in this guide for more information. -For those whose workloads revolve around manipulating directories and heavily relied on the leagacy SDKs abstraction of this structure, consider the [pros and cons of enabling hierarchical namespace](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-namespace) on your storage account, which would allow switching to the [Data Lake gen 2 SDK](https://docs.microsoft.com/dotnet/api/overview/azure/storage.files.datalake-readme), whose migration is not covered in this document. +For those whose workloads revolve around manipulating directories and heavily relied on the leagacy SDKs abstraction of this structure, consider the [pros and cons of enabling hierarchical namespace](https://learn.microsoft.com/azure/storage/blobs/data-lake-storage-namespace) on your storage account, which would allow switching to the [Data Lake gen 2 SDK](https://learn.microsoft.com/dotnet/api/overview/azure/storage.files.datalake-readme), whose migration is not covered in this document. #### Class Conversion Reference @@ -427,7 +427,7 @@ await foreach (Page page in pages) #### Hierarchical Listing -See the [list blobs documentation](https://docs.microsoft.com/azure/storage/blobs/storage-blobs-list?tabs=dotnet#flat-listing-versus-hierarchical-listing) for more information on what a hierarchical listing is. +See the [list blobs documentation](https://learn.microsoft.com/azure/storage/blobs/storage-blobs-list?tabs=dotnet#flat-listing-versus-hierarchical-listing) for more information on what a hierarchical listing is. While manual page iteration as described in the previous section is still applicable to a hierarchical listing, this section will only give examples using lazy enumerables. @@ -510,7 +510,7 @@ blobClient.Upload( ### Generate a SAS - There are various SAS tokens that may be generated. Visit our documentation pages to learn more: [Create a User Delegation SAS](https://docs.microsoft.com/azure/storage/blobs/storage-blob-user-delegation-sas-create-dotnet), [Create a Service SAS](https://docs.microsoft.com/azure/storage/blobs/storage-blob-service-sas-create-dotnet), or [Create an Account SAS](https://docs.microsoft.com/azure/storage/common/storage-account-sas-create-dotnet?toc=/azure/storage/blobs/toc.json). + There are various SAS tokens that may be generated. Visit our documentation pages to learn more: [Create a User Delegation SAS](https://learn.microsoft.com/azure/storage/blobs/storage-blob-user-delegation-sas-create-dotnet), [Create a Service SAS](https://learn.microsoft.com/azure/storage/blobs/storage-blob-service-sas-create-dotnet), or [Create an Account SAS](https://learn.microsoft.com/azure/storage/common/storage-account-sas-create-dotnet?toc=/azure/storage/blobs/toc.json). v11 @@ -821,10 +821,10 @@ await blobClient.DownloadToAsync(targetStream, cancellationTokenSource.Token); ### Samples More examples can be found at: -- [Azure Storage samples using v12 .NET Client Libraries](https://docs.microsoft.com/azure/storage/common/storage-samples-dotnet?toc=/azure/storage/blobs/toc.json) +- [Azure Storage samples using v12 .NET Client Libraries](https://learn.microsoft.com/azure/storage/common/storage-samples-dotnet?toc=/azure/storage/blobs/toc.json) ### Links and references -- [Quickstart](https://docs.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-dotnet) -- [Samples](https://docs.microsoft.com/azure/storage/common/storage-samples-dotnet?toc=/azure/storage/blobs/toc.json) -- [.NET SDK reference](https://docs.microsoft.com/dotnet/api/azure.storage.blobs?view=azure-dotnet) +- [Quickstart](https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-dotnet) +- [Samples](https://learn.microsoft.com/azure/storage/common/storage-samples-dotnet?toc=/azure/storage/blobs/toc.json) +- [.NET SDK reference](https://learn.microsoft.com/dotnet/api/azure.storage.blobs?view=azure-dotnet) - [Announcing the Azure Storage v12 Client Libraries](https://techcommunity.microsoft.com/t5/azure-storage/announcing-the-azure-storage-v12-client-libraries/ba-p/1482394) blog post diff --git a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md index e59f18e7fbd3..3070cac9a9a6 100644 --- a/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Blobs/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.24.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-05-05. ## 12.23.0 (2024-11-12) diff --git a/sdk/storage/Azure.Storage.Blobs/README.md b/sdk/storage/Azure.Storage.Blobs/README.md index 53356eb2bace..3ac35d02eb56 100644 --- a/sdk/storage/Azure.Storage.Blobs/README.md +++ b/sdk/storage/Azure.Storage.Blobs/README.md @@ -208,21 +208,21 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs/src [package]: https://www.nuget.org/packages/Azure.Storage.Blobs/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage.blobs -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage.blobs +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[storage_ad]: https://docs.microsoft.com/azure/storage/common/storage-auth-aad +[storage_ad]: https://learn.microsoft.com/azure/storage/common/storage-auth-aad [storage_ad_sample]: samples/Sample02c_Auth_ActiveDirectory.cs [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs/samples/ [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs index 2cb9eb52ea60..51769f818526 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net6.0.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -88,6 +88,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class BlobContainerClient @@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs index 167e4b1d926a..40b216f43dfa 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.net8.0.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -88,6 +88,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class BlobContainerClient @@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index d93de39ce28c..41c77a5a3f5f 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -88,6 +88,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class BlobContainerClient @@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs index d93de39ce28c..41c77a5a3f5f 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.1.cs @@ -51,7 +51,7 @@ public BlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredential c } public partial class BlobClientOptions : Azure.Core.ClientOptions { - public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) { } + public BlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Blobs.Models.BlobAudience? Audience { get { throw null; } set { } } public Azure.Storage.Blobs.Models.CustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -88,6 +88,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class BlobContainerClient @@ -1850,7 +1851,7 @@ public PageBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredenti } public partial class SpecializedBlobClientOptions : Azure.Storage.Blobs.BlobClientOptions { - public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } + public SpecializedBlobClientOptions(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion version = Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05) : base (default(Azure.Storage.Blobs.BlobClientOptions.ServiceVersion)) { } public Azure.Storage.ClientSideEncryptionOptions ClientSideEncryption { get { throw null; } set { } } } public static partial class SpecializedBlobExtensions diff --git a/sdk/storage/Azure.Storage.Blobs/assets.json b/sdk/storage/Azure.Storage.Blobs/assets.json index 0facb33e2a02..c2eab78fe079 100644 --- a/sdk/storage/Azure.Storage.Blobs/assets.json +++ b/sdk/storage/Azure.Storage.Blobs/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Blobs", - "Tag": "net/storage/Azure.Storage.Blobs_5c382dfb14" + "Tag": "net/storage/Azure.Storage.Blobs_f174db6035" } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs index b16cefc83a53..0f90cb42066d 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClientOptions.cs @@ -156,7 +156,12 @@ public enum ServiceVersion /// /// The 2025-01-05 service version. /// - V2025_01_05 = 25 + V2025_01_05 = 25, + + /// + /// The 2025-05-05 service version. + /// + V2025_05_05 = 26 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 8e51aa708c24..d0ef9cabe003 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -8597,7 +8597,7 @@ public async Task GetAccountInfoAsync_Error() // Act await TestHelper.AssertExpectedExceptionAsync( blobClient.GetAccountInfoAsync(), - e => Assert.AreEqual("ResourceNotFound", e.ErrorCode)); + e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode)); } public IEnumerable AccessConditions_Data diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs index d0372ab20cf4..b5fa20756266 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobsClientTestFixtureAttribute.cs @@ -36,6 +36,7 @@ public BlobsClientTestFixtureAttribute(params object[] additionalParameters) BlobClientOptions.ServiceVersion.V2024_08_04, BlobClientOptions.ServiceVersion.V2024_11_04, BlobClientOptions.ServiceVersion.V2025_01_05, + BlobClientOptions.ServiceVersion.V2025_05_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion }, diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs index 451586836669..ae5ea381c322 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs @@ -3191,6 +3191,7 @@ await TestHelper.AssertExpectedExceptionAsync( [TestCase("%21%2A%27%28%29%3B%5B%5D%3A%40%26%25%3D%2B%24%2C%2F%3F%23äÄöÖüÜß")] [TestCase("my cool blob")] [TestCase("blob")] + [TestCase(" ")] public async Task GetBlobClient_SpecialCharacters(string blobName) { // Arrange @@ -3241,6 +3242,7 @@ public async Task GetBlobClient_SpecialCharacters(string blobName) [TestCase("%21%2A%27%28%29%3B%5B%5D%3A%40%26%25%3D%2B%24%2C%2F%3F%23äÄöÖüÜß")] [TestCase("my cool blob")] [TestCase("blob")] + [TestCase(" ")] public async Task GetBlobClients_SpecialCharacters(string blobName) { // Arrange @@ -4319,7 +4321,7 @@ public async Task GetAccountInfoAsync_Error() // Act await TestHelper.AssertExpectedExceptionAsync( containerClient.GetAccountInfoAsync(), - e => Assert.AreEqual("ResourceNotFound", e.ErrorCode)); + e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode)); } [RecordedTest] diff --git a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs index c10fcfbd73ab..34b15d303669 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/ServiceClientTests.cs @@ -522,7 +522,7 @@ public async Task GetAccountInfoAsync_Error() // Act await TestHelper.AssertExpectedExceptionAsync( service.GetAccountInfoAsync(), - e => Assert.AreEqual("ResourceNotFound", e.ErrorCode)); + e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode)); } [RecordedTest] diff --git a/sdk/storage/Azure.Storage.Common/CHANGELOG.md b/sdk/storage/Azure.Storage.Common/CHANGELOG.md index a2d9f13d9289..dc1764d16bc6 100644 --- a/sdk/storage/Azure.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Common/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.23.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- This release contains bug fixes to improve quality. ## 12.22.0 (2024-11-12) diff --git a/sdk/storage/Azure.Storage.Common/README.md b/sdk/storage/Azure.Storage.Common/README.md index b2c87d17f234..ac0953830a9b 100644 --- a/sdk/storage/Azure.Storage.Common/README.md +++ b/sdk/storage/Azure.Storage.Common/README.md @@ -90,22 +90,22 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src [package]: https://www.nuget.org/packages/Azure.Storage.Common/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/ -[product_docs]: https://docs.microsoft.com/azure/storage/ +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/ +[product_docs]: https://learn.microsoft.com/azure/storage/ [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [auth_credentials]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Common/src/StorageSharedKeyCredential.cs [blobs_examples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs/README.md#Examples [files_examples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares/README.md#Examples [queues_examples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Queues/README.md#Examples [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/common-rest-api-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/common-rest-api-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Common/samples/ [blobs_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Blobs/README.md#next-steps [files_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares/README.md#next-steps diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs index 121838723ee4..aebd7cfb6a16 100644 --- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs +++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net6.0.cs @@ -183,7 +183,7 @@ public enum SasProtocol } public partial class SasQueryParameters { - public const string DefaultSasVersion = "2025-01-05"; + public const string DefaultSasVersion = "2025-05-05"; protected SasQueryParameters() { } protected SasQueryParameters(System.Collections.Generic.IDictionary values) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs index 121838723ee4..aebd7cfb6a16 100644 --- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs +++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.net8.0.cs @@ -183,7 +183,7 @@ public enum SasProtocol } public partial class SasQueryParameters { - public const string DefaultSasVersion = "2025-01-05"; + public const string DefaultSasVersion = "2025-05-05"; protected SasQueryParameters() { } protected SasQueryParameters(System.Collections.Generic.IDictionary values) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs index 9b59550e809d..73d1004bbb02 100644 --- a/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Common/api/Azure.Storage.Common.netstandard2.0.cs @@ -182,7 +182,7 @@ public enum SasProtocol } public partial class SasQueryParameters { - public const string DefaultSasVersion = "2025-01-05"; + public const string DefaultSasVersion = "2025-05-05"; protected SasQueryParameters() { } protected SasQueryParameters(System.Collections.Generic.IDictionary values) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs index 3e00882188fb..c16ed90ead55 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/Constants.cs @@ -25,7 +25,7 @@ internal static class Constants /// Gets the default service version to use when building shared access /// signatures. /// - public const string DefaultSasVersion = "2025-01-05"; + public const string DefaultSasVersion = "2025-05-05"; /// /// Max download range size while requesting a transactional hash. diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs index 44c0973ea9be..b657980045ff 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/StorageVersionExtensions.cs @@ -46,7 +46,7 @@ internal static class StorageVersionExtensions /// public const ServiceVersion LatestVersion = #if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK || DataMovementSDK || BlobDataMovementSDK || ShareDataMovementSDK - ServiceVersion.V2025_01_05; + ServiceVersion.V2025_05_05; #else ERROR_STORAGE_SERVICE_NOT_DEFINED; #endif @@ -56,7 +56,7 @@ internal static class StorageVersionExtensions /// internal const ServiceVersion MaxVersion = #if BlobSDK || QueueSDK || FileSDK || DataLakeSDK || ChangeFeedSDK || DataMovementSDK || BlobDataMovementSDK || ShareDataMovementSDK - ServiceVersion.V2025_01_05; + ServiceVersion.V2025_05_05; #else ERROR_STORAGE_SERVICE_NOT_DEFINED; #endif @@ -95,6 +95,7 @@ public static string ToVersionString(this ServiceVersion version) => ServiceVersion.V2024_08_04 => "2024-08-04", ServiceVersion.V2024_11_04 => "2024-11-04", ServiceVersion.V2025_01_05 => "2025-01-05", + ServiceVersion.V2025_05_05 => "2025-05-05", #endif _ => throw Errors.VersionNotSupported(nameof(version)) }; @@ -158,6 +159,8 @@ public static Azure.Storage.Blobs.BlobClientOptions.ServiceVersion AsBlobsVersio Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2024_11_04, Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05 => Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_01_05, + Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05 => + Azure.Storage.Blobs.BlobClientOptions.ServiceVersion.V2025_05_05, _ => throw Errors.VersionNotSupported(nameof(version)) }; #endif diff --git a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs index 5694c805d355..80d95bab4793 100644 --- a/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs +++ b/sdk/storage/Azure.Storage.Common/tests/CommonTestBase.cs @@ -35,8 +35,9 @@ namespace Azure.Storage.Test BlobClientOptions.ServiceVersion.V2024_08_04, BlobClientOptions.ServiceVersion.V2024_11_04, BlobClientOptions.ServiceVersion.V2025_01_05, - RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2025_01_05, - LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2024_11_04, })] + BlobClientOptions.ServiceVersion.V2025_05_05, + RecordingServiceVersion = BlobClientOptions.ServiceVersion.V2025_05_05, + LiveServiceVersions = new object[] { BlobClientOptions.ServiceVersion.V2025_01_05, })] public abstract class CommonTestBase : StorageTestBase { protected readonly BlobClientOptions.ServiceVersion _serviceVersion; diff --git a/sdk/storage/Azure.Storage.Common/tests/Shared/TestExtensions.cs b/sdk/storage/Azure.Storage.Common/tests/Shared/TestExtensions.cs index 2fe727db4c18..c5f77d5b9c8e 100644 --- a/sdk/storage/Azure.Storage.Common/tests/Shared/TestExtensions.cs +++ b/sdk/storage/Azure.Storage.Common/tests/Shared/TestExtensions.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.Linq; using System.Reflection; +using System.Text; using System.Threading.Tasks; namespace Azure.Storage @@ -216,13 +217,14 @@ private static string ToString(object credentials, bool exportSecrets) { if (credentials is StorageSharedKeyCredential sharedKeyCredentials) { + string sanitizedBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes("Sanitized")); return string.Format( CultureInfo.InvariantCulture, "{0}={1};{2}={3}", Constants.ConnectionStrings.AccountNameSetting, sharedKeyCredentials.AccountName, Constants.ConnectionStrings.AccountKeySetting, - exportSecrets ? ((StorageSharedKeyCredential)credentials).ExportBase64EncodedKey() : "Sanitized"); + exportSecrets ? ((StorageSharedKeyCredential)credentials).ExportBase64EncodedKey() : sanitizedBase64); } else if (credentials is SharedAccessSignatureCredentials sasCredentials) { diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md index 31b4624208d8..677fc4f8cee8 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/README.md @@ -161,17 +161,17 @@ To create a blob `StorageResource`, use the methods `FromBlob` or `FromContainer ```C# Snippet:ResourceConstruction_Blobs StorageResource container = blobs.FromContainer( - new Uri("http://myaccount.blob.core.windows.net/container")); + new Uri("https://myaccount.blob.core.windows.net/container")); // Block blobs are the default if no options are specified StorageResource blockBlob = blobs.FromBlob( - new Uri("http://myaccount.blob.core.windows.net/container/sample-blob-block"), + new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-block"), new BlockBlobStorageResourceOptions()); StorageResource pageBlob = blobs.FromBlob( - new Uri("http://myaccount.blob.core.windows.net/container/sample-blob-page"), + new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-page"), new PageBlobStorageResourceOptions()); StorageResource appendBlob = blobs.FromBlob( - new Uri("http://myaccount.blob.core.windows.net/container/sample-blob-append"), + new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-append"), new AppendBlobStorageResourceOptions()); ``` @@ -330,18 +330,18 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src [package]: https://www.nuget.org/packages/Azure.Storage.Common/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/ -[product_docs]: https://docs.microsoft.com/azure/storage/ +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/ +[product_docs]: https://learn.microsoft.com/azure/storage/ [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/common-rest-api-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/common-rest-api-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs/samples [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs index 8fa859c3e8c1..b3607bc683a3 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/samples/Sample01b_HelloWorldAsync.cs @@ -58,17 +58,17 @@ public async Task ResourceConstructionDemonstration() // Construct simple blob resources for data movement #region Snippet:ResourceConstruction_Blobs StorageResource container = blobs.FromContainer( - new Uri("http://myaccount.blob.core.windows.net/container")); + new Uri("https://myaccount.blob.core.windows.net/container")); // Block blobs are the default if no options are specified StorageResource blockBlob = blobs.FromBlob( - new Uri("http://myaccount.blob.core.windows.net/container/sample-blob-block"), + new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-block"), new BlockBlobStorageResourceOptions()); StorageResource pageBlob = blobs.FromBlob( - new Uri("http://myaccount.blob.core.windows.net/container/sample-blob-page"), + new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-page"), new PageBlobStorageResourceOptions()); StorageResource appendBlob = blobs.FromBlob( - new Uri("http://myaccount.blob.core.windows.net/container/sample-blob-append"), + new Uri("https://myaccount.blob.core.windows.net/container/sample-blob-append"), new AppendBlobStorageResourceOptions()); #endregion } @@ -866,8 +866,8 @@ public async Task PauseAndResumeAsync_ManagerId() // Get a temporary path on disk where we can download the file //@@ string downloadPath = "hello.jpg"; - // Download the public blob at https://aka.ms/bloburl - BlockBlobClient sourceBlob = new BlockBlobClient(new Uri("https://aka.ms/bloburl")); + // Download the public MacBeth copy at https://www.gutenberg.org/cache/epub/1533/pg1533.txt + BlockBlobClient sourceBlob = new BlockBlobClient(new Uri("https://www.gutenberg.org/cache/epub/1533/pg1533.txt")); await sourceBlob.DownloadToAsync(downloadPath); // Create a token credential that can use our Azure Active @@ -932,14 +932,16 @@ public async Task PauseAndResumeAsync_DataTransferPause() // Get a temporary path on disk where we can download the file //@@ string downloadPath = "hello.jpg"; - // Download the public blob at https://aka.ms/bloburl - BlockBlobClient sourceBlob = new BlockBlobClient(new Uri("https://aka.ms/bloburl")); + // Download the public MacBeth copy at https://www.gutenberg.org/cache/epub/1533/pg1533.txt + BlockBlobClient sourceBlob = new BlockBlobClient(new Uri("https://www.gutenberg.org/cache/epub/1533/pg1533.txt")); await sourceBlob.DownloadToAsync(downloadPath); // Create transfer manager - TransferManager transferManager = new TransferManager(new TransferManagerOptions()); BlobsStorageResourceProvider blobs = new(); LocalFilesStorageResourceProvider files = new(); + TransferManagerOptions options = new TransferManagerOptions(); + options.ResumeProviders = new List() { files, blobs }; + TransferManager transferManager = new TransferManager(options); // Create source and destination resource StorageResource sourceResource = blobs.FromClient(sourceBlob); diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md index 23a26375a6a7..ce65832830da 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/stress/README.md @@ -13,7 +13,7 @@ The scenarios in this directory provide a suite of stress tests that test the Da ### Prerequisites -When tests are run locally, Azure resources need to be created prior to running the test. This can be done through the Azure CLI, an ARM pr bicep file, or the Azure Portal. The bicep file included in this directory can be used to [deploy all resources](https://docs.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-resource-group?tabs=azure-cli) aside from the application insights portal. +When tests are run locally, Azure resources need to be created prior to running the test. This can be done through the Azure CLI, an ARM pr bicep file, or the Azure Portal. The bicep file included in this directory can be used to [deploy all resources](https://learn.microsoft.com/azure/azure-resource-manager/bicep/deploy-to-resource-group?tabs=azure-cli) aside from the application insights portal. To run the compiled .dll file, navigate to the `/artifacts/bin/Azure.Storage.DataMovement.Blobs.Stress/Release/net7.0` directory. diff --git a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs index f8d60e2a675f..fa3fabb8178b 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Blobs/tests/ProgressHandlerTests.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core.TestFramework; using Azure.Storage.DataMovement.Tests; using BaseBlobs::Azure.Storage.Blobs; using DMBlobs::Azure.Storage.DataMovement.Blobs; @@ -298,7 +299,7 @@ await TransferAndAssertProgress( waitTime: 30); } - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35558")] + [LiveOnly] [Test] [TestCase(0)] [TestCase(150)] @@ -310,22 +311,27 @@ public async Task ProgressHandler_PauseResume(int delayInMs) await PopulateTestContainer(source.Container); - StorageResourceContainer sourceResource = - new BlobStorageResourceContainer(source.Container); - StorageResourceContainer destinationResource = - new LocalDirectoryStorageResourceContainer(destination.DirectoryPath); + BlobsStorageResourceProvider blobProvider = new(TestEnvironment.Credential); + LocalFilesStorageResourceProvider localProvider = new(); - TransferManager transferManager = new TransferManager(); + TransferManagerOptions transferManagerOptions = new() + { + ResumeProviders = [blobProvider, localProvider] + }; + TransferManager transferManager = new(transferManagerOptions); - TestProgressHandler progressHandler = new TestProgressHandler(); - DataTransferOptions transferOptions = new DataTransferOptions() + TestProgressHandler progressHandler = new(); + DataTransferOptions transferOptions = new() { ProgressHandlerOptions = new ProgressHandlerOptions(progressHandler, true) }; - TestEventsRaised testEventsRaised = new TestEventsRaised(transferOptions); + TestEventsRaised testEventsRaised = new(transferOptions); // Act - Start transfer - DataTransfer transfer = await transferManager.StartTransferAsync(sourceResource, destinationResource, transferOptions); + DataTransfer transfer = await transferManager.StartTransferAsync( + blobProvider.FromContainer(source.Container.Uri), + localProvider.FromDirectory(destination.DirectoryPath), + transferOptions); // TODO: This can likely be replaced with something better once mocking is in place // Wait for the transfer to start happening @@ -334,7 +340,7 @@ public async Task ProgressHandler_PauseResume(int delayInMs) // Pause transfer CancellationTokenSource tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); await transferManager.PauseTransferIfRunningAsync(transfer.Id, tokenSource.Token); - Assert.AreEqual(DataTransferState.Paused, transfer.TransferStatus); + Assert.AreEqual(DataTransferState.Paused, transfer.TransferStatus.State); // Record the current number of progress updates to use during assertions int pause = progressHandler.Updates.Count; @@ -348,7 +354,7 @@ public async Task ProgressHandler_PauseResume(int delayInMs) await resumeTransfer.WaitForCompletionAsync(tokenSource.Token); // Assert - Assert.AreEqual(DataTransferState.Completed, resumeTransfer.TransferStatus); + Assert.AreEqual(DataTransferState.Completed, resumeTransfer.TransferStatus.State); ProgressHandlerAsserts.AssertFileProgress(progressHandler.Updates, 5, pauseIndexes: pause); ProgressHandlerAsserts.AssertBytesTransferred(progressHandler.Updates, _expectedBytesTransferred); } diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md index df3dd37bdefa..fa5833660665 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md @@ -193,18 +193,18 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Common/src [package]: https://www.nuget.org/packages/Azure.Storage.Common/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/ -[product_docs]: https://docs.microsoft.com/azure/storage/ +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/ +[product_docs]: https://learn.microsoft.com/azure/storage/ [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/common-rest-api-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/common-rest-api-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json index 17c1d5998bc4..894ba0cdb16a 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.DataMovement.Files.Shares", - "Tag": "net/storage/Azure.Storage.DataMovement.Files.Shares_9c671b78d9" + "Tag": "net/storage/Azure.Storage.DataMovement.Files.Shares_6238d37ed0" } diff --git a/sdk/storage/Azure.Storage.DataMovement/README.md b/sdk/storage/Azure.Storage.DataMovement/README.md index 69d7389b1e3a..9d2cf65115c0 100644 --- a/sdk/storage/Azure.Storage.DataMovement/README.md +++ b/sdk/storage/Azure.Storage.DataMovement/README.md @@ -279,20 +279,20 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement/src -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/ -[product_docs]: https://docs.microsoft.com/azure/storage/ +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/ +[product_docs]: https://learn.microsoft.com/azure/storage/ [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [auth_credentials]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Common/src/StorageSharedKeyCredential.cs [blobs_examples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs#examples [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/common-rest-api-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/common-rest-api-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.DataMovement.Blobs/samples [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs index da3c954f7812..1708bf6fe0a9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs @@ -51,7 +51,7 @@ public enum DataTransferOrder } public partial class DataTransferProgress { - protected internal DataTransferProgress() { } + internal DataTransferProgress() { } public long? BytesTransferred { get { throw null; } } public long CompletedCount { get { throw null; } } public long FailedCount { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs index da3c954f7812..1708bf6fe0a9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs @@ -51,7 +51,7 @@ public enum DataTransferOrder } public partial class DataTransferProgress { - protected internal DataTransferProgress() { } + internal DataTransferProgress() { } public long? BytesTransferred { get { throw null; } } public long CompletedCount { get { throw null; } } public long FailedCount { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs index da3c954f7812..1708bf6fe0a9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs @@ -51,7 +51,7 @@ public enum DataTransferOrder } public partial class DataTransferProgress { - protected internal DataTransferProgress() { } + internal DataTransferProgress() { } public long? BytesTransferred { get { throw null; } } public long CompletedCount { get { throw null; } } public long FailedCount { get { throw null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj b/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj index fde61bae9687..fa6e12646c29 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj +++ b/sdk/storage/Azure.Storage.DataMovement/src/Azure.Storage.DataMovement.csproj @@ -20,17 +20,14 @@ - - - - - + + diff --git a/sdk/storage/Azure.Storage.DataMovement/src/ChannelProcessing.cs b/sdk/storage/Azure.Storage.DataMovement/src/ChannelProcessing.cs index e7526c80c1dc..9689e31a1ffd 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/ChannelProcessing.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/ChannelProcessing.cs @@ -12,38 +12,47 @@ namespace Azure.Storage.DataMovement; internal delegate Task ProcessAsync(T item, CancellationToken cancellationToken); -internal interface IProcessor : IDisposable +internal interface IProcessor : IAsyncDisposable { ValueTask QueueAsync(TItem item, CancellationToken cancellationToken = default); + bool TryComplete(); ProcessAsync Process { get; set; } } internal static class ChannelProcessing { - public static IProcessor NewProcessor(int parallelism) + public static IProcessor NewProcessor(int readers, int? capacity = null) { - Argument.AssertInRange(parallelism, 1, int.MaxValue, nameof(parallelism)); - return parallelism == 1 - ? new SequentialChannelProcessor( - Channel.CreateUnbounded(new UnboundedChannelOptions() - { - AllowSynchronousContinuations = true, - SingleReader = true, - })) - : new ParallelChannelProcessor( - Channel.CreateUnbounded(new UnboundedChannelOptions() - { - AllowSynchronousContinuations = true, - }), - parallelism); + Argument.AssertInRange(readers, 1, int.MaxValue, nameof(readers)); + if (capacity.HasValue) + { + Argument.AssertInRange(capacity.Value, 1, int.MaxValue, nameof(capacity)); + } + + Channel channel = capacity.HasValue + ? Channel.CreateBounded(new BoundedChannelOptions(capacity.Value) + { + AllowSynchronousContinuations = true, + SingleReader = readers == 1, + FullMode = BoundedChannelFullMode.Wait, + }) + : Channel.CreateUnbounded(new UnboundedChannelOptions() + { + AllowSynchronousContinuations = true, + SingleReader = readers == 1, + }); + return readers == 1 + ? new SequentialChannelProcessor(channel) + : new ParallelChannelProcessor(channel, readers); } - private abstract class ChannelProcessor : IProcessor, IDisposable + private abstract class ChannelProcessor : IProcessor, IAsyncDisposable { /// /// Async channel reader task. Loops for lifetime of object. /// private Task _processorTask; + internal TaskCompletionSource _processorTaskCompletionSource; /// /// Channel of items to process. @@ -75,6 +84,9 @@ protected ChannelProcessor(Channel channel) Argument.AssertNotNull(channel, nameof(channel)); _channel = channel; _cancellationTokenSource = new(); + _processorTaskCompletionSource = new TaskCompletionSource( + false, + TaskCreationOptions.RunContinuationsAsynchronously); } public async ValueTask QueueAsync(TItem item, CancellationToken cancellationToken = default) @@ -82,14 +94,18 @@ public async ValueTask QueueAsync(TItem item, CancellationToken cancellationToke await _channel.Writer.WriteAsync(item, cancellationToken).ConfigureAwait(false); } + public bool TryComplete() => _channel.Writer.TryComplete(); + protected abstract ValueTask NotifyOfPendingItemProcessing(); - public void Dispose() + public async ValueTask DisposeAsync() { + _channel.Writer.TryComplete(); if (!_cancellationTokenSource.IsCancellationRequested) { _cancellationTokenSource.Cancel(); } + await _processorTaskCompletionSource.Task.ConfigureAwait(false); GC.SuppressFinalize(this); } } @@ -102,11 +118,21 @@ public SequentialChannelProcessor(Channel channel) protected override async ValueTask NotifyOfPendingItemProcessing() { - // Process all available items in the queue. - while (await _channel.Reader.WaitToReadAsync(_cancellationToken).ConfigureAwait(false)) + try { - TItem item = await _channel.Reader.ReadAsync(_cancellationToken).ConfigureAwait(false); - await Process(item, _cancellationToken).ConfigureAwait(false); + // Process all available items in the queue. + while (await _channel.Reader.WaitToReadAsync(_cancellationToken).ConfigureAwait(false)) + { + TItem item = await _channel.Reader.ReadAsync(_cancellationToken).ConfigureAwait(false); + await Process(item, _cancellationToken).ConfigureAwait(false); + } + } + finally + { + // Since the channel has it's own dedicated CancellationTokenSource (only called at Dispose) + // we don't need a catch block to catch the exception since we know the cancellation either comes + // from successful completion or another failure that has been already invoked. + _processorTaskCompletionSource.TrySetResult(true); } } } @@ -126,23 +152,33 @@ public ParallelChannelProcessor( protected override async ValueTask NotifyOfPendingItemProcessing() { - List chunkRunners = new List(DataMovementConstants.MaxJobPartReaders); - while (await _channel.Reader.WaitToReadAsync(_cancellationToken).ConfigureAwait(false)) + List chunkRunners = new List(_maxConcurrentProcessing); + try { - TItem item = await _channel.Reader.ReadAsync(_cancellationToken).ConfigureAwait(false); - if (chunkRunners.Count >= DataMovementConstants.MaxJobPartReaders) + while (await _channel.Reader.WaitToReadAsync(_cancellationToken).ConfigureAwait(false)) { - // Clear any completed blocks from the task list - int removedRunners = chunkRunners.RemoveAll(x => x.IsCompleted || x.IsCanceled || x.IsFaulted); - // If no runners have finished.. - if (removedRunners == 0) + TItem item = await _channel.Reader.ReadAsync(_cancellationToken).ConfigureAwait(false); + if (chunkRunners.Count >= _maxConcurrentProcessing) { - // Wait for at least one runner to finish - await Task.WhenAny(chunkRunners).ConfigureAwait(false); - chunkRunners.RemoveAll(x => x.IsCompleted || x.IsCanceled || x.IsFaulted); + // Clear any completed blocks from the task list + int removedRunners = chunkRunners.RemoveAll(x => x.IsCompleted || x.IsCanceled || x.IsFaulted); + // If no runners have finished.. + if (removedRunners == 0) + { + // Wait for at least one runner to finish + await Task.WhenAny(chunkRunners).ConfigureAwait(false); + chunkRunners.RemoveAll(x => x.IsCompleted || x.IsCanceled || x.IsFaulted); + } } + chunkRunners.Add(Task.Run(async () => await Process(item, _cancellationToken).ConfigureAwait(false))); } - chunkRunners.Add(Task.Run(async () => await Process(item, _cancellationToken).ConfigureAwait(false))); + } + finally + { + // Since the channel has it's own dedicated CancellationTokenSource (only called at Dispose) + // we don't need a catch block to catch the exception since we know the cancellation either comes + // from successful completion or another failure that has been already invoked. + _processorTaskCompletionSource.TrySetResult(true); } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/CommitChunkHandler.cs b/sdk/storage/Azure.Storage.DataMovement/src/CommitChunkHandler.cs index 603b9c89579e..479c5261feff 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/CommitChunkHandler.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/CommitChunkHandler.cs @@ -2,24 +2,18 @@ // Licensed under the MIT License. using System; -using Azure.Core; using System.Threading.Tasks; using System.Threading; -using System.Threading.Channels; -using Azure.Core.Pipeline; using Azure.Storage.Common; namespace Azure.Storage.DataMovement { - internal class CommitChunkHandler : IDisposable + internal class CommitChunkHandler : IAsyncDisposable { - // Indicates whether the current thread is processing stage chunks. - private static Task _processStageChunkEvents; - #region Delegate Definitions public delegate Task QueuePutBlockTaskInternal(long offset, long blockSize, long expectedLength, StorageResourceItemProperties properties); public delegate Task QueueCommitBlockTaskInternal(StorageResourceItemProperties sourceProperties); - public delegate void ReportProgressInBytes(long bytesWritten); + public delegate ValueTask ReportProgressInBytes(long bytesWritten); public delegate Task InvokeFailedEventHandlerInternal(Exception ex); #endregion Delegate Definitions @@ -36,29 +30,26 @@ public struct Behaviors public InvokeFailedEventHandlerInternal InvokeFailedHandler { get; set; } } - private event SyncAsyncEventHandler _commitBlockHandler; - internal SyncAsyncEventHandler GetCommitBlockHandler() => _commitBlockHandler; - /// - /// Create channel of to keep track of that are + /// Create channel of to keep track of that are /// waiting to update the bytesTransferred and other required operations. /// - private readonly Channel _stageChunkChannel; - private CancellationToken _cancellationToken; + private readonly IProcessor _stageChunkProcessor; + private readonly CancellationToken _cancellationToken; private long _bytesTransferred; private readonly long _expectedLength; private readonly long _blockSize; private readonly DataTransferOrder _transferOrder; - private readonly ClientDiagnostics _clientDiagnostics; private readonly StorageResourceItemProperties _sourceProperties; + internal bool _isChunkHandlerRunning; + public CommitChunkHandler( long expectedLength, long blockSize, Behaviors behaviors, DataTransferOrder transferOrder, - ClientDiagnostics clientDiagnostics, StorageResourceItemProperties sourceProperties, CancellationToken cancellationToken) { @@ -67,7 +58,14 @@ public CommitChunkHandler( throw Errors.InvalidExpectedLength(expectedLength); } Argument.AssertNotNull(behaviors, nameof(behaviors)); - Argument.AssertNotNull(clientDiagnostics, nameof(clientDiagnostics)); + + _cancellationToken = cancellationToken; + // Set bytes transferred to block size because we transferred the initial block + _bytesTransferred = blockSize; + _expectedLength = expectedLength; + _blockSize = blockSize; + _transferOrder = transferOrder; + _sourceProperties = sourceProperties; _queuePutBlockTask = behaviors.QueuePutBlockTask ?? throw Errors.ArgumentNull(nameof(behaviors.QueuePutBlockTask)); @@ -78,151 +76,69 @@ public CommitChunkHandler( _invokeFailedEventHandler = behaviors.InvokeFailedHandler ?? throw Errors.ArgumentNull(nameof(behaviors.InvokeFailedHandler)); - // Set expected length to perform commit task - _expectedLength = expectedLength; - - // Create channel of finished Stage Chunk Args to update the bytesTransferred - // and for ending tasks like commit block. - // The size of the channel should never exceed 50k (limit on blocks in a block blob). - // and that's in the worst case that we never read from the channel and had a maximum chunk blob. - _stageChunkChannel = Channel.CreateUnbounded( - new UnboundedChannelOptions() - { - // Single reader is required as we can only read and write to bytesTransferred value - SingleReader = true, - }); - _cancellationToken = cancellationToken; - - // Set bytes transferred to block size because we transferred the initial block - _bytesTransferred = blockSize; - - _processStageChunkEvents = Task.Run(() => NotifyOfPendingStageChunkEvents()); - - _blockSize = blockSize; - _transferOrder = transferOrder; - if (_transferOrder == DataTransferOrder.Sequential) - { - _commitBlockHandler += SequentialBlockEvent; - } - _commitBlockHandler += ConcurrentBlockEvent; - _clientDiagnostics = clientDiagnostics; - _sourceProperties = sourceProperties; + _stageChunkProcessor = ChannelProcessing.NewProcessor( + readers: 1, + capacity: DataMovementConstants.Channels.StageChunkCapacity); + _stageChunkProcessor.Process = ProcessCommitRange; + _isChunkHandlerRunning = true; } - public void Dispose() + public async ValueTask DisposeAsync() { - // We no longer have to read from the channel. We are not expecting any more requests. - _stageChunkChannel.Writer.TryComplete(); - DisposeHandlers(); + _isChunkHandlerRunning = false; + await _stageChunkProcessor.DisposeAsync().ConfigureAwait(false); } - private void DisposeHandlers() + public async ValueTask QueueChunkAsync(QueueStageChunkArgs args) { - if (_transferOrder == DataTransferOrder.Sequential) - { - _commitBlockHandler -= SequentialBlockEvent; - } - _commitBlockHandler -= ConcurrentBlockEvent; + await _stageChunkProcessor.QueueAsync(args).ConfigureAwait(false); } - private async Task ConcurrentBlockEvent(StageChunkEventArgs args) + private async Task ProcessCommitRange(QueueStageChunkArgs args, CancellationToken cancellationToken = default) { try { - if (args.Success) - { - // Let's add to the channel, and our notifier will handle the chunks. - _stageChunkChannel.Writer.TryWrite(args); - } - else - { - // Log an unexpected error since it came back unsuccessful - throw args.Exception; - } - } - catch (Exception ex) - { - // Log an unexpected error since it came back unsuccessful - await _invokeFailedEventHandler(ex).ConfigureAwait(false); - } - } + _bytesTransferred += args.BytesTransferred; + await _reportProgressInBytes(args.BytesTransferred).ConfigureAwait(false); - private async Task NotifyOfPendingStageChunkEvents() - { - try - { - while (await _stageChunkChannel.Reader.WaitToReadAsync(_cancellationToken).ConfigureAwait(false)) + if (_bytesTransferred == _expectedLength) { - // Read one event argument at a time. - StageChunkEventArgs args = await _stageChunkChannel.Reader.ReadAsync(_cancellationToken).ConfigureAwait(false); - - // don't need to use Interlocked.Add() as we are reading one event at a time - // and _bytesTransferred is not being read/updated from any other thread - _bytesTransferred += args.BytesTransferred; - - // Report the incremental bytes transferred - _reportProgressInBytes(args.BytesTransferred); - - if (_bytesTransferred == _expectedLength) - { - // Add CommitBlockList task to the channel - await _queueCommitBlockTask(_sourceProperties).ConfigureAwait(false); - } - else if (_bytesTransferred > _expectedLength) - { - throw Errors.MismatchLengthTransferred( - expectedLength: _expectedLength, - actualLength: _bytesTransferred); - } + // Add CommitBlockList task to the channel + await _queueCommitBlockTask(_sourceProperties).ConfigureAwait(false); } - } - catch (Exception ex) - { - await _invokeFailedEventHandler(ex).ConfigureAwait(false); - } - } - - private async Task SequentialBlockEvent(StageChunkEventArgs args) - { - try - { - if (args.Success) + else if (_bytesTransferred < _expectedLength) { - long oldOffset = args.Offset; - long newOffset = oldOffset + _blockSize; - if (newOffset < _expectedLength) + // If this is a sequential transfer, we need to queue the next chunk + if (_transferOrder == DataTransferOrder.Sequential) { + long newOffset = args.Offset + _blockSize; long blockLength = (newOffset + _blockSize < _expectedLength) ? - _blockSize : - _expectedLength - newOffset; - await _queuePutBlockTask(newOffset, blockLength, _expectedLength, _sourceProperties).ConfigureAwait(false); + _blockSize : + _expectedLength - newOffset; + await _queuePutBlockTask( + newOffset, + blockLength, + _expectedLength, + _sourceProperties).ConfigureAwait(false); } } - else + else // _bytesTransferred > _expectedLength { - // Log an unexpected error since it came back unsuccessful - throw args.Exception; + throw Errors.MismatchLengthTransferred( + expectedLength: _expectedLength, + actualLength: _bytesTransferred); } } catch (Exception ex) { - // Log an unexpected error since it came back unsuccessful - await _invokeFailedEventHandler(ex).ConfigureAwait(false); - } - } - - public async Task InvokeEvent(StageChunkEventArgs args) - { - // There's a race condition where the event handler was disposed and an event - // was already invoked, we should skip over this as the download chunk handler - // was already disposed, and we should just ignore any more incoming events. - if (_commitBlockHandler != null) - { - await _commitBlockHandler.RaiseAsync( - args, - nameof(CommitChunkHandler), - nameof(_commitBlockHandler), - _clientDiagnostics).ConfigureAwait(false); + // If we are disposing, we don't want to invoke the failed event handler + // because the error is likely due to the job part being disposed and was + // invoked by another InvokeFailedEventHandler call. + if (_isChunkHandlerRunning) + { + // This will trigger the job part to call Dispose on this object + _ = Task.Run(() => _invokeFailedEventHandler(ex)); + } } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/DataMovementEventSource.cs b/sdk/storage/Azure.Storage.DataMovement/src/DataMovementEventSource.cs new file mode 100644 index 000000000000..f94d012ae2cc --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/src/DataMovementEventSource.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.Tracing; +using Azure.Core.Diagnostics; + +namespace Azure.Storage.DataMovement +{ + internal class DataMovementEventSource : AzureEventSource + { + private const string EventSourceName = "Azure-Storage-DataMovement"; + + private const int TransferQueuedEvent = 1; + private const int TransferCompletedEvent = 2; + private const int JobPartStatusEvent = 3; + private const int EnumerationCompleteEvent = 4; + private const int ResumeTransferEvent = 5; + private const int ResumeEnumerationCompleteEvent = 6; + + private DataMovementEventSource() : base(EventSourceName) { } + + public static DataMovementEventSource Singleton { get; } = new DataMovementEventSource(); + + [Event(TransferQueuedEvent, Level = EventLevel.Informational, Message = "Transfer [{0}] Transfer queued: {1} -> {2}")] + public void TransferQueued(string transferId, string source, string destination) + { + WriteEvent(TransferQueuedEvent, transferId, source, destination); + } + + [NonEvent] + public void TransferQueued(string transferId, StorageResource source, StorageResource destination) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + TransferQueued(transferId, source.Uri.AbsoluteUri, destination.Uri.AbsoluteUri); + } + } + + [Event(TransferCompletedEvent, Level = EventLevel.Informational, Message = "Transfer [{0}] Transfer completed: HasFailed={1}, HasKsipped={2}")] + public void TransferCompleted(string transferId, bool hasFailed, bool hasSkipped) + { + WriteEvent(TransferCompletedEvent, transferId, hasFailed, hasSkipped); + } + + [NonEvent] + public void TransferCompleted(string transferId, DataTransferStatus status) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + TransferCompleted(transferId, status.HasFailedItems, status.HasSkippedItems); + } + } + + [Event(JobPartStatusEvent, Level = EventLevel.Verbose, Message = "Transfer [{0}:{1}] Status={2}, Failed={3}, Skipped={4}")] + public void JobPartStatus(string transferId, int jobPart, string jobPartStatus, bool failed, bool skipped) + { + WriteEvent(JobPartStatusEvent, transferId, jobPart, jobPartStatus, failed, skipped); + } + + [NonEvent] + public void JobPartStatus(string transferId, int jobPart, DataTransferStatus status) + { + if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) + { + JobPartStatus(transferId, jobPart, status.State.ToString(), status.HasFailedItems, status.HasSkippedItems); + } + } + + [Event(EnumerationCompleteEvent, Level = EventLevel.Informational, Message = "Transfer [{0}] Enumeration complete: JobPartCount={1}")] + public void EnumerationComplete(string transferId, int jobPartCount) + { + WriteEvent(EnumerationCompleteEvent, transferId, jobPartCount); + } + + [Event(ResumeTransferEvent, Level = EventLevel.Informational, Message = "Resume transfer [{0]} Transfer queued: {1} -> {2}")] + public void ResumeTransfer(string transferId, string source, string destination) + { + WriteEvent(ResumeTransferEvent, transferId, source, destination); + } + + [NonEvent] + public void ResumeTransfer(string transferId, StorageResource source, StorageResource destination) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + ResumeTransfer(transferId, source.Uri.AbsoluteUri, destination.Uri.AbsoluteUri); + } + } + + [Event(ResumeEnumerationCompleteEvent, Level = EventLevel.Informational, Message = "Resume transfer [{0}] Resumed saved job parts: JobPartCount={1}")] + public void ResumeEnumerationComplete(string transferId, int jobPartCount) + { + WriteEvent(ResumeEnumerationCompleteEvent, transferId, jobPartCount); + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement/src/DataTransferInternalState.cs b/sdk/storage/Azure.Storage.DataMovement/src/DataTransferInternalState.cs index b38b477e2e5d..1513413b6fda 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/DataTransferInternalState.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/DataTransferInternalState.cs @@ -94,6 +94,7 @@ public bool SetTransferState(DataTransferState state) if (DataTransferState.Completed == _status.State || DataTransferState.Paused == _status.State) { + DataMovementEventSource.Singleton.TransferCompleted(Id, _status); // If the _completionSource has been cancelled or the exception // has been set, we don't need to check if TrySetResult returns false // because it's acceptable to cancel or have an error occur before then. diff --git a/sdk/storage/Azure.Storage.DataMovement/src/DataTransferProgress.cs b/sdk/storage/Azure.Storage.DataMovement/src/DataTransferProgress.cs index a642466c489f..d0159af18855 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/DataTransferProgress.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/DataTransferProgress.cs @@ -8,10 +8,7 @@ namespace Azure.Storage.DataMovement /// public class DataTransferProgress { - /// - /// Constructor for mocking. - /// - protected internal DataTransferProgress() { } + internal DataTransferProgress() { } /// /// Number of files that were transferred successfully. diff --git a/sdk/storage/Azure.Storage.DataMovement/src/DownloadChunkHandler.cs b/sdk/storage/Azure.Storage.DataMovement/src/DownloadChunkHandler.cs index 0f59fea48999..5ecf5f7011ca 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/DownloadChunkHandler.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/DownloadChunkHandler.cs @@ -4,17 +4,16 @@ using System; using System.IO; using System.Threading; -using System.Threading.Channels; using System.Threading.Tasks; using Azure.Storage.Common; namespace Azure.Storage.DataMovement { - internal class DownloadChunkHandler : IDisposable + internal class DownloadChunkHandler : IAsyncDisposable { #region Delegate Definitions public delegate Task CopyToDestinationFileInternal(long offset, long length, Stream stream, long expectedLength, bool initial); - public delegate void ReportProgressInBytes(long bytesWritten); + public delegate ValueTask ReportProgressInBytes(long bytesWritten); public delegate Task QueueCompleteFileDownloadInternal(); public delegate Task InvokeFailedEventHandlerInternal(Exception ex); #endregion Delegate Definitions @@ -33,16 +32,17 @@ public struct Behaviors } /// - /// Create channel of to keep track to handle - /// writing downloaded chunks to the destination as well as tracking overall progress. + /// Create channel of to handle writing + /// downloaded chunks to the destination as well as tracking overall progress. /// - private readonly Channel _downloadRangeChannel; - private readonly Task _processDownloadRangeEvents; + private readonly IProcessor _downloadRangeProcessor; private readonly CancellationToken _cancellationToken; private long _bytesTransferred; private readonly long _expectedLength; + internal bool _isChunkHandlerRunning; + /// /// The controller for downloading the chunks to each file. /// @@ -66,30 +66,18 @@ public DownloadChunkHandler( Behaviors behaviors, CancellationToken cancellationToken) { - // Set bytes transferred to the length of bytes we got back from the initial - // download request - _bytesTransferred = currentTransferred; - - // The size of the channel should never exceed 50k (limit on blocks in a block blob). - // and that's in the worst case that we never read from the channel and had a maximum chunk blob. - _downloadRangeChannel = Channel.CreateUnbounded( - new UnboundedChannelOptions() - { - // Single reader is required as we can only have one writer to the destination. - SingleReader = true, - }); - _processDownloadRangeEvents = Task.Run(NotifyOfPendingChunkDownloadEvents); - _cancellationToken = cancellationToken; - - _expectedLength = expectedLength; - if (expectedLength <= 0) { throw Errors.InvalidExpectedLength(expectedLength); } Argument.AssertNotNull(behaviors, nameof(behaviors)); - // Set values + _cancellationToken = cancellationToken; + // Set bytes transferred to the length of bytes we got back from the initial + // download request + _bytesTransferred = currentTransferred; + _expectedLength = expectedLength; + _copyToDestinationFile = behaviors.CopyToDestinationFile ?? throw Errors.ArgumentNull(nameof(behaviors.CopyToDestinationFile)); _reportProgressInBytes = behaviors.ReportProgressInBytes @@ -98,61 +86,59 @@ public DownloadChunkHandler( ?? throw Errors.ArgumentNull(nameof(behaviors.InvokeFailedHandler)); _queueCompleteFileDownload = behaviors.QueueCompleteFileDownload ?? throw Errors.ArgumentNull(nameof(behaviors.QueueCompleteFileDownload)); + + _downloadRangeProcessor = ChannelProcessing.NewProcessor( + readers: 1, + capacity: DataMovementConstants.Channels.DownloadChunkCapacity); + _downloadRangeProcessor.Process = ProcessDownloadRange; + _isChunkHandlerRunning = true; } - public void Dispose() + public async ValueTask DisposeAsync() { - _downloadRangeChannel.Writer.TryComplete(); + _isChunkHandlerRunning = false; + await _downloadRangeProcessor.DisposeAsync().ConfigureAwait(false); } - public void QueueChunk(QueueDownloadChunkArgs args) + public async ValueTask QueueChunkAsync(QueueDownloadChunkArgs args) { - _downloadRangeChannel.Writer.TryWrite(args); + await _downloadRangeProcessor.QueueAsync(args).ConfigureAwait(false); } - private async Task NotifyOfPendingChunkDownloadEvents() + private async Task ProcessDownloadRange(QueueDownloadChunkArgs args, CancellationToken cancellationToken = default) { try { - while (await _downloadRangeChannel.Reader.WaitToReadAsync(_cancellationToken).ConfigureAwait(false)) + // Copy the current chunk to the destination + using (Stream content = args.Content) { - // Read one event argument at a time. - QueueDownloadChunkArgs args = await _downloadRangeChannel.Reader.ReadAsync(_cancellationToken).ConfigureAwait(false); - - // Copy the current chunk to the destination - using (Stream content = args.Content) - { - await _copyToDestinationFile( - args.Offset, - args.Length, - content, - _expectedLength, - initial: _bytesTransferred == 0).ConfigureAwait(false); - } - UpdateBytesAndRange(args.Length); + await _copyToDestinationFile( + args.Offset, + args.Length, + content, + _expectedLength, + initial: _bytesTransferred == 0).ConfigureAwait(false); + } + _bytesTransferred += args.Length; + await _reportProgressInBytes(args.Length).ConfigureAwait(false); - // Check if we finished downloading the blob - if (_bytesTransferred == _expectedLength) - { - await _queueCompleteFileDownload().ConfigureAwait(false); - } + // Check if we finished downloading the blob + if (_bytesTransferred == _expectedLength) + { + await _queueCompleteFileDownload().ConfigureAwait(false); } } catch (Exception ex) { - // This will trigger the job part to call Dispose on this object - await _invokeFailedEventHandler(ex).ConfigureAwait(false); + // If we are disposing, we don't want to invoke the failed event handler + // because the error is likely due to the job part being disposed and was + // invoked by another InvokeFailedEventHandler call. + if (_isChunkHandlerRunning) + { + // This will trigger the job part to call Dispose on this object + _ = Task.Run(() => _invokeFailedEventHandler(ex)); + } } } - - /// - /// Moves the downloader to the next range and updates/reports bytes transferred. - /// - /// - private void UpdateBytesAndRange(long bytesDownloaded) - { - _bytesTransferred += bytesDownloaded; - _reportProgressInBytes(bytesDownloaded); - } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/JobBuilder.cs b/sdk/storage/Azure.Storage.DataMovement/src/JobBuilder.cs index c2a8adea5f65..bca3c12151d3 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/JobBuilder.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/JobBuilder.cs @@ -135,7 +135,10 @@ private async Task BuildSingleTransferJob( arrayPool: _arrayPool, clientDiagnostics: ClientDiagnostics); - if (resumeJob) + int jobPartCount = await checkpointer.GetCurrentJobPartCountAsync( + transferId: dataTransfer.Id, + cancellationToken: cancellationToken).ConfigureAwait(false); + if (resumeJob && jobPartCount > 0) { JobPartPlanHeader part = await checkpointer.GetJobPartAsync(dataTransfer.Id, partNumber: 0).ConfigureAwait(false); job.AppendJobPart( diff --git a/sdk/storage/Azure.Storage.DataMovement/src/JobPartInternal.cs b/sdk/storage/Azure.Storage.DataMovement/src/JobPartInternal.cs index d3b74e0a0ef0..3f05be101148 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/JobPartInternal.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/JobPartInternal.cs @@ -4,9 +4,8 @@ using System.Buffers; using System.Collections.Generic; using System.Globalization; -using System.IO; -using System.Linq; using System.Threading; +using System.Threading.Channels; using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; @@ -102,9 +101,9 @@ internal abstract class JobPartInternal internal ClientDiagnostics ClientDiagnostics { get; } /// - /// If the transfer status of the job changes then the event will get added to this handler. + /// If the transfer status of the job part changes then the event will get added to this handler. /// - public SyncAsyncEventHandler PartTransferStatusEventHandler { get; internal set; } + public SyncAsyncEventHandler PartTransferStatusEventHandler { get; internal set; } /// /// If the transfer status of the job changes then the event will get added to this handler. @@ -154,7 +153,7 @@ internal JobPartInternal( ITransferCheckpointer checkpointer, TransferProgressTracker progressTracker, ArrayPool arrayPool, - SyncAsyncEventHandler jobPartEventHandler, + SyncAsyncEventHandler jobPartEventHandler, SyncAsyncEventHandler statusEventHandler, SyncAsyncEventHandler failedEventHandler, SyncAsyncEventHandler skippedEventHandler, @@ -239,6 +238,11 @@ await QueueChunk( /// The task that's queueing up the chunks public abstract Task ProcessPartToChunkAsync(); + /// + /// Diposes of chunk handler. + /// + public abstract Task DisposeHandlersAsync(); + /// /// Triggers the cancellation for the Job Part. /// @@ -280,11 +284,11 @@ internal async Task OnTransferStateChangedAsync(DataTransferState transferState) // Progress tracking, do before invoking the event below if (transferState == DataTransferState.InProgress) { - _progressTracker.IncrementInProgressFiles(); + await _progressTracker.IncrementInProgressFilesAsync(_cancellationToken).ConfigureAwait(false); } else if (JobPartStatus.HasCompletedSuccessfully) { - _progressTracker.IncrementCompletedFiles(); + await _progressTracker.IncrementCompletedFilesAsync(_cancellationToken).ConfigureAwait(false); await InvokeSingleCompletedArgAsync().ConfigureAwait(false); } @@ -292,8 +296,9 @@ internal async Task OnTransferStateChangedAsync(DataTransferState transferState) await SetCheckpointerStatusAsync().ConfigureAwait(false); await PartTransferStatusEventHandler.RaiseAsync( - new TransferStatusEventArgs( + new JobPartStatusEventArgs( _dataTransfer.Id, + PartNumber, JobPartStatus.DeepCopy(), false, _cancellationToken), @@ -304,13 +309,9 @@ await PartTransferStatusEventHandler.RaiseAsync( } } - /// - /// To change all transfer statues at the same time - /// - /// - internal void ReportBytesWritten(long bytesTransferred) + protected async ValueTask ReportBytesWrittenAsync(long bytesTransferred) { - _progressTracker.IncrementBytesTransferred(bytesTransferred); + await _progressTracker.IncrementBytesTransferred(bytesTransferred, _cancellationToken).ConfigureAwait(false); } public async virtual Task InvokeSingleCompletedArgAsync() @@ -351,15 +352,16 @@ await TransferSkippedEventHandler.RaiseAsync( ClientDiagnostics) .ConfigureAwait(false); } - _progressTracker.IncrementSkippedFiles(); + await _progressTracker.IncrementSkippedFilesAsync(_cancellationToken).ConfigureAwait(false); // Update the JobPartStatus. If was already updated (e.g. there was a failed item before) // then don't raise the PartTransferStatusEventHandler if (JobPartStatus.SetSkippedItem()) { await PartTransferStatusEventHandler.RaiseAsync( - new TransferStatusEventArgs( + new JobPartStatusEventArgs( _dataTransfer.Id, + PartNumber, JobPartStatus.DeepCopy(), false, _cancellationToken), @@ -369,6 +371,7 @@ await PartTransferStatusEventHandler.RaiseAsync( .ConfigureAwait(false); } //TODO: figure out why we set the Completed state here and not just wait for all the chunks to finish + await DisposeHandlersAsync().ConfigureAwait(false); await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); } @@ -379,6 +382,7 @@ public async virtual Task InvokeFailedArgAsync(Exception ex) { if (ex is not OperationCanceledException && ex is not TaskCanceledException && + ex is not ChannelClosedException && ex.InnerException is not TaskCanceledException && !ex.Message.Contains("The request was canceled.")) { @@ -405,15 +409,16 @@ await TransferFailedEventHandler.RaiseAsync( ClientDiagnostics) .ConfigureAwait(false); } - _progressTracker.IncrementFailedFiles(); + await _progressTracker.IncrementFailedFilesAsync(_cancellationToken).ConfigureAwait(false); // Update the JobPartStatus. If was already updated (e.g. there was a failed item before) // then don't raise the PartTransferStatusEventHandler if (JobPartStatus.SetFailedItem()) { await PartTransferStatusEventHandler.RaiseAsync( - new TransferStatusEventArgs( + new JobPartStatusEventArgs( _dataTransfer.Id, + PartNumber, JobPartStatus.DeepCopy(), false, _cancellationToken), @@ -427,8 +432,11 @@ await PartTransferStatusEventHandler.RaiseAsync( try { // Trigger job cancellation if the failed handler is enabled - await TriggerCancellationAsync().ConfigureAwait(false); - await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); + if (JobPartStatus.State != DataTransferState.Pausing && + JobPartStatus.State != DataTransferState.Stopping) + { + await TriggerCancellationAsync().ConfigureAwait(false); + } } catch (Exception cancellationException) { @@ -447,6 +455,31 @@ await TransferFailedEventHandler.RaiseAsync( ClientDiagnostics) .ConfigureAwait(false); } + + // Whether or not we were able to trigger the cancellation and successfully clean up + // we should always call CheckAndUpdateCancellationStateAsync to correctly make + // sure the job part is in the correct state. + try + { + await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); + } + catch (Exception checkUpdateException) + { + // If an exception is thrown while trying to clean up, + // raise the failed event and prevent the transfer from hanging + await TransferFailedEventHandler.RaiseAsync( + new TransferItemFailedEventArgs( + _dataTransfer.Id, + _sourceResource, + _destinationResource, + checkUpdateException, + false, + _cancellationToken), + nameof(JobPartInternal), + nameof(TransferFailedEventHandler), + ClientDiagnostics) + .ConfigureAwait(false); + } } /// @@ -459,12 +492,25 @@ public async virtual Task CleanupAbortedJobPartAsync() // If the failure occurred due to the file already existing or authentication, // and overwrite wasn't enabled, don't delete the existing file. We can remove // the unfinished file for other error types. - if (JobPartFailureType.Other == _failureType) + // If a Pause was called, we can remove the unfinished file. + if (JobPartFailureType.Other == _failureType || DataTransferState.Pausing == JobPartStatus.State) { // If the job part is paused or ended with failures // delete the destination resource because it could be unfinished or corrupted // If we resume we would have to start from the beginning anyways. - await _destinationResource.DeleteIfExistsAsync(_cancellationToken).ConfigureAwait(false); + try + { + // We can't pass the cancellation token + // here due to the fact that the job's cancellation token has already been called. + // We are cleaning up / deleting optimistically, which means that if + // the clean / delete attempt fails, then we continue on. The failure may be due + // to the overall reason why the job was cancelled in the first place. + await _destinationResource.DeleteIfExistsAsync().ConfigureAwait(false); + } + catch + { + // We are cleaning up / deleting optimistically, move on if it fails. + } } } @@ -502,26 +548,7 @@ internal static long ParseRangeTotalLength(string range) return long.Parse(range.Substring(lengthSeparator + 1), CultureInfo.InvariantCulture); } - internal static List<(long Offset, long Size)> GetRangeList(long blockSize, long fileLength) - { - // The list tracking blocks IDs we're going to commit - List<(long Offset, long Size)> partitions = new List<(long, long)>(); - - // Partition the stream into individual blocks - foreach ((long Offset, long Length) block in GetPartitionIndexes(fileLength, blockSize)) - { - /* We need to do this first! Length is calculated on the fly based on stream buffer - * contents; We need to record the partition data first before consuming the stream - * asynchronously. */ - partitions.Add(block); - } - return partitions; - } - - /// - /// Partition a stream into a series of blocks buffered as needed by an array pool. - /// - private static IEnumerable<(long Offset, long Length)> GetPartitionIndexes( + protected static IEnumerable<(long Offset, long Length)> GetRanges( long streamLength, // StreamLength needed to divide before hand long blockSize) { @@ -569,6 +596,7 @@ internal async Task CheckAndUpdateCancellationStateAsync() DataTransferState newState = JobPartStatus.State == DataTransferState.Pausing ? DataTransferState.Paused : DataTransferState.Completed; + await DisposeHandlersAsync().ConfigureAwait(false); await OnTransferStateChangedAsync(newState).ConfigureAwait(false); } } @@ -601,5 +629,21 @@ private void SetFailureType(string exceptionMessage) } } } + + internal async Task CheckTransferStateBeforeRunning() + { + // If the main transfer has been stopped, do not process this part. + if (_dataTransfer.TransferStatus.State == DataTransferState.Pausing) + { + await OnTransferStateChangedAsync(DataTransferState.Paused).ConfigureAwait(false); + return false; + } + else if (_dataTransfer.TransferStatus.State == DataTransferState.Stopping) + { + await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); + return false; + } + return true; + } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/JobPartStatusEventArgs.cs b/sdk/storage/Azure.Storage.DataMovement/src/JobPartStatusEventArgs.cs new file mode 100644 index 000000000000..ae4d7f09b9a5 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/src/JobPartStatusEventArgs.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading; + +namespace Azure.Storage.DataMovement +{ + internal class JobPartStatusEventArgs : DataTransferEventArgs + { + public int PartNumber { get; } + + public DataTransferStatus TransferStatus { get; } + + public JobPartStatusEventArgs( + string transferId, + int partNumber, + DataTransferStatus transferStatus, + bool isRunningSynchronously, + CancellationToken cancellationToken) + : base(transferId, isRunningSynchronously, cancellationToken) + { + PartNumber = partNumber; + TransferStatus = transferStatus; + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement/src/QueueStageChunkArgs.cs b/sdk/storage/Azure.Storage.DataMovement/src/QueueStageChunkArgs.cs new file mode 100644 index 000000000000..7bb59cc7f329 --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/src/QueueStageChunkArgs.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Storage.DataMovement +{ + /// + /// This class is interchangable for + /// Stage Block (Put Block), Stage Block From Uri (Put Block From URL), + /// Append Block (Append Block), Append Block From Uri (Append Block From URL), + /// Upload Page (Put Page), Upload Pages From Uri (Put Pages From URL) + /// + /// Basically any transfer operation that must end in a Commit Block List + /// will end up using this internal event argument to track the success + /// and the bytes transferred to ensure the correct amount of bytes are tranferred. + /// + internal class QueueStageChunkArgs + { + public long Offset { get; } + public long BytesTransferred { get; } + + public QueueStageChunkArgs(long offset, long bytesTransferred) + { + Offset = offset; + BytesTransferred = bytesTransferred; + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs b/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs index f0ca9318f1d6..75e3d636e662 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs @@ -4,13 +4,15 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core; using Azure.Storage.Common; namespace Azure.Storage.DataMovement { - internal class ServiceToServiceJobPart : JobPartInternal, IDisposable + internal class ServiceToServiceJobPart : JobPartInternal, IAsyncDisposable { public delegate Task CommitBlockTaskInternal(CancellationToken cancellationToken); public CommitBlockTaskInternal CommitBlockTask { get; internal set; } @@ -36,7 +38,7 @@ private ServiceToServiceJobPart(TransferJobInternal job, int partNumber) checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -66,7 +68,7 @@ private ServiceToServiceJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -101,7 +103,7 @@ private ServiceToServiceJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -113,9 +115,9 @@ private ServiceToServiceJobPart( { } - public void Dispose() + public async ValueTask DisposeAsync() { - DisposeHandlers(); + await DisposeHandlersAsync().ConfigureAwait(false); } /// @@ -185,6 +187,11 @@ public override async Task ProcessPartToChunkAsync() { try { + // Continue only if job is in progress + if (!await CheckTransferStateBeforeRunning().ConfigureAwait(false)) + { + return; + } await OnTransferStateChangedAsync(DataTransferState.InProgress).ConfigureAwait(false); long? fileLength = default; @@ -216,27 +223,29 @@ await StartSingleCallCopy(length).ConfigureAwait(false)) // Perform a series of chunk copies followed by a commit long blockSize = _transferChunkSize; - - _commitBlockHandler = GetCommitController( + _commitBlockHandler = new CommitChunkHandler( expectedLength: length, blockSize: blockSize, - this, + GetBlockListCommitHandlerBehaviors(this), _destinationResource.TransferType, - sourceProperties); + sourceProperties, + _cancellationToken); + // If we cannot upload in one shot, initiate the parallel block uploader if (await CreateDestinationResource(length, blockSize).ConfigureAwait(false)) { - List<(long Offset, long Length)> commitBlockList = GetRangeList(blockSize, length); + IEnumerable<(long Offset, long Length)> ranges = GetRanges(length, blockSize); if (_destinationResource.TransferType == DataTransferOrder.Unordered) { - await QueueStageBlockRequests(commitBlockList, length, sourceProperties).ConfigureAwait(false); + await QueueStageBlockRequests(ranges, length, sourceProperties).ConfigureAwait(false); } else // Sequential { // Queue the first partitioned block task + (long Offset, long Length) first = ranges.First(); await QueueStageBlockRequest( - commitBlockList[0].Offset, - commitBlockList[0].Length, + first.Offset, + first.Length, length, sourceProperties).ConfigureAwait(false); } @@ -266,7 +275,7 @@ await _destinationResource.CopyFromUriAsync( options: options, cancellationToken: _cancellationToken).ConfigureAwait(false); - ReportBytesWritten(completeLength); + await ReportBytesWrittenAsync(completeLength).ConfigureAwait(false); await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); } catch (RequestFailedException exception) @@ -307,7 +316,7 @@ await _destinationResource.CopyBlockFromUriAsync( cancellationToken: _cancellationToken).ConfigureAwait(false); // Report first chunk written to progress tracker - ReportBytesWritten(blockSize); + await ReportBytesWrittenAsync(blockSize).ConfigureAwait(false); if (blockSize == length) { @@ -330,34 +339,22 @@ await _destinationResource.CopyBlockFromUriAsync( } #region CommitChunkController - internal CommitChunkHandler GetCommitController( - long expectedLength, - long blockSize, - ServiceToServiceJobPart jobPart, - DataTransferOrder transferType, - StorageResourceItemProperties sourceProperties) - => new CommitChunkHandler( - expectedLength, - blockSize, - GetBlockListCommitHandlerBehaviors(jobPart), - transferType, - ClientDiagnostics, - sourceProperties, - _cancellationToken); - internal static CommitChunkHandler.Behaviors GetBlockListCommitHandlerBehaviors( ServiceToServiceJobPart jobPart) { return new CommitChunkHandler.Behaviors { QueuePutBlockTask = jobPart.QueueStageBlockRequest, - QueueCommitBlockTask = jobPart.CompleteTransferAsync, - ReportProgressInBytes = jobPart.ReportBytesWritten, + QueueCommitBlockTask = jobPart.QueueCompleteTransferAsync, + ReportProgressInBytes = jobPart.ReportBytesWrittenAsync, InvokeFailedHandler = jobPart.InvokeFailedArgAsync, }; } #endregion + internal Task QueueCompleteTransferAsync(StorageResourceItemProperties sourceProperties) => + QueueChunkToChannelAsync(() => CompleteTransferAsync(sourceProperties)); + internal async Task CompleteTransferAsync(StorageResourceItemProperties sourceProperties) { try @@ -369,7 +366,7 @@ await _destinationResource.CompleteTransferAsync( cancellationToken: _cancellationToken).ConfigureAwait(false); // Dispose the handlers - DisposeHandlers(); + await DisposeHandlersAsync().ConfigureAwait(false); // Set completion status to completed await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); @@ -381,29 +378,34 @@ await _destinationResource.CompleteTransferAsync( } private async Task QueueStageBlockRequests( - List<(long Offset, long Size)> commitBlockList, + IEnumerable<(long Offset, long Size)> ranges, long expectedLength, StorageResourceItemProperties sourceProperties) { _queueingTasks = true; - // Partition the stream into individual blocks - foreach ((long Offset, long Length) block in commitBlockList) + try { - if (_cancellationToken.IsCancellationRequested) + // Partition the stream into individual blocks + foreach ((long Offset, long Length) block in ranges) { - break; + CancellationHelper.ThrowIfCancellationRequested(_cancellationToken); + + // Queue partitioned block task + await QueueStageBlockRequest( + block.Offset, + block.Length, + expectedLength, + sourceProperties).ConfigureAwait(false); } - // Queue partitioned block task - await QueueStageBlockRequest( - block.Offset, - block.Length, - expectedLength, - sourceProperties).ConfigureAwait(false); + _queueingTasks = false; + await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); + } + catch (Exception ex) + { + _queueingTasks = false; + await InvokeFailedArgAsync(ex).ConfigureAwait(false); } - - _queueingTasks = false; - await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); } private Task QueueStageBlockRequest( @@ -440,16 +442,10 @@ await _destinationResource.CopyBlockFromUriAsync( // The chunk handler may have been disposed in failure case if (_commitBlockHandler != null) { - // Invoke event handler to keep track of all the stage blocks - await _commitBlockHandler.InvokeEvent( - new StageChunkEventArgs( - transferId: _dataTransfer.Id, - success: true, - offset: offset, - bytesTransferred: blockLength, - exception: default, - isRunningSynchronously: true, - cancellationToken: _cancellationToken)).ConfigureAwait(false); + // Queue result to increment bytes transferred and check for completion + await _commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( + offset: offset, + bytesTransferred: blockLength)).ConfigureAwait(false); } } catch (RequestFailedException ex) @@ -469,44 +465,25 @@ await _commitBlockHandler.InvokeEvent( } catch (Exception ex) { - if (_commitBlockHandler != null) - { - await _commitBlockHandler.InvokeEvent( - new StageChunkEventArgs( - transferId: _dataTransfer.Id, - success: false, - offset: offset, - bytesTransferred: blockLength, - exception: ex, - isRunningSynchronously: true, - cancellationToken: _cancellationToken)).ConfigureAwait(false); - } - else - { - // If the _commitBlockHandler has been disposed before we call to it - // we should at least filter the exception to error handling just in case. - await InvokeFailedArgAsync(ex).ConfigureAwait(false); - } + await InvokeFailedArgAsync(ex).ConfigureAwait(false); } } public override async Task InvokeSkippedArgAsync() { - DisposeHandlers(); await base.InvokeSkippedArgAsync().ConfigureAwait(false); } public override async Task InvokeFailedArgAsync(Exception ex) { - DisposeHandlers(); await base.InvokeFailedArgAsync(ex).ConfigureAwait(false); } - internal void DisposeHandlers() + public override async Task DisposeHandlersAsync() { if (_commitBlockHandler != default) { - _commitBlockHandler.Dispose(); + await _commitBlockHandler.DisposeAsync().ConfigureAwait(false); _commitBlockHandler = null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/Shared/DataMovementConstants.cs b/sdk/storage/Azure.Storage.DataMovement/src/Shared/DataMovementConstants.cs index 21e598241225..fac2248bfb09 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/Shared/DataMovementConstants.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/Shared/DataMovementConstants.cs @@ -1,26 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; + namespace Azure.Storage.DataMovement { internal class DataMovementConstants { - /// - /// Constants of the Data Movement library - /// - internal const int InitialMainPoolSize = 32; - internal const int InitialDownloadFileThreads = 32; // Max is 3000 - internal const int CpuTuningMultiplier = 16; - internal const int MaxJobPartReaders = 64; - internal const int MaxJobChunkTasks = 3000; - internal const int StatusCheckInSec = 10; internal const int DefaultStreamCopyBufferSize = 81920; // Use the .NET default - internal const long DefaultInitialTransferSize = 32 * Constants.MB; internal const long DefaultChunkSize = 4 * Constants.MB; public const char PathForwardSlashDelimiterChar = '/'; + internal static class Channels + { + internal const int MaxJobPartReaders = 32; + internal static int MaxJobChunkReaders = Environment.ProcessorCount * 8; + internal const int JobPartCapacity = 1000; + internal const int JobChunkCapacity = 1000; + internal const int DownloadChunkCapacity = 16; + internal const int StageChunkCapacity = 1000; + } + internal static class ConcurrencyTuner { internal const int StandardMultiplier = 2; diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StageChunkEventArgs.cs b/sdk/storage/Azure.Storage.DataMovement/src/StageChunkEventArgs.cs deleted file mode 100644 index c3e14c8cbe73..000000000000 --- a/sdk/storage/Azure.Storage.DataMovement/src/StageChunkEventArgs.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading; -using Azure.Core; -using Azure.Storage.Common; - -namespace Azure.Storage.DataMovement -{ - /// - /// This class is interchangable for - /// Stage Block (Put Block), Stage Block From Uri (Put Block From URL), - /// Append Block (Append Block), Append Block From Uri (Append Block From URL), - /// Upload Page (Put Page), Upload Pages From Uri (Put Pages From URL) - /// - /// Basically any transfer operation that must end in a Commit Block List - /// will end up using this internal event argument to track the success - /// and the bytes transferred to ensure the correct amount of bytes are tranferred. - /// - internal class StageChunkEventArgs : DataTransferEventArgs - { - public bool Success { get; } - - public long Offset { get; } - - /// - /// Will be 0 if Success is false - /// - public long BytesTransferred { get; } - - /// - /// If is false, this value will be populated - /// with the exception that was thrown. - /// - public Exception Exception { get; } - - /// - /// Constructor - /// - /// - /// - /// - /// - /// - /// - /// - public StageChunkEventArgs( - string transferId, - bool success, - long offset, - long bytesTransferred, - Exception exception, - bool isRunningSynchronously, - CancellationToken cancellationToken) : - base(transferId, isRunningSynchronously, cancellationToken) - { - if (success && exception != null) - { - Argument.AssertNull(exception, nameof(exception)); - } - else if (!success && exception == null) - { - Argument.AssertNotNull(exception, nameof(exception)); - } - Success = success; - Offset = offset; - BytesTransferred = bytesTransferred; - Exception = exception; - } - } -} diff --git a/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs b/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs index 05558d51a42e..f9d1813fc1e3 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs @@ -10,10 +10,11 @@ using Azure.Storage.Shared; using Azure.Core; using Azure.Storage.Common; +using System.Linq; namespace Azure.Storage.DataMovement { - internal class StreamToUriJobPart : JobPartInternal, IDisposable + internal class StreamToUriJobPart : JobPartInternal, IAsyncDisposable { /// /// Will handle the calling the commit block list API once @@ -36,7 +37,7 @@ private StreamToUriJobPart(TransferJobInternal job, int partNumber) checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -66,7 +67,7 @@ private StreamToUriJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -101,7 +102,7 @@ private StreamToUriJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -113,9 +114,9 @@ private StreamToUriJobPart( { } - public void Dispose() + public async ValueTask DisposeAsync() { - DisposeHandlers(); + await DisposeHandlersAsync().ConfigureAwait(false); } /// @@ -188,6 +189,11 @@ public override async Task ProcessPartToChunkAsync() string operationName = $"{nameof(TransferManager.StartTransferAsync)}"; try { + // Continue only if job is in progress + if (!await CheckTransferStateBeforeRunning().ConfigureAwait(false)) + { + return; + } await OnTransferStateChangedAsync(DataTransferState.InProgress).ConfigureAwait(false); long? fileLength = default; StorageResourceItemProperties properties = await _sourceResource.GetPropertiesAsync(_cancellationToken).ConfigureAwait(false); @@ -209,13 +215,13 @@ await CreateDestinationResource( return; } long blockSize = _transferChunkSize; - - _commitBlockHandler = GetCommitController( + _commitBlockHandler = new CommitChunkHandler( expectedLength: length, blockSize: blockSize, - this, + GetBlockListCommitHandlerBehaviors(this), _destinationResource.TransferType, - properties); + properties, + _cancellationToken); bool destinationCreated = await CreateDestinationResource( blockSize, @@ -225,17 +231,18 @@ await CreateDestinationResource( if (destinationCreated) { // If we cannot upload in one shot, initiate the parallel block uploader - List<(long Offset, long Length)> rangeList = GetRangeList(blockSize, length); + IEnumerable<(long Offset, long Length)> ranges = GetRanges(length, blockSize); if (_destinationResource.TransferType == DataTransferOrder.Unordered) { - await QueueStageBlockRequests(rangeList, length, properties).ConfigureAwait(false); + await QueueStageBlockRequests(ranges, length, properties).ConfigureAwait(false); } else // Sequential { // Queue the first partitioned block task + (long Offset, long Length) first = ranges.First(); await QueueStageBlockRequest( - rangeList[0].Offset, - rangeList[0].Length, + first.Offset, + first.Length, length, properties).ConfigureAwait(false); } @@ -321,7 +328,7 @@ await _destinationResource.CopyFromStreamAsync( } // Report bytes written before completion - ReportBytesWritten(blockSize); + await ReportBytesWrittenAsync(blockSize).ConfigureAwait(false); // Set completion status to completed await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); @@ -353,34 +360,19 @@ await _destinationResource.CopyFromStreamAsync( cancellationToken: _cancellationToken).ConfigureAwait(false); } - ReportBytesWritten(blockSize); + await ReportBytesWrittenAsync(blockSize).ConfigureAwait(false); } } #region CommitChunkController - internal CommitChunkHandler GetCommitController( - long expectedLength, - long blockSize, - StreamToUriJobPart jobPart, - DataTransferOrder transferType, - StorageResourceItemProperties sourceProperties) - => new CommitChunkHandler( - expectedLength, - blockSize, - GetBlockListCommitHandlerBehaviors(jobPart), - transferType, - ClientDiagnostics, - sourceProperties, - _cancellationToken); - internal static CommitChunkHandler.Behaviors GetBlockListCommitHandlerBehaviors( StreamToUriJobPart jobPart) { return new CommitChunkHandler.Behaviors { QueuePutBlockTask = jobPart.QueueStageBlockRequest, - QueueCommitBlockTask = jobPart.CompleteTransferAsync, - ReportProgressInBytes = jobPart.ReportBytesWritten, + QueueCommitBlockTask = jobPart.QueueCompleteTransferAsync, + ReportProgressInBytes = jobPart.ReportBytesWrittenAsync, InvokeFailedHandler = jobPart.InvokeFailedArgAsync, }; } @@ -423,41 +415,21 @@ await _destinationResource.CopyFromStreamAsync( // The chunk handler may have been disposed in failure case if (_commitBlockHandler != null) { - // Invoke event handler to keep track of all the stage blocks - await _commitBlockHandler.InvokeEvent( - new StageChunkEventArgs( - transferId: _dataTransfer.Id, - success: true, - offset: offset, - bytesTransferred: blockLength, - exception: default, - isRunningSynchronously: true, - cancellationToken: _cancellationToken)).ConfigureAwait(false); + // Queue result to increment bytes transferred and check for completion + await _commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( + offset: offset, + bytesTransferred: blockLength)).ConfigureAwait(false); } } catch (Exception ex) { - if (_commitBlockHandler != null) - { - await _commitBlockHandler.InvokeEvent( - new StageChunkEventArgs( - transferId: _dataTransfer.Id, - success: false, - offset: offset, - bytesTransferred: blockLength, - exception: ex, - isRunningSynchronously: true, - cancellationToken: _cancellationToken)).ConfigureAwait(false); - } - else - { - // If the _commitBlockHandler has been disposed before we call to it - // we should at least filter the exception to error handling just in case. - await InvokeFailedArgAsync(ex).ConfigureAwait(false); - } + await InvokeFailedArgAsync(ex).ConfigureAwait(false); } } + internal Task QueueCompleteTransferAsync(StorageResourceItemProperties sourceProperties) => + QueueChunkToChannelAsync(() => CompleteTransferAsync(sourceProperties)); + internal async Task CompleteTransferAsync(StorageResourceItemProperties sourceProperties) { CancellationHelper.ThrowIfCancellationRequested(_cancellationToken); @@ -469,36 +441,40 @@ await _destinationResource.CompleteTransferAsync( cancellationToken: _cancellationToken).ConfigureAwait(false); // Dispose the handlers - DisposeHandlers(); + await DisposeHandlersAsync().ConfigureAwait(false); // Set completion status to completed await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); } private async Task QueueStageBlockRequests( - List<(long Offset, long Size)> rangeList, + IEnumerable<(long Offset, long Size)> ranges, long completeLength, StorageResourceItemProperties sourceProperties) { _queueingTasks = true; - // Partition the stream into individual blocks - foreach ((long Offset, long Length) block in rangeList) + try { - if (_cancellationToken.IsCancellationRequested) + // Partition the stream into individual blocks + foreach ((long Offset, long Length) block in ranges) { - break; + CancellationHelper.ThrowIfCancellationRequested(_cancellationToken); + + // Queue partitioned block task + await QueueStageBlockRequest( + block.Offset, + block.Length, + completeLength, + sourceProperties).ConfigureAwait(false); } - - // Queue partitioned block task - await QueueStageBlockRequest( - block.Offset, - block.Length, - completeLength, - sourceProperties).ConfigureAwait(false); + _queueingTasks = false; + await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); + } + catch (Exception ex) + { + _queueingTasks = false; + await InvokeFailedArgAsync(ex).ConfigureAwait(false); } - - _queueingTasks = false; - await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); } private Task QueueStageBlockRequest( @@ -557,21 +533,19 @@ private static async Task GetOffsetPartitionInternal( public override async Task InvokeSkippedArgAsync() { - DisposeHandlers(); await base.InvokeSkippedArgAsync().ConfigureAwait(false); } public override async Task InvokeFailedArgAsync(Exception ex) { - DisposeHandlers(); await base.InvokeFailedArgAsync(ex).ConfigureAwait(false); } - internal void DisposeHandlers() + public override async Task DisposeHandlersAsync() { if (_commitBlockHandler != default) { - _commitBlockHandler.Dispose(); + await _commitBlockHandler.DisposeAsync().ConfigureAwait(false); _commitBlockHandler = null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs index 058423f3bfbf..cf14dd706fc1 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferJobInternal.cs @@ -12,7 +12,7 @@ namespace Azure.Storage.DataMovement { - internal class TransferJobInternal : IDisposable + internal class TransferJobInternal : IAsyncDisposable { internal delegate Task CreateJobPartSingleAsync( TransferJobInternal job, @@ -97,11 +97,10 @@ internal delegate Task CreateJobPartMultiAsync( internal StorageResourceCreationPreference _creationPreference; /// - /// Considering if there's more than one job part, the transfer status will need to be set to - /// completed all job parts have been set to completed. + /// Event handler for tracking status changes in job parts. /// - public event SyncAsyncEventHandler JobPartStatusEvents; - public SyncAsyncEventHandler GetJobPartStatus() => JobPartStatusEvents; + public event SyncAsyncEventHandler JobPartStatusEvents; + public SyncAsyncEventHandler GetJobPartStatusEventHandler() => JobPartStatusEvents; /// /// If the transfer status of the job changes then the event will get added to this handler. @@ -184,7 +183,7 @@ private TransferJobInternal( _errorMode = errorHandling; _creationPreference = creationPreference; - JobPartStatusEvents += JobPartEventAsync; + JobPartStatusEvents += JobPartStatusEventAsync; TransferStatusEventHandler = statusEventHandler; TransferFailedEventHandler = failedEventHandler; TransferSkippedEventHandler = skippedEventHandler; @@ -262,17 +261,14 @@ internal TransferJobInternal( _progressTracker = new TransferProgressTracker(transferOptions?.ProgressHandlerOptions); } - public void Dispose() - { - DisposeHandlers(); - } - - public void DisposeHandlers() + public async ValueTask DisposeAsync() { if (JobPartStatusEvents != default) { - JobPartStatusEvents -= JobPartEventAsync; + JobPartStatusEvents -= JobPartStatusEventAsync; } + // This will block until all pending progress reports have gone out + await _progressTracker.DisposeAsync().ConfigureAwait(false); } /// @@ -336,6 +332,7 @@ public virtual async IAsyncEnumerable ProcessJobToJobPartAsync( yield return part; } } + DataMovementEventSource.Singleton.ResumeEnumerationComplete(_dataTransfer.Id, _jobParts.Count); bool isEnumerationComplete; try @@ -465,6 +462,7 @@ private async IAsyncEnumerable EnumerateAndCreateJobPartsAsync( } } } + DataMovementEventSource.Singleton.EnumerationComplete(_dataTransfer.Id, _jobParts.Count); } /// @@ -508,6 +506,7 @@ await TransferFailedEventHandler.RaiseAsync( ClientDiagnostics) .ConfigureAwait(false); } + _dataTransfer.TransferStatus.SetFailedItem(); } try @@ -543,11 +542,13 @@ await TransferFailedEventHandler.RaiseAsync( /// In order to properly propagate the transfer status events of each job part up /// until all job parts have completed. /// - public async Task JobPartEventAsync(TransferStatusEventArgs args) + public async Task JobPartStatusEventAsync(JobPartStatusEventArgs args) { DataTransferStatus jobPartStatus = args.TransferStatus; DataTransferState jobState = _dataTransfer._state.GetTransferStatus().State; + DataMovementEventSource.Singleton.JobPartStatus(_dataTransfer.Id, args.PartNumber, jobPartStatus); + // Keep track of paused, failed, and skipped which we will use to determine final job status // Since this is each Job Part coming in, the state of skipped or failed is mutually exclusive. if (jobPartStatus.State == DataTransferState.Paused) @@ -605,7 +606,7 @@ public async Task OnJobStateChangedAsync(DataTransferState state) if (state == DataTransferState.Completed || state == DataTransferState.Paused) { - DisposeHandlers(); + await DisposeAsync().ConfigureAwait(false); } await OnJobPartStatusChangedAsync().ConfigureAwait(false); @@ -684,11 +685,9 @@ internal async Task CheckAndUpdateStatusAsync() { await OnJobStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); } - return; } - // If there are no more pending job parts, complete the job - if (_pendingJobParts == 0) + else if (_pendingJobParts == 0) { if (_jobPartPaused) { @@ -718,9 +717,9 @@ internal HashSet GetJobPartSourceResourcePaths() return new HashSet(_jobParts.Select(x => x._sourceResource.Uri)); } - internal void IncrementJobParts() + internal async ValueTask IncrementJobParts() { - _progressTracker.IncrementQueuedFiles(); + await _progressTracker.IncrementQueuedFilesAsync(_cancellationToken).ConfigureAwait(false); } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs index 74b61c9cefce..66e07a50d4cf 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs @@ -60,9 +60,13 @@ protected TransferManager() /// Options that will apply to all transfers started by this TransferManager. public TransferManager(TransferManagerOptions options = default) : this( - ChannelProcessing.NewProcessor(parallelism: 1), - ChannelProcessing.NewProcessor(DataMovementConstants.MaxJobPartReaders), - ChannelProcessing.NewProcessor>(options?.MaximumConcurrency ?? DataMovementConstants.MaxJobChunkTasks), + ChannelProcessing.NewProcessor(readers: 1), + ChannelProcessing.NewProcessor( + readers: DataMovementConstants.Channels.MaxJobPartReaders, + capacity: DataMovementConstants.Channels.JobPartCapacity), + ChannelProcessing.NewProcessor>( + readers: options?.MaximumConcurrency ?? DataMovementConstants.Channels.MaxJobChunkReaders, + capacity: DataMovementConstants.Channels.JobChunkCapacity), new(ArrayPool.Shared, options?.ErrorHandling ?? DataTransferErrorMode.StopOnAnyFailure, new ClientDiagnostics(options?.ClientOptions ?? ClientOptions.Default)), @@ -105,7 +109,7 @@ private async Task ProcessJobAsync(TransferJobInternal job, CancellationToken ca { await foreach (JobPartInternal partItem in job.ProcessJobToJobPartAsync().ConfigureAwait(false)) { - job.IncrementJobParts(); + await job.IncrementJobParts().ConfigureAwait(false); await _partsProcessor.QueueAsync(partItem, cancellationToken).ConfigureAwait(false); } } @@ -306,14 +310,17 @@ bool TryGetStorageResourceProvider(DataTransferProperties properties, bool getSo throw Errors.NoResourceProviderFound(false, dataTransferProperties.DestinationProviderId); } + StorageResource source = await sourceProvider.FromSourceAsync(dataTransferProperties, cancellationToken).ConfigureAwait(false); + StorageResource destination = await destinationProvider.FromDestinationAsync(dataTransferProperties, cancellationToken).ConfigureAwait(false); DataTransfer dataTransfer = await BuildAndAddTransferJobAsync( - await sourceProvider.FromSourceAsync(dataTransferProperties, cancellationToken).ConfigureAwait(false), - await destinationProvider.FromDestinationAsync(dataTransferProperties, cancellationToken).ConfigureAwait(false), + source, + destination, transferOptions, dataTransferProperties.TransferId, true, cancellationToken).ConfigureAwait(false); + DataMovementEventSource.Singleton.ResumeTransfer(dataTransfer.Id, source, destination); return dataTransfer; } @@ -385,6 +392,7 @@ await _checkpointer.AddNewJobAsync( false, cancellationToken).ConfigureAwait(false); + DataMovementEventSource.Singleton.TransferQueued(transferId, sourceResource, destinationResource); return dataTransfer; } catch (Exception ex) @@ -464,17 +472,25 @@ private CancellationToken LinkCancellation(CancellationToken cancellationToken) /// Disposes. /// /// A of disposing the . - ValueTask IAsyncDisposable.DisposeAsync() + async ValueTask IAsyncDisposable.DisposeAsync() { if (!_cancellationTokenSource.IsCancellationRequested) { _cancellationTokenSource.Cancel(); } - _jobsProcessor?.Dispose(); - _partsProcessor?.Dispose(); - _chunksProcessor?.Dispose(); + if (_jobsProcessor != default) + { + await _jobsProcessor.DisposeAsync().ConfigureAwait(false); + } + if (_partsProcessor != default) + { + await _partsProcessor.DisposeAsync().ConfigureAwait(false); + } + if (_chunksProcessor != default) + { + await _chunksProcessor.DisposeAsync().ConfigureAwait(false); + } GC.SuppressFinalize(this); - return default; } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferProgressTracker.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferProgressTracker.cs index 8346a7fd2d7d..f1d45d800919 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferProgressTracker.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferProgressTracker.cs @@ -3,6 +3,8 @@ using System; using System.Threading; +using System.Threading.Channels; +using System.Threading.Tasks; namespace Azure.Storage.DataMovement { @@ -10,94 +12,127 @@ namespace Azure.Storage.DataMovement /// Internal class for tracking progress of transfers and reporting back to /// user's progress handler. /// - internal class TransferProgressTracker + internal class TransferProgressTracker : IAsyncDisposable { + private class ProgressEventArgs + { + public int CompletedChange { get; set; } = 0; + public int SkippedChange { get; set; } = 0; + public int FailedChange { get; set; } = 0; + public int InProgressChange { get; set; } = 0; + public int QueuedChange { get; set; } = 0; + public long BytesChange { get; set; } = 0; + } + private readonly ProgressHandlerOptions _options; + private IProcessor _progressProcessor; private long _completedCount = 0; private long _skippedCount = 0; private long _failedCount = 0; private long _inProgressCount = 0; private long _queuedCount = 0; private long _bytesTransferred = 0; - private object _bytesTransferredLock = new(); public TransferProgressTracker(ProgressHandlerOptions options) { _options = options; + _progressProcessor = ChannelProcessing.NewProcessor(readers: 1); + _progressProcessor.Process = ProcessProgressEvent; + } + + public async ValueTask DisposeAsync() + { + // This will close the channel and block on all pending items being processed + await _progressProcessor.DisposeAsync().ConfigureAwait(false); } - /// - /// Atomically increments completed files, decrements in-progress files and reports progress. - /// - public void IncrementCompletedFiles() + public async ValueTask IncrementCompletedFilesAsync(CancellationToken cancellationToken) { - Interlocked.Decrement(ref _inProgressCount); - Interlocked.Increment(ref _completedCount); - _options?.ProgressHandler?.Report(GetTransferProgress()); + await QueueProgressEvent(new ProgressEventArgs() + { + InProgressChange = -1, + CompletedChange = 1, + }, + cancellationToken).ConfigureAwait(false); } - /// - /// Atomically increments skipped files, decrements in-progress files and reports progress. - /// - public void IncrementSkippedFiles() + public async ValueTask IncrementSkippedFilesAsync(CancellationToken cancellationToken) { - Interlocked.Decrement(ref _inProgressCount); - Interlocked.Increment(ref _skippedCount); - _options?.ProgressHandler?.Report(GetTransferProgress()); + await QueueProgressEvent(new ProgressEventArgs() + { + InProgressChange = -1, + SkippedChange = 1, + }, + cancellationToken).ConfigureAwait(false); } - /// - /// Atomically increments failed files, decrements in-progress files and reports progress. - /// - public void IncrementFailedFiles() + public async ValueTask IncrementFailedFilesAsync(CancellationToken cancellationToken) { - Interlocked.Decrement(ref _inProgressCount); - Interlocked.Increment(ref _failedCount); - _options?.ProgressHandler?.Report(GetTransferProgress()); + await QueueProgressEvent(new ProgressEventArgs() + { + InProgressChange = -1, + FailedChange = 1, + }, + cancellationToken).ConfigureAwait(false); } - /// - /// Atomically increments in-progress files, decrements queued files and reports progress. - /// - public void IncrementInProgressFiles() + public async ValueTask IncrementInProgressFilesAsync(CancellationToken cancellationToken) { - Interlocked.Decrement(ref _queuedCount); - Interlocked.Increment(ref _inProgressCount); - _options?.ProgressHandler?.Report(GetTransferProgress()); + await QueueProgressEvent(new ProgressEventArgs() + { + QueuedChange = -1, + InProgressChange = 1, + }, + cancellationToken).ConfigureAwait(false); } - /// - /// Atomically increments queued files and reports progress. - /// - public void IncrementQueuedFiles() + public async ValueTask IncrementQueuedFilesAsync(CancellationToken cancellationToken) { - Interlocked.Increment(ref _queuedCount); - _options?.ProgressHandler?.Report(GetTransferProgress()); + await QueueProgressEvent(new ProgressEventArgs() + { + QueuedChange = 1, + }, + cancellationToken).ConfigureAwait(false); } - /// - /// Increments the number of bytes transferred by the given amount and reports progress. - /// - /// - public void IncrementBytesTransferred(long bytesTransferred) + public async ValueTask IncrementBytesTransferred(long bytesTransferred, CancellationToken cancellationToken) { - if (_options != default) + if (_options?.TrackBytesTransferred == true) { - if ((bool)(_options?.TrackBytesTransferred)) + await QueueProgressEvent(new ProgressEventArgs() { - lock (_bytesTransferredLock) - { - _bytesTransferred += bytesTransferred; - _options?.ProgressHandler?.Report(GetTransferProgress()); - } - } + BytesChange = bytesTransferred, + }, + cancellationToken).ConfigureAwait(false); + } + } + + private async ValueTask QueueProgressEvent(ProgressEventArgs args, CancellationToken cancellationToken) + { + try + { + await _progressProcessor.QueueAsync(args, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) when (ex is ChannelClosedException || ex is OperationCanceledException) + { + // The only time we should get these exceptions is if the job is being + // disposed, either by pause or failure, in which case its safe to ignore these. } } - private DataTransferProgress GetTransferProgress() + private Task ProcessProgressEvent(ProgressEventArgs args, CancellationToken cancellationToken = default) { - return new DataTransferProgress() + // Only ever one thread processing at a time so its safe to update these + // Changes can be negative + _completedCount += args.CompletedChange; + _skippedCount += args.SkippedChange; + _failedCount += args.FailedChange; + _inProgressCount += args.InProgressChange; + _queuedCount += args.QueuedChange; + _bytesTransferred += args.BytesChange; + + DataTransferProgress progress = new() { CompletedCount = _completedCount, SkippedCount = _skippedCount, @@ -106,6 +141,9 @@ private DataTransferProgress GetTransferProgress() QueuedCount = _queuedCount, BytesTransferred = _options.TrackBytesTransferred ? _bytesTransferred : null }; + _options?.ProgressHandler?.Report(progress); + + return Task.CompletedTask; } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/src/UriToStreamJobPart.cs b/sdk/storage/Azure.Storage.DataMovement/src/UriToStreamJobPart.cs index d159d85781c3..ae145a9058c9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/UriToStreamJobPart.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/UriToStreamJobPart.cs @@ -11,7 +11,7 @@ namespace Azure.Storage.DataMovement { - internal class UriToStreamJobPart : JobPartInternal, IDisposable + internal class UriToStreamJobPart : JobPartInternal, IAsyncDisposable { public delegate Task CommitBlockTaskInternal(CancellationToken cancellationToken); public CommitBlockTaskInternal CommitBlockTask { get; internal set; } @@ -39,7 +39,7 @@ private UriToStreamJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -68,7 +68,7 @@ private UriToStreamJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -103,7 +103,7 @@ private UriToStreamJobPart( checkpointer: job._checkpointer, progressTracker: job._progressTracker, arrayPool: job.UploadArrayPool, - jobPartEventHandler: job.GetJobPartStatus(), + jobPartEventHandler: job.GetJobPartStatusEventHandler(), statusEventHandler: job.TransferStatusEventHandler, failedEventHandler: job.TransferFailedEventHandler, skippedEventHandler: job.TransferSkippedEventHandler, @@ -115,9 +115,9 @@ private UriToStreamJobPart( { } - public void Dispose() + public async ValueTask DisposeAsync() { - DisposeHandlers(); + await DisposeHandlersAsync().ConfigureAwait(false); } /// @@ -198,6 +198,11 @@ public override async Task ProcessPartToChunkAsync() // does not require a length to be created. try { + // Continue only if job is in progress + if (!await CheckTransferStateBeforeRunning().ConfigureAwait(false)) + { + return; + } await OnTransferStateChangedAsync(DataTransferState.InProgress).ConfigureAwait(false); if (!_sourceResource.Length.HasValue) { @@ -258,7 +263,7 @@ internal async Task UnknownDownloadInternal() initial: true).ConfigureAwait(false); if (successfulInitialCopy) { - ReportBytesWritten(initialLength.Value); + await ReportBytesWrittenAsync(initialLength.Value).ConfigureAwait(false); if (totalLength == initialLength) { // Complete download since it was done in one go @@ -311,7 +316,7 @@ internal async Task LengthKnownDownloadInternal() initial: true).ConfigureAwait(false); if (successfulCopy) { - ReportBytesWritten(downloadLength); + await ReportBytesWrittenAsync(downloadLength).ConfigureAwait(false); // Queue the work to end the download await QueueCompleteFileDownload().ConfigureAwait(false); } @@ -336,23 +341,29 @@ private async Task QueueChunksToChannel(long initialLength, long totalLength) // Fill the queue with tasks to download each of the remaining // ranges in the file _queueingTasks = true; - foreach (HttpRange httpRange in GetRanges(initialLength, totalLength, _transferChunkSize)) + try { - if (_cancellationToken.IsCancellationRequested) + int chunkCount = 0; + foreach (HttpRange httpRange in GetRanges(initialLength, totalLength, _transferChunkSize)) { - break; - } + CancellationHelper.ThrowIfCancellationRequested(_cancellationToken); - // Add the next Task (which will start the download but - // return before it's completed downloading) - await QueueChunkToChannelAsync( - async () => - await DownloadStreamingInternal(range: httpRange).ConfigureAwait(false)) - .ConfigureAwait(false); + // Add the next Task (which will start the download but + // return before it's completed downloading) + await QueueChunkToChannelAsync( + async () => + await DownloadStreamingInternal(range: httpRange).ConfigureAwait(false)) + .ConfigureAwait(false); + chunkCount++; + } + _queueingTasks = false; + await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); + } + catch (Exception ex) + { + _queueingTasks = false; + await InvokeFailedArgAsync(ex).ConfigureAwait(false); } - - _queueingTasks = false; - await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false); } internal async Task CompleteFileDownload() @@ -367,7 +378,7 @@ await _destinationResource.CompleteTransferAsync( cancellationToken: _cancellationToken).ConfigureAwait(false); // Dispose the handlers - DisposeHandlers(); + await DisposeHandlersAsync().ConfigureAwait(false); // Update the transfer status await OnTransferStateChangedAsync(DataTransferState.Completed).ConfigureAwait(false); @@ -405,10 +416,13 @@ await dataStream.CopyToAsync( content.Position = 0; // The chunk handler may have been disposed in failure case - _downloadChunkHandler?.QueueChunk(new QueueDownloadChunkArgs( - offset: range.Offset, - length: (long)range.Length, - content: content)); + if (_downloadChunkHandler != null) + { + await _downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( + offset: range.Offset, + length: (long)range.Length, + content: content)).ConfigureAwait(false); + } } catch (Exception ex) { @@ -456,7 +470,7 @@ private static DownloadChunkHandler.Behaviors GetDownloadChunkHandlerBehaviors(U return new DownloadChunkHandler.Behaviors() { CopyToDestinationFile = jobPart.CopyToStreamInternal, - ReportProgressInBytes = jobPart.ReportBytesWritten, + ReportProgressInBytes = jobPart.ReportBytesWrittenAsync, InvokeFailedHandler = jobPart.InvokeFailedArgAsync, QueueCompleteFileDownload = jobPart.QueueCompleteFileDownload }; @@ -478,21 +492,19 @@ private static IEnumerable GetRanges(long initialLength, long totalLe public override async Task InvokeSkippedArgAsync() { - DisposeHandlers(); await base.InvokeSkippedArgAsync().ConfigureAwait(false); } public override async Task InvokeFailedArgAsync(Exception ex) { - DisposeHandlers(); await base.InvokeFailedArgAsync(ex).ConfigureAwait(false); } - internal void DisposeHandlers() + public override async Task DisposeHandlersAsync() { if (_downloadChunkHandler != default) { - _downloadChunkHandler.Dispose(); + await _downloadChunkHandler.DisposeAsync().ConfigureAwait(false); _downloadChunkHandler = null; } } diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/AssemblyInfo.cs b/sdk/storage/Azure.Storage.DataMovement/tests/AssemblyInfo.cs new file mode 100644 index 000000000000..2bdef50473db --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/tests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/CommitChunkHandlerTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/CommitChunkHandlerTests.cs index 116f62214d1a..40d506176b95 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/CommitChunkHandlerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/CommitChunkHandlerTests.cs @@ -10,6 +10,7 @@ using Azure.Core; using Azure.Storage.Test; using Azure.Core.Pipeline; +using System.Threading.Channels; namespace Azure.Storage.DataMovement.Tests { @@ -115,7 +116,8 @@ public CommitChunkHandlerTests() { } private Mock GetReportProgressInBytesTask() { var mock = new Mock(MockBehavior.Strict); - mock.Setup(del => del(It.IsNotNull())); + mock.Setup(del => del(It.IsNotNull())) + .Returns(new ValueTask()); return mock; } @@ -166,20 +168,14 @@ public async Task OneChunkTransfer(long blockSize) InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Unordered, - ClientDiagnostics, default, CancellationToken.None); // Make one chunk that would meet the expected length - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); VerifyDelegateInvocations( behaviors: mockCommitChunkBehaviors, @@ -209,20 +205,14 @@ public async Task ParallelChunkTransfer(long blockSize) InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Unordered, - ClientDiagnostics, default, CancellationToken.None); // Make one chunk that would update the bytes but not cause a commit block list to occur - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); // Assert VerifyDelegateInvocations( @@ -233,15 +223,10 @@ await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( expectedCompleteFileCount: 0); // Now add the last block to meet the required commited block amount. - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize * 2, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); // Assert VerifyDelegateInvocations( @@ -272,20 +257,14 @@ public async Task ParallelChunkTransfer_ExceedError(long blockSize) InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Unordered, - ClientDiagnostics, default, CancellationToken.None); // Make one chunk that would update the bytes that would cause the bytes to exceed the expected amount - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize * 2, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize * 2)); // Assert VerifyDelegateInvocations( @@ -318,7 +297,6 @@ public async Task ParallelChunkTransfer_MultipleProcesses(long blockSize, int ta InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Unordered, - ClientDiagnostics, default, CancellationToken.None); @@ -326,15 +304,10 @@ public async Task ParallelChunkTransfer_MultipleProcesses(long blockSize, int ta for (int i = 0; i < taskSize; i++) { - Task task = commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + Task task = Task.Run(async () => await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize))); runningTasks.Add(task); } @@ -371,20 +344,14 @@ public async Task SequentialChunkTransfer(long blockSize) InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Sequential, - ClientDiagnostics, default, CancellationToken.None); // Make one chunk that would update the bytes but not cause a commit block list to occur - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); // Assert VerifyDelegateInvocations( @@ -395,15 +362,10 @@ await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( expectedCompleteFileCount: 0); // Now add the last block to meet the required commited block amount. - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize * 2, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); // Assert VerifyDelegateInvocations( @@ -434,20 +396,14 @@ public async Task SequentialChunkTransfer_ExceedError(long blockSize) InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Sequential, - ClientDiagnostics, default, CancellationToken.None); // Make one chunk that would update the bytes that would cause the bytes to exceed the expected amount - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize * 2, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize * 2)); // Assert VerifyDelegateInvocations( @@ -479,19 +435,13 @@ public async Task GetPutBlockTask_ExpectedFailure() InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, transferOrder: DataTransferOrder.Sequential, - ClientDiagnostics, default, CancellationToken.None); // Act - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( offset: blockSize, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); // Assert VerifyDelegateInvocations( @@ -522,19 +472,13 @@ public async Task GetCommitBlockTask_ExpectedFailure() InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, transferOrder: DataTransferOrder.Unordered, - ClientDiagnostics, default, CancellationToken.None); // Act - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( offset: 0, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); // Assert VerifyDelegateInvocations( @@ -546,7 +490,7 @@ await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( } [Test] - public async Task DisposedEventHandler() + public async Task DisposeAsync() { // Arrange - Create CommitChunkHandler then Dispose it so the event handler is disposed MockCommitChunkBehaviors mockCommitChunkBehaviors = GetCommitChunkBehaviors(); @@ -564,15 +508,14 @@ public async Task DisposedEventHandler() InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, transferOrder: DataTransferOrder.Unordered, - ClientDiagnostics, default, CancellationToken.None); // Act - commitBlockHandler.Dispose(); + await commitBlockHandler.DisposeAsync(); - // Assert - Do not throw when trying to invoke the event handler when disposed - await commitBlockHandler.InvokeEvent(default); + Assert.ThrowsAsync(async () => + await commitBlockHandler.QueueChunkAsync(default)); VerifyDelegateInvocations( behaviors: mockCommitChunkBehaviors, @@ -618,20 +561,14 @@ public async Task CompleteTransferTask_Properties() InvokeFailedHandler = mockCommitChunkBehaviors.InvokeFailedEventHandlerTask.Object, }, DataTransferOrder.Unordered, - ClientDiagnostics, properties, CancellationToken.None); // Make one chunk that would meet the expected length - await commitBlockHandler.InvokeEvent(new StageChunkEventArgs( - transferId: "fake-id", - success: true, + await commitBlockHandler.QueueChunkAsync(new QueueStageChunkArgs( // Before commit block is called, one block chunk has already been added when creating the destination offset: blockSize, - bytesTransferred: blockSize, - exception: default, - isRunningSynchronously: false, - cancellationToken: CancellationToken.None)); + bytesTransferred: blockSize)); VerifyDelegateInvocations( behaviors: mockCommitChunkBehaviors, diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/DownloadChunkHandlerTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/DownloadChunkHandlerTests.cs index 43e79dbbe6c0..5fa959d64196 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/DownloadChunkHandlerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/DownloadChunkHandlerTests.cs @@ -10,6 +10,7 @@ using System.Threading; using Azure.Core; using Azure.Storage.Tests.Shared; +using System.Threading.Channels; namespace Azure.Storage.DataMovement.Tests { @@ -106,7 +107,8 @@ private void VerifyDelegateInvocations( private Mock GetReportProgressInBytesTask() { var mock = new Mock(MockBehavior.Strict); - mock.Setup(del => del(It.IsNotNull())); + mock.Setup(del => del(It.IsNotNull())) + .Returns(new ValueTask()); return mock; } @@ -156,11 +158,11 @@ private MockDownloadChunkBehaviors GetMockDownloadChunkBehaviors() [TestCase(Constants.KB)] [TestCase(Constants.MB)] [TestCase(4 * Constants.MB)] - public void OneChunkTransfer(long blockSize) + public async Task OneChunkTransfer(long blockSize) { // Arrange - Set up tasks MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); - using var downloadChunkHandler = new DownloadChunkHandler( + await using var downloadChunkHandler = new DownloadChunkHandler( currentTransferred: 0, expectedLength: blockSize, new DownloadChunkHandler.Behaviors @@ -175,7 +177,7 @@ public void OneChunkTransfer(long blockSize) PredictableStream content = new PredictableStream(blockSize); // Act - Make one chunk that would meet the expected length - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: 0, length: blockSize, content: content)); @@ -192,12 +194,12 @@ public void OneChunkTransfer(long blockSize) [Test] [TestCase(512)] [TestCase(Constants.KB)] - public void MultipleChunkTransfer(long blockSize) + public async Task MultipleChunkTransfer(long blockSize) { // Arrange - Set up tasks MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); long expectedLength = blockSize * 2; - using var downloadChunkHandler = new DownloadChunkHandler( + await using var downloadChunkHandler = new DownloadChunkHandler( currentTransferred: 0, expectedLength: expectedLength, behaviors: new DownloadChunkHandler.Behaviors @@ -212,7 +214,7 @@ public void MultipleChunkTransfer(long blockSize) PredictableStream content = new PredictableStream(blockSize); // Act - First chunk - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: 0, length: blockSize, content: content)); @@ -228,7 +230,7 @@ public void MultipleChunkTransfer(long blockSize) PredictableStream content2 = new PredictableStream(blockSize); // Act - Second/final chunk - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: blockSize, length: blockSize, content: content2)); @@ -245,13 +247,13 @@ public void MultipleChunkTransfer(long blockSize) [Test] [TestCase(512)] [TestCase(Constants.KB)] - public void MultipleChunkTransfer_EarlyChunks(long blockSize) + public async Task MultipleChunkTransfer_EarlyChunks(long blockSize) { // Arrange - Set up tasks MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); long expectedLength = blockSize * 2; - using var downloadChunkHandler = new DownloadChunkHandler( + await using var downloadChunkHandler = new DownloadChunkHandler( currentTransferred: 0, expectedLength: expectedLength, behaviors: new DownloadChunkHandler.Behaviors @@ -266,7 +268,7 @@ public void MultipleChunkTransfer_EarlyChunks(long blockSize) PredictableStream content = new PredictableStream(blockSize); // Act - The second chunk returns first - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: blockSize, length: blockSize, content: content)); @@ -280,7 +282,7 @@ public void MultipleChunkTransfer_EarlyChunks(long blockSize) expectedCompleteFileCount: 0); // Act - The first chunk is then returned - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: 0, length: blockSize, content: content)); @@ -305,7 +307,7 @@ public async Task MultipleChunkTransfer_MultipleProcesses(long blockSize, int ta MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); long expectedLength = blockSize * taskSize; - using var downloadChunkHandler = new DownloadChunkHandler( + await using var downloadChunkHandler = new DownloadChunkHandler( currentTransferred: 0, expectedLength: expectedLength, behaviors: new DownloadChunkHandler.Behaviors @@ -325,7 +327,7 @@ public async Task MultipleChunkTransfer_MultipleProcesses(long blockSize, int ta PredictableStream content = new PredictableStream(blockSize); long offset = i * blockSize; - Task task = Task.Run(() => downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + Task task = Task.Run(async () => await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: offset, length: blockSize, content: content))); @@ -346,7 +348,7 @@ public async Task MultipleChunkTransfer_MultipleProcesses(long blockSize, int ta } [Test] - public void GetCopyToDestinationFileTask_ExpectedFailure() + public async Task GetCopyToDestinationFileTask_ExpectedFailure() { // Arrange MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); @@ -369,7 +371,7 @@ public void GetCopyToDestinationFileTask_ExpectedFailure() PredictableStream content = new PredictableStream(blockSize); // Act - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: 0, length: blockSize, content: content)); @@ -384,7 +386,7 @@ public void GetCopyToDestinationFileTask_ExpectedFailure() } [Test] - public void QueueCompleteFileDownloadTask_ExpectedFailure() + public async Task QueueCompleteFileDownloadTask_ExpectedFailure() { // Arrange MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); @@ -406,7 +408,7 @@ public void QueueCompleteFileDownloadTask_ExpectedFailure() PredictableStream content = new PredictableStream(blockSize); // Act - downloadChunkHandler.QueueChunk(new QueueDownloadChunkArgs( + await downloadChunkHandler.QueueChunkAsync(new QueueDownloadChunkArgs( offset: 0, length: blockSize, content: content)); @@ -421,7 +423,7 @@ public void QueueCompleteFileDownloadTask_ExpectedFailure() } [Test] - public void DisposedEventHandler() + public async Task DisposedEventHandler() { // Arrange - Create DownloadChunkHandler then Dispose it so the event handler is disposed MockDownloadChunkBehaviors mockBehaviors = GetMockDownloadChunkBehaviors(); @@ -441,8 +443,10 @@ public void DisposedEventHandler() cancellationToken: CancellationToken.None); // Act - downloadChunkHandler.Dispose(); - downloadChunkHandler.QueueChunk(default); + await downloadChunkHandler.DisposeAsync(); + + Assert.ThrowsAsync(async () => + await downloadChunkHandler.QueueChunkAsync(default)); VerifyDelegateInvocations( behaviors: mockBehaviors, diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs new file mode 100644 index 000000000000..10b8be2cf0ed --- /dev/null +++ b/sdk/storage/Azure.Storage.DataMovement/tests/MockStorageResourceProvider.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Storage.Common; + +namespace Azure.Storage.DataMovement.Tests +{ + /// + /// Provider for a configured for mocking. + /// + internal class MockStorageResourceProvider : StorageResourceProvider + { + /// + protected internal override string ProviderId => "mock"; + + internal MemoryTransferCheckpointer checkpointer; + + /// + /// Default constructor. + /// + internal MockStorageResourceProvider( + MemoryTransferCheckpointer checkpter) + { + checkpointer = checkpter; + } + + /// + protected internal override Task FromSourceAsync(DataTransferProperties properties, CancellationToken cancellationToken) + => Task.FromResult(FromTransferProperties(properties, getSource: true)); + + /// + protected internal override Task FromDestinationAsync(DataTransferProperties properties, CancellationToken cancellationToken) + => Task.FromResult(FromTransferProperties(properties, getSource: false)); + + private StorageResource FromTransferProperties(DataTransferProperties properties, bool getSource) + { + Argument.AssertNotNull(properties, nameof(properties)); + + string transferId = properties.TransferId; + if (!checkpointer.Jobs.TryGetValue(transferId, out var job)) + { + throw new Exception("Job does not exist."); + } + + if (getSource) + { + return job.Source; + } + else + { + return job.Destination; + } + } + } +} diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Models/StepProcessor.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Models/StepProcessor.cs index 8c60f2da92b8..408ddbd88db9 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Models/StepProcessor.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Models/StepProcessor.cs @@ -29,6 +29,8 @@ public ValueTask QueueAsync(T item, CancellationToken cancellationToken = defaul return new(Task.CompletedTask); } + public bool TryComplete() => true; + /// /// Attmpts to read an item from internal queue, then completes /// a call to on it. @@ -70,7 +72,9 @@ public async ValueTask StepAll(CancellationToken cancellationToken = defaul return steps; } - public void Dispose() - { } + public ValueTask DisposeAsync() + { + return new ValueTask(); + } } } diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/PauseResumeTransferMockedTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/PauseResumeTransferMockedTests.cs index ddbf3d50233c..08313bc4713c 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/PauseResumeTransferMockedTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/PauseResumeTransferMockedTests.cs @@ -30,7 +30,7 @@ private Dictionary GetJobsStateCount(List // populate jobsStateCount foreach (DataTransfer transfer in transfers) { - var job = checkpointer.Jobs[transfer.Id]; + Job job = checkpointer.Jobs[transfer.Id]; ++jobsStateCount[job.Status.State]; } return jobsStateCount; @@ -47,7 +47,7 @@ private Dictionary GetJobPartsStateCount(List GetJobPartsStateCount(List transfers, MemoryTransferCheckpointer checkpointer) + { + return transfers.Count(transfer => checkpointer.Jobs[transfer.Id].EnumerationComplete); + } + + private void AssertJobProcessingSuccessful(int numJobs, List transfers, MemoryTransferCheckpointer checkpointer) + { + int inProgressJobsCount1 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.InProgress]; + int enumerationCompleteCount1 = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(enumerationCompleteCount1, Is.EqualTo(numJobs), "Error: all jobs should have finished enumerating"); + Assert.That(inProgressJobsCount1, Is.EqualTo(numJobs), "Error: all jobs should be in InProgress state after Job Processing"); + } + + private void AssertPartProcessingSuccessful(int numJobParts, List transfers, MemoryTransferCheckpointer checkpointer) + { + int inProgressJobPartsCount = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.InProgress]; + Assert.That(inProgressJobPartsCount, Is.EqualTo(numJobParts), "Error: all job parts should be in InProgress state after Part Processing"); + } + + private void AssertAllJobsAndPartsCompleted(int numJobs, int numJobParts, List transfers, MemoryTransferCheckpointer checkpointer) + { + int completedJobsCount = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Completed]; + int completedPartsCount = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Completed]; + Assert.That(completedJobsCount, Is.EqualTo(numJobs), "Error in transitioning all jobs to Completed state"); + Assert.That(completedPartsCount, Is.EqualTo(numJobParts), "Error in transitioning all job parts to Completed state"); + foreach (DataTransfer transfer in transfers) + { + Job job = checkpointer.Jobs[transfer.Id]; + Assert.That(job.Status.State, Is.EqualTo(DataTransferState.Completed), "Error in transitioning all jobs to Completed state"); + foreach (var jobPart in job.Parts) + { + Assert.That(jobPart.Value.Status.State, Is.EqualTo(DataTransferState.Completed), "Error in transitioning all job parts to Completed state"); + } + } + } + + private async Task AssertResumeTransfer( + int numJobs, + int numJobParts, + int numChunks, + int chunksPerPart, + List resumedTransfers, + MemoryTransferCheckpointer checkpointer, + StepProcessor jobsProcessor, + StepProcessor partsProcessor, + StepProcessor> chunksProcessor, + DataTransferState initialJobState = DataTransferState.Paused) + { + await Task.Delay(50); + int initialJobStateCount = GetJobsStateCount(resumedTransfers, checkpointer)[initialJobState]; + Assert.That(initialJobStateCount, Is.EqualTo(numJobs)); + + // process jobs on resume + Assert.That(await jobsProcessor.StepAll(), Is.EqualTo(numJobs), "Error job processing on resume"); + + await Task.Delay(50); + AssertJobProcessingSuccessful(numJobs, resumedTransfers, checkpointer); + + // process job parts on resume + Assert.That(await partsProcessor.StepAll(), Is.EqualTo(numJobParts), "Error job part processing on resume"); + + await Task.Delay(50); + AssertPartProcessingSuccessful(numJobParts, resumedTransfers, checkpointer); + + // process chunks on resume + int chunksStepped = await chunksProcessor.StepAll(); + // Check if all chunks stepped through + if (chunksPerPart > 1) + { + // Multichunk transfer sends a completion chunk after all the other chunks stepped through. + await Task.Delay(50); + Assert.That(await chunksProcessor.StepAll() + chunksStepped, Is.EqualTo(numChunks + numJobParts)); + } + else + { + Assert.That(chunksStepped, Is.EqualTo(numChunks)); + } + AssertAllJobsAndPartsCompleted(numJobs, numJobParts, resumedTransfers, checkpointer); + } + + private (TransferManager TransferManager, StepProcessor JobProcessor, StepProcessor PartProcessor, StepProcessor> ChunkProcessor) SimulateDisaster( + MemoryTransferCheckpointer checkpointer, + ref TransferManager transferManager, + ref StepProcessor jobsProcessor, + ref StepProcessor partsProcessor, + ref StepProcessor> chunksProcessor) + { + // Remove references from memory + transferManager = null; + jobsProcessor = null; + partsProcessor = null; + chunksProcessor = null; + + // Force garbage collection + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + + // Re-create everything + (var jobsProcessor2, var partsProcessor2, var chunksProcessor2) = StepProcessors(); + JobBuilder jobBuilder2 = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); + List resumeProviders2 = new() { new MockStorageResourceProvider(checkpointer) }; + TransferManager transferManager2 = new( + jobsProcessor2, + partsProcessor2, + chunksProcessor2, + jobBuilder2, + checkpointer, + resumeProviders2); + + return (transferManager2, jobsProcessor2, partsProcessor2, chunksProcessor2); + } + [Test] [Combinatorial] - public async Task PauseDuringJobProcessing_ItemTransfer( + public async Task PauseResumeDuringJobProcessing_ItemTransfer( [Values(2, 6)] int items, [Values(333, 500, 1024)] int itemSize, [Values(333, 1024)] int chunkSize, @@ -69,7 +182,7 @@ public async Task PauseDuringJobProcessing_ItemTransfer( int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); // TODO: below should be only `items * chunksPerPart` but can't in some cases due to // a bug in how work items are processed on multipart uploads. - int expectedChunksInQueue = Math.Max(chunksPerPart - 1, 1) * items; + int numChunks = Math.Max(chunksPerPart - 1, 1) * items; Uri srcUri = new("file:///foo/bar"); Uri dstUri = new("https://example.com/fizz/buzz"); @@ -88,13 +201,15 @@ public async Task PauseDuringJobProcessing_ItemTransfer( return (Source: srcResource, Destination: dstResource); }).ToList(); + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, checkpointer, - default); + resumeProviders); List transfers = new(); @@ -145,6 +260,7 @@ public async Task PauseDuringJobProcessing_ItemTransfer( int pausedJobsCount = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; int queuedPartsCount = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Queued]; int jobPartsCreatedCount = transfers.Sum(transfer => checkpointer.Jobs[transfer.Id].Parts.Count); + int enumerationCompleteCount = GetEnumerationCompleteCount(transfers, checkpointer); // Assert that we properly paused for PauseProcessHalfway & PauseProcessStart if (pauseLocation == PauseLocation.PauseProcessHalfway) @@ -153,6 +269,7 @@ public async Task PauseDuringJobProcessing_ItemTransfer( Assert.That(queuedPartsCount, Is.EqualTo(items / 2), "Error in Pausing half"); Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(items / 2), "Error in Pausing half"); Assert.That(jobPartsCreatedCount, Is.EqualTo(items / 2), "Error in Pausing half"); + Assert.That(enumerationCompleteCount, Is.EqualTo(items / 2), "Error: half of the jobs should have finished enumerating"); } else { @@ -160,7 +277,7 @@ public async Task PauseDuringJobProcessing_ItemTransfer( Assert.That(queuedPartsCount, Is.EqualTo(0), "Error in Pausing all"); Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(0), "Error in Pausing all"); Assert.That(jobPartsCreatedCount, Is.EqualTo(0), "Error in Pausing all"); - Assert.Pass(); + Assert.That(enumerationCompleteCount, Is.EqualTo(0), "Error: none of the jobs should have finished enumerating"); } // At this point, we are continuing with the leftovers from PauseProcessHalfway @@ -168,17 +285,29 @@ public async Task PauseDuringJobProcessing_ItemTransfer( await partsProcessor.StepAll(); await Task.Delay(50); - int pausedJobsCount2 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; - int pausedPartsCount2 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; - Assert.That(pausedJobsCount2, Is.EqualTo(items), "Error in transitioning all jobs to Paused state"); - // only half of the job part checkpointers are created in PauseProcessHalfway so only half will be in Paused state - Assert.That(pausedPartsCount2, Is.EqualTo(items / 2), "Error in transitioning all created job parts to Paused state"); - Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Error: no items should proceed to chunking"); + if (pauseLocation == PauseLocation.PauseProcessHalfway) + { + int pausedJobsCount2 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + int pausedPartsCount2 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + Assert.That(pausedJobsCount2, Is.EqualTo(items), "Error in transitioning all jobs to Paused state"); + // only half of the job part checkpointers are created in PauseProcessHalfway so only half will be in Paused state + Assert.That(pausedPartsCount2, Is.EqualTo(items / 2), "Error in transitioning all created job parts to Paused state"); + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Error: no items should proceed to chunking"); + } + + // START RESUME TRANSFERS + List resumedTransfers = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + await AssertResumeTransfer(items, items, numChunks, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); } [Test] [Combinatorial] - public async Task PauseDuringPartProcessing_ItemTransfer( + public async Task PauseResumeDuringPartProcessing_ItemTransfer( [Values(2, 6)] int items, [Values(333, 500, 1024)] int itemSize, [Values(333, 1024)] int chunkSize, @@ -207,13 +336,15 @@ public async Task PauseDuringPartProcessing_ItemTransfer( return (Source: srcResource, Destination: dstResource); }).ToList(); + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, checkpointer, - default); + resumeProviders); List transfers = new(); @@ -250,6 +381,9 @@ public async Task PauseDuringPartProcessing_ItemTransfer( Assert.That(partsDict.First().Value.Status.State, Is.EqualTo(DataTransferState.Queued), "Error during Job part file creation."); } + int enumerationCompleteCount = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(enumerationCompleteCount, Is.EqualTo(items), "Error: all jobs should have finished enumerating"); + // Setup PauseProcessHalfway & PauseProcessStart before issuing pause if (pauseLocation == PauseLocation.PauseProcessHalfway) { @@ -300,11 +434,16 @@ public async Task PauseDuringPartProcessing_ItemTransfer( int pausedPartsCount2 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; Assert.That(pausedJobsCount2, Is.EqualTo(items), "Error in transitioning all jobs to Paused state"); Assert.That(pausedPartsCount2, Is.EqualTo(items), "Error in transitioning all job parts to Paused state"); + + // START RESUME TRANSFERS + List resumedTransfers = await transferManager.ResumeAllTransfersAsync(); + + await AssertResumeTransfer(items, items, numChunks, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); } [Test] [Combinatorial] - public async Task PauseDuringChunkProcessing_ItemTransfer( + public async Task PauseResumeDuringChunkProcessing_ItemTransfer( [Values(2, 6)] int items, [Values(1024)] int itemSize, [Values(1024)] int chunkSize, @@ -333,13 +472,15 @@ public async Task PauseDuringChunkProcessing_ItemTransfer( return (Source: srcResource, Destination: dstResource); }).ToList(); + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, checkpointer, - default); + resumeProviders); List transfers = new(); @@ -376,9 +517,18 @@ public async Task PauseDuringChunkProcessing_ItemTransfer( Assert.That(partsDict.First().Value.Status.State, Is.EqualTo(DataTransferState.Queued), "Error during Job part file creation."); } + int enumerationCompleteCount = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(enumerationCompleteCount, Is.EqualTo(items), "Error: all jobs should have finished enumerating"); + // Process parts Assert.That(await partsProcessor.StepAll(), Is.EqualTo(items), "Error in part processing"); + foreach (DataTransfer transfer in transfers) + { + var partsDict = checkpointer.Jobs[transfer.Id].Parts; + Assert.That(partsDict.First().Value.Status.State, Is.EqualTo(DataTransferState.InProgress), "Error transitioning Job Part to InProgress"); + } + // Setup PauseProcessHalfway & PauseProcessStart before issuing pause if (pauseLocation == PauseLocation.PauseProcessHalfway) { @@ -435,11 +585,23 @@ public async Task PauseDuringChunkProcessing_ItemTransfer( Assert.That(pausedPartsCount, Is.EqualTo(items), "Error in Pausing all"); Assert.That(completedPartsCount, Is.EqualTo(0), "Error in Pausing all"); } + + // START RESUME TRANSFERS + List resumedTransfers = await transferManager.ResumeAllTransfersAsync(); + + if (pauseLocation == PauseLocation.PauseProcessHalfway) + { + await AssertResumeTransfer(items / 2, items / 2, numChunks / 2, chunksPerPart / 2, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); + } + else + { + await AssertResumeTransfer(items, items, numChunks, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); + } } [Test] [Combinatorial] - public async Task PauseDuringJobProcessing_ContainerTransfer( + public async Task PauseResumeDuringJobProcessing_ContainerTransfer( [Values(2, 6)] int numJobs, [Values(333, 500, 1024)] int itemSize, [Values(333, 1024)] int chunkSize, @@ -469,13 +631,15 @@ public async Task PauseDuringJobProcessing_ContainerTransfer( return (Source: srcResource, Destination: dstResource); }).ToList(); + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, checkpointer, - default); + resumeProviders); List transfers = new(); @@ -527,6 +691,7 @@ public async Task PauseDuringJobProcessing_ContainerTransfer( int queuedPartsCount = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Queued]; int expectedPartsCreatedCount = Enumerable.Range(1, numJobs/2).Select(GetItemCountFromContainerIndex).Sum(); int jobPartsCreatedCount = transfers.Sum(transfer => checkpointer.Jobs[transfer.Id].Parts.Count); + int enumerationCompleteCount = GetEnumerationCompleteCount(transfers, checkpointer); // Assert that we properly paused for PauseProcessHalfway & PauseProcessStart if (pauseLocation == PauseLocation.PauseProcessHalfway) @@ -535,6 +700,7 @@ public async Task PauseDuringJobProcessing_ContainerTransfer( Assert.That(queuedPartsCount, Is.EqualTo(expectedPartsCreatedCount), "Error in Pausing half"); Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(expectedPartsCreatedCount), "Error in Pausing half"); Assert.That(jobPartsCreatedCount, Is.EqualTo(expectedPartsCreatedCount), "Error in Pausing half"); + Assert.That(enumerationCompleteCount, Is.EqualTo(numJobs / 2), "Error: half of the jobs should have finished enumerating"); } else { @@ -542,7 +708,7 @@ public async Task PauseDuringJobProcessing_ContainerTransfer( Assert.That(queuedPartsCount, Is.EqualTo(0), "Error in Pausing all"); Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(0), "Error in Pausing all"); Assert.That(jobPartsCreatedCount, Is.EqualTo(0), "Error in Pausing all"); - Assert.Pass(); + Assert.That(enumerationCompleteCount, Is.EqualTo(0), "Error: none of the jobs should have finished enumerating"); } // At this point, we are continuing with the leftovers from PauseProcessStart @@ -550,16 +716,28 @@ public async Task PauseDuringJobProcessing_ContainerTransfer( await partsProcessor.StepAll(); await Task.Delay(50); - int pausedJobsCount2 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; - int pausedPartsCount2 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; - Assert.That(pausedJobsCount2, Is.EqualTo(numJobs), "Error in transitioning all jobs to Paused state"); - Assert.That(pausedPartsCount2, Is.EqualTo(expectedPartsCreatedCount), "Error in transitioning all created job parts to Paused state"); - Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Error: no items should proceed to chunking"); + if (pauseLocation == PauseLocation.PauseProcessHalfway) + { + int pausedJobsCount2 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + int pausedPartsCount2 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + Assert.That(pausedJobsCount2, Is.EqualTo(numJobs), "Error in transitioning all jobs to Paused state"); + Assert.That(pausedPartsCount2, Is.EqualTo(expectedPartsCreatedCount), "Error in transitioning all created job parts to Paused state"); + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Error: no items should proceed to chunking"); + } + + // START RESUME TRANSFERS + List resumedTransfers = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + await AssertResumeTransfer(numJobs, numJobParts, numChunks, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); } [Test] [Combinatorial] - public async Task PauseDuringPartProcessing_ContainerTransfer( + public async Task PauseResumeDuringPartProcessing_ContainerTransfer( [Values(2, 6)] int numJobs, [Values(333, 500, 1024)] int itemSize, [Values(333, 1024)] int chunkSize, @@ -589,13 +767,15 @@ public async Task PauseDuringPartProcessing_ContainerTransfer( return (Source: srcResource, Destination: dstResource); }).ToList(); + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, checkpointer, - default); + resumeProviders); List transfers = new(); @@ -635,6 +815,9 @@ public async Task PauseDuringPartProcessing_ContainerTransfer( Is.True, "Error during Job part file creation: Not all parts are in the Queued state."); } + int enumerationCompleteCount = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(enumerationCompleteCount, Is.EqualTo(numJobs), "Error: all jobs should have finished enumerating"); + // Setup PauseProcessHalfway & PauseProcessStart before issuing pause if (pauseLocation == PauseLocation.PauseProcessHalfway) { @@ -681,11 +864,16 @@ public async Task PauseDuringPartProcessing_ContainerTransfer( int pausedPartsCount2 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; Assert.That(pausedJobsCount2, Is.EqualTo(numJobs), "Error in transitioning all jobs to Paused state"); Assert.That(pausedPartsCount2, Is.EqualTo(numJobParts), "Error in transitioning all parts to Paused state"); + + // START RESUME TRANSFERS + List resumedTransfers = await transferManager.ResumeAllTransfersAsync(); + + await AssertResumeTransfer(numJobs, numJobParts, numChunks, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); } [Test] [Combinatorial] - public async Task PauseDuringChunkProcessing_ContainerTransfer( + public async Task PauseResumeDuringChunkProcessing_ContainerTransfer( [Values(2, 6)] int numJobs, [Values(1024)] int itemSize, [Values(1024)] int chunkSize, @@ -715,13 +903,15 @@ public async Task PauseDuringChunkProcessing_ContainerTransfer( return (Source: srcResource, Destination: dstResource); }).ToList(); + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, checkpointer, - default); + resumeProviders); List transfers = new(); @@ -761,9 +951,19 @@ public async Task PauseDuringChunkProcessing_ContainerTransfer( Is.True, "Error during Job part file creation: Not all parts are in the Queued state."); } + int enumerationCompleteCount = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(enumerationCompleteCount, Is.EqualTo(numJobs), "Error: all jobs should have finished enumerating"); + // Process parts Assert.That(await partsProcessor.StepAll(), Is.EqualTo(numJobParts), "Error processing job parts"); + foreach (DataTransfer transfer in transfers) + { + var partsDict = checkpointer.Jobs[transfer.Id].Parts; + Assert.That(partsDict.Values.All(part => part.Status.State == DataTransferState.InProgress), + Is.True, "Error transitioning each Job Part to InProgress"); + } + // Setup PauseProcessHalfway & PauseProcessStart before issuing pause if (pauseLocation == PauseLocation.PauseProcessHalfway) { @@ -803,9 +1003,22 @@ public async Task PauseDuringChunkProcessing_ContainerTransfer( int pausedPartsCount = partsStateCount[DataTransferState.Paused]; int completedPartsCount = partsStateCount[DataTransferState.Completed]; + int expectedAlreadyCompletedJobsCount_half = 0; + for (int i = 1, numChunksCompleted = numChunks / 2; i <= numJobParts / 2 && numChunksCompleted > 0; ++i) + { + numChunksCompleted -= i * 2; + if (numChunksCompleted >= 0) + { + ++expectedAlreadyCompletedJobsCount_half; + } + } + if (pauseLocation == PauseLocation.PauseProcessHalfway) { + int expectedPausedJobsCount = numJobs - expectedAlreadyCompletedJobsCount_half; // For this test, job parts is 1:1 with job chunks + Assert.That(pausedJobsCount, Is.EqualTo(expectedPausedJobsCount), "Error in Pausing half"); + Assert.That(completedJobsCount, Is.EqualTo(expectedAlreadyCompletedJobsCount_half), "Error in Pausing half"); Assert.That(pausedPartsCount, Is.EqualTo(numJobParts / 2), "Error in Pausing half"); Assert.That(completedPartsCount, Is.EqualTo(numJobParts / 2), "Error in Pausing half"); } @@ -816,6 +1029,673 @@ public async Task PauseDuringChunkProcessing_ContainerTransfer( Assert.That(pausedPartsCount, Is.EqualTo(numJobParts), "Error in Pausing all"); Assert.That(completedPartsCount, Is.EqualTo(0), "Error in Pausing all"); } + + // START RESUME TRANSFERS + List resumedTransfers = await transferManager.ResumeAllTransfersAsync(); + + if (pauseLocation == PauseLocation.PauseProcessHalfway) + { + int expectedJobsCount = numJobs - expectedAlreadyCompletedJobsCount_half; + int expectedPartsCount = Enumerable.Range(numJobs + 1 - expectedJobsCount, expectedJobsCount) + .Sum(i => i * 2); + await AssertResumeTransfer(expectedJobsCount, expectedPartsCount, expectedPartsCount, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); + } + else + { + await AssertResumeTransfer(numJobs, numJobParts, numChunks, chunksPerPart, resumedTransfers, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); + } + } + + [Test] + [Combinatorial] + public async Task MultiplePausesAndResumes_ItemTransfer( + [Values(2, 6)] int items, + [Values(333, 500, 1024)] int itemSize, + [Values(333, 1024)] int chunkSize) + { + int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); + // TODO: below should be only `items * chunksPerPart` but can't in some cases due to + // a bug in how work items are processed on multipart uploads. + int numChunks = Math.Max(chunksPerPart - 1, 1) * items; + + Uri srcUri = new("file:///foo/bar"); + Uri dstUri = new("https://example.com/fizz/buzz"); + + (var jobsProcessor, var partsProcessor, var chunksProcessor) = StepProcessors(); + JobBuilder jobBuilder = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); + MemoryTransferCheckpointer checkpointer = new(); + + var resources = Enumerable.Range(0, items).Select(_ => + { + Mock srcResource = new(MockBehavior.Strict); + Mock dstResource = new(MockBehavior.Strict); + + (srcResource, dstResource).BasicSetup(srcUri, dstUri, itemSize); + + return (Source: srcResource, Destination: dstResource); + }).ToList(); + + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + + await using TransferManager transferManager = new( + jobsProcessor, + partsProcessor, + chunksProcessor, + jobBuilder, + checkpointer, + resumeProviders); + + List transfers = new(); + + // queue jobs + foreach ((Mock srcResource, Mock dstResource) in resources) + { + DataTransfer transfer = await transferManager.StartTransferAsync( + srcResource.Object, + dstResource.Object, + new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + transfers.Add(transfer); + + // Assert that job plan file is created properly + Assert.That(checkpointer.Jobs.ContainsKey(transfer.Id), Is.True, "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Status.State, Is.EqualTo(DataTransferState.Queued), "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Parts.Count, Is.EqualTo(0), "Job Part files should not exist before job processing"); + } + Assert.That(checkpointer.Jobs.Count, Is.EqualTo(transfers.Count), "Error during Job plan file creation."); + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(items), "Error during initial Job queueing."); + + // Pause transfers #1 + foreach (DataTransfer transfer in transfers) + { + Task pauseTask = transferManager.PauseTransferIfRunningAsync(transfer.Id); + Assert.That(DataTransferState.Pausing, Is.EqualTo(transfer.TransferStatus.State), "Error in transitioning to Pausing state"); + } + + // Process jobs + await jobsProcessor.StepAll(); + + await Task.Delay(50); + // Assert that we properly paused + int pausedJobsCount0 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + int queuedPartsCount0 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Queued]; + int jobPartsCreatedCount0 = transfers.Sum(transfer => checkpointer.Jobs[transfer.Id].Parts.Count); + int enumerationCompleteCount0 = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(pausedJobsCount0, Is.EqualTo(items), "Error in Pausing all"); + Assert.That(queuedPartsCount0, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(jobPartsCreatedCount0, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(enumerationCompleteCount0, Is.EqualTo(0), "Error: none of the jobs should have finished enumerating"); + + // Resume transfers #1 + List resumedTransfers1 = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(items), "Error: job processing on resume #1"); + + // process jobs on resume #1 + await jobsProcessor.StepAll(); + + await Task.Delay(50); + AssertJobProcessingSuccessful(items, resumedTransfers1, checkpointer); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(items), "Error: job part processing on resume #1"); + + // Pause transfers #2 + foreach (DataTransfer transfer in resumedTransfers1) + { + Task pauseTask = transferManager.PauseTransferIfRunningAsync(transfer.Id); + Assert.That(DataTransferState.Pausing, Is.EqualTo(transfer.TransferStatus.State), "Error in transitioning to Pausing state"); + } + + // process job parts on resume #1 + await partsProcessor.StepAll(); + + await Task.Delay(50); + // Assert that we properly paused + int pausedJobsCount1 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + int pausedPartsCount1 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + Assert.That(pausedJobsCount1, Is.EqualTo(items), "Error in Pausing all"); + Assert.That(pausedPartsCount1, Is.EqualTo(items), "Error in Pausing all"); + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Error in Pausing all"); + + // Resume transfers #2 + List resumedTransfers2 = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(items), "Error: job processing on resume #2"); + + // Process jobs on resume #2 + await jobsProcessor.StepAll(); + + await Task.Delay(50); + AssertJobProcessingSuccessful(items, resumedTransfers2, checkpointer); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(items), "Error: part processing on resume #2"); + + // Process parts on resume #2 + await partsProcessor.StepAll(); + + await Task.Delay(50); + AssertPartProcessingSuccessful(items, resumedTransfers2, checkpointer); + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(numChunks), "Error: chunk processing on resume #2"); + + // Pause transfers #3 + foreach (DataTransfer transfer in resumedTransfers2) + { + Task pauseTask = transferManager.PauseTransferIfRunningAsync(transfer.Id); + Assert.That(DataTransferState.Pausing, Is.EqualTo(transfer.TransferStatus.State), "Error in transitioning to Pausing state"); + } + + // Process chunks on resume #2 + await chunksProcessor.StepAll(); + + await Task.Delay(50); + // Assert that we properly paused + var jobsStateCount2 = GetJobsStateCount(transfers, checkpointer); + int pausedJobsCount2 = jobsStateCount2[DataTransferState.Paused]; + int completedJobsCount2 = jobsStateCount2[DataTransferState.Completed]; + var partsStateCount2 = GetJobPartsStateCount(transfers, checkpointer); + int pausedPartsCount2 = partsStateCount2[DataTransferState.Paused]; + int completedPartsCount2 = partsStateCount2[DataTransferState.Completed]; + Assert.That(pausedJobsCount2, Is.EqualTo(items), "Error in Pausing all"); + Assert.That(completedJobsCount2, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(pausedPartsCount2, Is.EqualTo(items), "Error in Pausing all"); + Assert.That(completedPartsCount2, Is.EqualTo(0), "Error in Pausing all"); + + // Resume transfers #3 + List resumedTransfers3 = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + await AssertResumeTransfer(items, items, numChunks, chunksPerPart, resumedTransfers3, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); + } + + [Test] + [Combinatorial] + public async Task MultiplePausesAndResumes_ContainerTransfer( + [Values(2, 6)] int numJobs, + [Values(333, 500, 1024)] int itemSize, + [Values(333, 1024)] int chunkSize) + { + static int GetItemCountFromContainerIndex(int i) => i * 2; + + int numJobParts = Enumerable.Range(1, numJobs).Select(GetItemCountFromContainerIndex).Sum(); + int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); + // TODO: below should be only `items * chunksPerPart` but can't in some cases due to + // a bug in how work items are processed on multipart uploads. + int numChunks = Math.Max(chunksPerPart - 1, 1) * numJobParts; + + Uri srcUri = new("file:///foo/bar"); + Uri dstUri = new("https://example.com/fizz/buzz"); + + (var jobsProcessor, var partsProcessor, var chunksProcessor) = StepProcessors(); + JobBuilder jobBuilder = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); + MemoryTransferCheckpointer checkpointer = new(); + + var resources = Enumerable.Range(1, numJobs).Select(i => + { + Mock srcResource = new(MockBehavior.Strict); + Mock dstResource = new(MockBehavior.Strict); + (srcResource, dstResource).BasicSetup(srcUri, dstUri, GetItemCountFromContainerIndex(i), itemSize); + return (Source: srcResource, Destination: dstResource); + }).ToList(); + + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + + await using TransferManager transferManager = new( + jobsProcessor, + partsProcessor, + chunksProcessor, + jobBuilder, + checkpointer, + resumeProviders); + + List transfers = new(); + + // queue jobs + foreach ((Mock srcResource, Mock dstResource) in resources) + { + DataTransfer transfer = await transferManager.StartTransferAsync( + srcResource.Object, + dstResource.Object, + new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + transfers.Add(transfer); + + // Assert that job plan file is created properly + Assert.That(checkpointer.Jobs.ContainsKey(transfer.Id), Is.True, "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Status.State, Is.EqualTo(DataTransferState.Queued), "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Parts.Count, Is.EqualTo(0), "Job Part files should not exist before job processing"); + } + Assert.That(checkpointer.Jobs.Count, Is.EqualTo(transfers.Count), "Error during Job plan file creation."); + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(numJobs), "Error during initial Job queueing."); + + // Pause transfers #1 + foreach (DataTransfer transfer in transfers) + { + Task pauseTask = transferManager.PauseTransferIfRunningAsync(transfer.Id); + Assert.That(DataTransferState.Pausing, Is.EqualTo(transfer.TransferStatus.State), "Error in transitioning to Pausing state"); + } + + // Process jobs + await jobsProcessor.StepAll(); + + await Task.Delay(50); + // Assert that we properly paused + int pausedJobsCount0 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + int queuedPartsCount0 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Queued]; + int jobPartsCreatedCount0 = transfers.Sum(transfer => checkpointer.Jobs[transfer.Id].Parts.Count); + int enumerationCompleteCount0 = GetEnumerationCompleteCount(transfers, checkpointer); + Assert.That(pausedJobsCount0, Is.EqualTo(numJobs), "Error in Pausing all"); + Assert.That(queuedPartsCount0, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(jobPartsCreatedCount0, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(enumerationCompleteCount0, Is.EqualTo(0), "Error: none of the jobs should have finished enumerating"); + + // Resume transfers #1 + List resumedTransfers1 = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(numJobs), "Error: job processing on resume #1"); + + // process jobs on resume #1 + await jobsProcessor.StepAll(); + + await Task.Delay(50); + AssertJobProcessingSuccessful(numJobs, resumedTransfers1, checkpointer); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(numJobParts), "Error: job part processing on resume #1"); + + // Pause transfers #2 + foreach (DataTransfer transfer in resumedTransfers1) + { + Task pauseTask = transferManager.PauseTransferIfRunningAsync(transfer.Id); + Assert.That(DataTransferState.Pausing, Is.EqualTo(transfer.TransferStatus.State), "Error in transitioning to Pausing state"); + } + + // process job parts on resume #1 + await partsProcessor.StepAll(); + + await Task.Delay(50); + // Assert that we properly paused + int pausedJobsCount1 = GetJobsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + int pausedPartsCount1 = GetJobPartsStateCount(transfers, checkpointer)[DataTransferState.Paused]; + Assert.That(pausedJobsCount1, Is.EqualTo(numJobs), "Error in Pausing all"); + Assert.That(pausedPartsCount1, Is.EqualTo(numJobParts), "Error in Pausing all"); + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Error in Pausing all"); + + // Resume transfers #2 + List resumedTransfers2 = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(numJobs), "Error: job processing on resume #2"); + + // Process jobs on resume #2 + await jobsProcessor.StepAll(); + + await Task.Delay(50); + AssertJobProcessingSuccessful(numJobs, resumedTransfers2, checkpointer); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(numJobParts), "Error: part processing on resume #2"); + + // Process parts on resume #2 + await partsProcessor.StepAll(); + + await Task.Delay(50); + AssertPartProcessingSuccessful(numJobParts, resumedTransfers2, checkpointer); + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(numChunks), "Error: chunk processing on resume #2"); + + // Pause transfers #3 + foreach (DataTransfer transfer in resumedTransfers2) + { + Task pauseTask = transferManager.PauseTransferIfRunningAsync(transfer.Id); + Assert.That(DataTransferState.Pausing, Is.EqualTo(transfer.TransferStatus.State), "Error in transitioning to Pausing state"); + } + + // Process chunks on resume #2 + await chunksProcessor.StepAll(); + + await Task.Delay(50); + // Assert that we properly paused + var jobsStateCount2 = GetJobsStateCount(transfers, checkpointer); + int pausedJobsCount2 = jobsStateCount2[DataTransferState.Paused]; + int completedJobsCount2 = jobsStateCount2[DataTransferState.Completed]; + var partsStateCount2 = GetJobPartsStateCount(transfers, checkpointer); + int pausedPartsCount2 = partsStateCount2[DataTransferState.Paused]; + int completedPartsCount2 = partsStateCount2[DataTransferState.Completed]; + Assert.That(pausedJobsCount2, Is.EqualTo(numJobs), "Error in Pausing all"); + Assert.That(completedJobsCount2, Is.EqualTo(0), "Error in Pausing all"); + Assert.That(pausedPartsCount2, Is.EqualTo(numJobParts), "Error in Pausing all"); + Assert.That(completedPartsCount2, Is.EqualTo(0), "Error in Pausing all"); + + // Resume transfers #3 + List resumedTransfers3 = await transferManager.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + await AssertResumeTransfer(numJobs, numJobParts, numChunks, chunksPerPart, resumedTransfers3, checkpointer, jobsProcessor, partsProcessor, chunksProcessor); + } + + [Test] + [Combinatorial] + public async Task MultipleDisasterResumes_ItemTransfer( + [Values(2, 6)] int items, + [Values(333, 500, 1024)] int itemSize, + [Values(333, 1024)] int chunkSize) + { + int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); + // TODO: below should be only `items * chunksPerPart` but can't in some cases due to + // a bug in how work items are processed on multipart uploads. + int numChunks = Math.Max(chunksPerPart - 1, 1) * items; + + Uri srcUri = new("file:///foo/bar"); + Uri dstUri = new("https://example.com/fizz/buzz"); + + (var jobsProcessor0, var partsProcessor0, var chunksProcessor0) = StepProcessors(); + JobBuilder jobBuilder = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); + MemoryTransferCheckpointer checkpointer = new(); + + var resources = Enumerable.Range(0, items).Select(_ => + { + Mock srcResource = new(MockBehavior.Strict); + Mock dstResource = new(MockBehavior.Strict); + + (srcResource, dstResource).BasicSetup(srcUri, dstUri, itemSize); + + return (Source: srcResource, Destination: dstResource); + }).ToList(); + + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + + TransferManager transferManager0 = new( + jobsProcessor0, + partsProcessor0, + chunksProcessor0, + jobBuilder, + checkpointer, + resumeProviders); + + List transfers = new(); + + // queue jobs + foreach ((Mock srcResource, Mock dstResource) in resources) + { + DataTransfer transfer = await transferManager0.StartTransferAsync( + srcResource.Object, + dstResource.Object, + new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + transfers.Add(transfer); + + // Assert that job plan file is created properly + Assert.That(checkpointer.Jobs.ContainsKey(transfer.Id), Is.True, "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Status.State, Is.EqualTo(DataTransferState.Queued), "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Parts.Count, Is.EqualTo(0), "Job Part files should not exist before job processing"); + } + Assert.That(checkpointer.Jobs.Count, Is.EqualTo(transfers.Count), "Error during Job plan file creation."); + Assert.That(jobsProcessor0.ItemsInQueue, Is.EqualTo(items), "Error during initial Job queueing."); + + // Simulate Disaster #1 + await ((IAsyncDisposable)transferManager0).DisposeAsync(); + (TransferManager transferManager1, + StepProcessor jobsProcessor1, + StepProcessor partsProcessor1, + StepProcessor> chunksProcessor1) = SimulateDisaster( + checkpointer, + ref transferManager0, + ref jobsProcessor0, + ref partsProcessor0, + ref chunksProcessor0); + + // Resume transfer after Disaster #1 + List resumedTransfers1 = await transferManager1.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + await Task.Delay(50); + int queuedJobsCount = GetJobsStateCount(resumedTransfers1, checkpointer)[DataTransferState.Queued]; + Assert.That(queuedJobsCount, Is.EqualTo(items)); + + // process jobs on resume #1 + Assert.That(await jobsProcessor1.StepAll(), Is.EqualTo(items), "Error during job processing"); + + await Task.Delay(50); + AssertJobProcessingSuccessful(items, resumedTransfers1, checkpointer); + + // Simulate Disaster #2 + await ((IAsyncDisposable)transferManager1).DisposeAsync(); + (TransferManager transferManager2, + StepProcessor jobsProcessor2, + StepProcessor partsProcessor2, + StepProcessor> chunksProcessor2) = SimulateDisaster( + checkpointer, + ref transferManager1, + ref jobsProcessor1, + ref partsProcessor1, + ref chunksProcessor1); + + // Resume transfer after Disaster #2 + List resumedTransfers2 = await transferManager2.ResumeAllTransfersAsync(); + + await Task.Delay(50); + int inProgressJobsCount = GetJobsStateCount(resumedTransfers2, checkpointer)[DataTransferState.InProgress]; + Assert.That(inProgressJobsCount, Is.EqualTo(items)); + + // process jobs on resume #2 + Assert.That(await jobsProcessor2.StepAll(), Is.EqualTo(items), "Error during job processing"); + + await Task.Delay(50); + AssertJobProcessingSuccessful(items, resumedTransfers2, checkpointer); + + // process job parts on resume #2 + Assert.That(await partsProcessor2.StepAll(), Is.EqualTo(items), "Error job during part processing"); + + await Task.Delay(50); + AssertPartProcessingSuccessful(items, resumedTransfers2, checkpointer); + + // Simulate Disaster #3 + await ((IAsyncDisposable)transferManager2).DisposeAsync(); + (TransferManager transferManager3, + StepProcessor jobsProcessor3, + StepProcessor partsProcessor3, + StepProcessor> chunksProcessor3) = SimulateDisaster( + checkpointer, + ref transferManager2, + ref jobsProcessor2, + ref partsProcessor2, + ref chunksProcessor2); + + // Resume transfer after Disaster #3 + List resumedTransfers3 = await transferManager3.ResumeAllTransfersAsync(); + + // Finish the resume transfer #3 + await AssertResumeTransfer( + items, + items, + numChunks, + chunksPerPart, + resumedTransfers3, + checkpointer, + jobsProcessor3, + partsProcessor3, + chunksProcessor3, + DataTransferState.InProgress); + } + + [Test] + [Combinatorial] + public async Task MultipleDisasterResumes_ContainerTransfer( + [Values(2, 6)] int numJobs, + [Values(333, 500, 1024)] int itemSize, + [Values(333, 1024)] int chunkSize) + { + static int GetItemCountFromContainerIndex(int i) => i * 2; + + int numJobParts = Enumerable.Range(1, numJobs).Select(GetItemCountFromContainerIndex).Sum(); + int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); + // TODO: below should be only `items * chunksPerPart` but can't in some cases due to + // a bug in how work items are processed on multipart uploads. + int numChunks = Math.Max(chunksPerPart - 1, 1) * numJobParts; + + Uri srcUri = new("file:///foo/bar"); + Uri dstUri = new("https://example.com/fizz/buzz"); + + (var jobsProcessor0, var partsProcessor0, var chunksProcessor0) = StepProcessors(); + JobBuilder jobBuilder = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); + MemoryTransferCheckpointer checkpointer = new(); + + var resources = Enumerable.Range(1, numJobs).Select(i => + { + Mock srcResource = new(MockBehavior.Strict); + Mock dstResource = new(MockBehavior.Strict); + (srcResource, dstResource).BasicSetup(srcUri, dstUri, GetItemCountFromContainerIndex(i), itemSize); + return (Source: srcResource, Destination: dstResource); + }).ToList(); + + List resumeProviders = new() { new MockStorageResourceProvider(checkpointer) }; + + TransferManager transferManager0 = new( + jobsProcessor0, + partsProcessor0, + chunksProcessor0, + jobBuilder, + checkpointer, + resumeProviders); + + List transfers = new(); + + // queue jobs + foreach ((Mock srcResource, Mock dstResource) in resources) + { + DataTransfer transfer = await transferManager0.StartTransferAsync( + srcResource.Object, + dstResource.Object, + new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + transfers.Add(transfer); + + // Assert that job plan file is created properly + Assert.That(checkpointer.Jobs.ContainsKey(transfer.Id), Is.True, "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Status.State, Is.EqualTo(DataTransferState.Queued), "Error during Job plan file creation."); + Assert.That(checkpointer.Jobs[transfer.Id].Parts.Count, Is.EqualTo(0), "Job Part files should not exist before job processing"); + } + Assert.That(checkpointer.Jobs.Count, Is.EqualTo(transfers.Count), "Error during Job plan file creation."); + Assert.That(jobsProcessor0.ItemsInQueue, Is.EqualTo(numJobs), "Error during initial Job queueing."); + + // Simulate Disaster #1 + await ((IAsyncDisposable)transferManager0).DisposeAsync(); + (TransferManager transferManager1, + StepProcessor jobsProcessor1, + StepProcessor partsProcessor1, + StepProcessor> chunksProcessor1) = SimulateDisaster( + checkpointer, + ref transferManager0, + ref jobsProcessor0, + ref partsProcessor0, + ref chunksProcessor0); + + // Resume transfer after Disaster #1 + List resumedTransfers1 = await transferManager1.ResumeAllTransfersAsync(new() + { + InitialTransferSize = chunkSize, + MaximumTransferChunkSize = chunkSize, + }); + + await Task.Delay(50); + int queuedJobsCount = GetJobsStateCount(resumedTransfers1, checkpointer)[DataTransferState.Queued]; + Assert.That(queuedJobsCount, Is.EqualTo(numJobs)); + + // process jobs on resume #1 + Assert.That(await jobsProcessor1.StepAll(), Is.EqualTo(numJobs), "Error during job processing"); + + await Task.Delay(50); + AssertJobProcessingSuccessful(numJobs, resumedTransfers1, checkpointer); + + // Simulate Disaster #2 + await ((IAsyncDisposable)transferManager1).DisposeAsync(); + (TransferManager transferManager2, + StepProcessor jobsProcessor2, + StepProcessor partsProcessor2, + StepProcessor> chunksProcessor2) = SimulateDisaster( + checkpointer, + ref transferManager1, + ref jobsProcessor1, + ref partsProcessor1, + ref chunksProcessor1); + + // Resume transfer after Disaster #2 + List resumedTransfers2 = await transferManager2.ResumeAllTransfersAsync(); + + await Task.Delay(50); + int inProgressJobsCount = GetJobsStateCount(resumedTransfers2, checkpointer)[DataTransferState.InProgress]; + Assert.That(inProgressJobsCount, Is.EqualTo(numJobs)); + + // process jobs on resume #2 + Assert.That(await jobsProcessor2.StepAll(), Is.EqualTo(numJobs), "Error during job processing"); + + await Task.Delay(50); + AssertJobProcessingSuccessful(numJobs, resumedTransfers2, checkpointer); + + // process job parts on resume #2 + Assert.That(await partsProcessor2.StepAll(), Is.EqualTo(numJobParts), "Error job during part processing"); + + await Task.Delay(50); + AssertPartProcessingSuccessful(numJobParts, resumedTransfers2, checkpointer); + + // Simulate Disaster #3 + await ((IAsyncDisposable)transferManager2).DisposeAsync(); + (TransferManager transferManager3, + StepProcessor jobsProcessor3, + StepProcessor partsProcessor3, + StepProcessor> chunksProcessor3) = SimulateDisaster( + checkpointer, + ref transferManager2, + ref jobsProcessor2, + ref partsProcessor2, + ref chunksProcessor2); + + // Resume transfer after Disaster #3 + List resumedTransfers3 = await transferManager3.ResumeAllTransfersAsync(); + + // Finish the resume transfer #3 + await AssertResumeTransfer( + numJobs, + numJobParts, + numChunks, + chunksPerPart, + resumedTransfers3, + checkpointer, + jobsProcessor3, + partsProcessor3, + chunksProcessor3, + DataTransferState.InProgress); } public enum PauseLocation diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryTransferCheckpointer.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryTransferCheckpointer.cs index d6a1efc061a4..7acde9eca916 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryTransferCheckpointer.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/MemoryTransferCheckpointer.cs @@ -57,7 +57,7 @@ public JobPartPlanHeader Plan public Dictionary Jobs { get; set; } = new(); - public Task AddNewJobAsync(string transferId, StorageResource source, StorageResource destination, CancellationToken cancellationToken = default) + public virtual Task AddNewJobAsync(string transferId, StorageResource source, StorageResource destination, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (Jobs.ContainsKey(transferId)) @@ -71,12 +71,12 @@ public Task AddNewJobAsync(string transferId, StorageResource source, StorageRes Operation = JobPlanOperation.Upload, // TODO Source = source, Destination = destination, - Status = new() + Status = new(DataTransferState.Queued, false, false), }; return Task.CompletedTask; } - public Task AddNewJobPartAsync(string transferId, int partNumber, JobPartPlanHeader header, CancellationToken cancellationToken = default) + public virtual Task AddNewJobPartAsync(string transferId, int partNumber, JobPartPlanHeader header, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (!Jobs.TryGetValue(transferId, out Job job)) @@ -90,18 +90,18 @@ public Task AddNewJobPartAsync(string transferId, int partNumber, JobPartPlanHea job.Parts.Add(partNumber, new() { Plan = header, - Status = new() + Status = new(DataTransferState.Queued, false, false), }); return Task.CompletedTask; } - public Task GetCurrentJobPartCountAsync(string transferId, CancellationToken cancellationToken = default) + public virtual Task GetCurrentJobPartCountAsync(string transferId, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); return Task.FromResult(Jobs.TryGetValue(transferId, out Job job) ? job.Parts.Count : 0); } - public Task GetDataTransferPropertiesAsync(string transferId, CancellationToken cancellationToken = default) + public virtual Task GetDataTransferPropertiesAsync(string transferId, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (!Jobs.TryGetValue(transferId, out Job job)) @@ -119,21 +119,21 @@ public Task GetDataTransferPropertiesAsync(string transf }); } - public Task GetJobPartAsync(string transferId, int partNumber, CancellationToken cancellationToken = default) + public virtual Task GetJobPartAsync(string transferId, int partNumber, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (!Jobs.TryGetValue(transferId, out Job job)) { throw new Exception("Job does not exist."); } - if (job.Parts.TryGetValue(partNumber, out JobPart part)) + if (!job.Parts.TryGetValue(partNumber, out JobPart part)) { - throw new Exception($"Job part {partNumber} already exists for job {job.TransferId}."); + throw new Exception($"Job part {partNumber} does not exists for job {job.TransferId}."); } return Task.FromResult(part.Plan); } - public Task GetJobStatusAsync(string transferId, CancellationToken cancellationToken = default) + public virtual Task GetJobStatusAsync(string transferId, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (!Jobs.TryGetValue(transferId, out Job job)) @@ -143,19 +143,19 @@ public Task GetJobStatusAsync(string transferId, Cancellatio return Task.FromResult(job.Status.DeepCopy()); } - public Task> GetStoredTransfersAsync(CancellationToken cancellationToken = default) + public virtual Task> GetStoredTransfersAsync(CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); return Task.FromResult(Jobs.Keys.ToList()); } - public Task IsEnumerationCompleteAsync(string transferId, CancellationToken cancellationToken = default) + public virtual Task IsEnumerationCompleteAsync(string transferId, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); return Task.FromResult(Jobs.TryGetValue(transferId, out Job job) && job.EnumerationComplete); } - public Task SetEnumerationCompleteAsync(string transferId, CancellationToken cancellationToken = default) + public virtual Task SetEnumerationCompleteAsync(string transferId, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (Jobs.TryGetValue(transferId, out Job job)) @@ -165,7 +165,7 @@ public Task SetEnumerationCompleteAsync(string transferId, CancellationToken can return Task.CompletedTask; } - public Task SetJobPartStatusAsync(string transferId, int partNumber, DataTransferStatus status, CancellationToken cancellationToken = default) + public virtual Task SetJobPartStatusAsync(string transferId, int partNumber, DataTransferStatus status, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (Jobs.TryGetValue(transferId, out Job job) && job.Parts.TryGetValue(partNumber, out JobPart part)) @@ -175,7 +175,7 @@ public Task SetJobPartStatusAsync(string transferId, int partNumber, DataTransfe return Task.CompletedTask; } - public Task SetJobStatusAsync(string transferId, DataTransferStatus status, CancellationToken cancellationToken = default) + public virtual Task SetJobStatusAsync(string transferId, DataTransferStatus status, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); if (Jobs.TryGetValue(transferId, out Job job)) @@ -185,7 +185,7 @@ public Task SetJobStatusAsync(string transferId, DataTransferStatus status, Canc return Task.CompletedTask; } - public Task TryRemoveStoredTransferAsync(string transferId, CancellationToken cancellationToken = default) + public virtual Task TryRemoveStoredTransferAsync(string transferId, CancellationToken cancellationToken = default) { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); return Task.FromResult(Jobs.Remove(transferId)); diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs index 53dd0b8e5a52..15baad7bbc83 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/Shared/TestEventsRaised.cs @@ -32,19 +32,18 @@ public class TestEventsRaised : IDisposable private static readonly DataTransferStatus SkippedCompletedStatus = new DataTransferStatusInternal(DataTransferState.Completed, false, true); private static readonly DataTransferStatus FailedCompletedStatus = new DataTransferStatusInternal(DataTransferState.Completed, true, false); - public List FailedEvents { get; internal set; } - private object _failedEventsLock = new(); public List StatusEvents { get; internal set; } - public List SkippedEvents { get; internal set; } + public ConcurrentBag FailedEvents { get; internal set; } + public ConcurrentBag SkippedEvents { get; internal set; } public ConcurrentBag SingleCompletedEvents { get; internal set; } private List _options; private TestEventsRaised() { - FailedEvents = new List(); StatusEvents = new List(); - SkippedEvents = new List(); + FailedEvents = new ConcurrentBag(); + SkippedEvents = new ConcurrentBag(); SingleCompletedEvents = new ConcurrentBag(); } @@ -85,10 +84,7 @@ public void Dispose() private Task AppendFailedArg(TransferItemFailedEventArgs args) { - lock (_failedEventsLock) - { - FailedEvents.Add(args); - } + FailedEvents.Add(args); return Task.CompletedTask; } diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/TransferManagerTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/TransferManagerTests.cs index 14bf961ed64f..3cc7590a99eb 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/TransferManagerTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/TransferManagerTests.cs @@ -3,7 +3,6 @@ using System; using System.Buffers; -using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; @@ -16,6 +15,7 @@ using Moq; using NUnit.Framework; using NUnit.Framework.Constraints; +using NUnit.Framework.Interfaces; namespace Azure.Storage.DataMovement.Tests; @@ -28,7 +28,7 @@ private static (StepProcessor JobProcessor, StepProcessor (new(), new(), new()); private static (StorageResource Source, StorageResource Destination, Func SrcThrowScope, Func DstThrowScope) - GetBasicSetupResources(bool isContainer, Uri srcUri, Uri dstUri) + GetBasicSetupResources(bool isContainer, Uri srcUri, Uri dstUri, bool includeDelete = false) { if (isContainer) { @@ -44,12 +44,35 @@ private static (StorageResource Source, StorageResource Destination, Func srcItem = new(MockBehavior.Strict); Mock dstItem = new(MockBehavior.Strict); (srcItem, dstItem).BasicSetup(srcUri, dstUri); + dstItem.Setup(item => item.DeleteIfExistsAsync(It.IsAny())); StorageResourceItemFailureWrapper srcWrapper = new(srcItem.Object); StorageResourceItemFailureWrapper dstWrapper = new(dstItem.Object); return (srcWrapper, dstWrapper, srcWrapper.ThrowScope, dstWrapper.ThrowScope); } } + private static async Task ProcessChunksAssert( + StepProcessor> chunksProcessor, + int chunksPerPart, + int numChunks, + int totalJobParts) + { + // process chunks + int chunksStepped = await chunksProcessor.StepAll(); + // Check if all chunks stepped through + if (chunksPerPart > 1) + { + // Multichunk transfer sends a completion chunk after all the other chunks stepped through. + await Task.Delay(50); + Assert.That(await chunksProcessor.StepAll() + chunksStepped, Is.EqualTo(numChunks + totalJobParts)); + } + else + { + Assert.That(chunksStepped, Is.EqualTo(numChunks)); + } + Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0), "Failed to step through chunks queue."); + } + [Test] public async Task BasicProcessorLifetime() { @@ -71,9 +94,9 @@ public async Task BasicProcessorLifetime() partsProcessor.VerifyNoOtherCalls(); chunksProcessor.VerifyNoOtherCalls(); } - jobsProcessor.VerifyDisposal(); - partsProcessor.VerifyDisposal(); - chunksProcessor.VerifyDisposal(); + jobsProcessor.VerifyAsyncDisposal(); + partsProcessor.VerifyAsyncDisposal(); + chunksProcessor.VerifyAsyncDisposal(); jobsProcessor.VerifyNoOtherCalls(); partsProcessor.VerifyNoOtherCalls(); @@ -90,14 +113,14 @@ public async Task BasicItemTransfer( int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); // TODO: below should be only `items * chunksPerPart` but can't in some cases due to // a bug in how work items are processed on multipart uploads. - int expectedChunksInQueue = Math.Max(chunksPerPart-1, 1) * items; + int expectedChunksInQueue = Math.Max(chunksPerPart - 1, 1) * items; Uri srcUri = new("file:///foo/bar"); Uri dstUri = new("https://example.com/fizz/buzz"); (var jobsProcessor, var partsProcessor, var chunksProcessor) = StepProcessors(); JobBuilder jobBuilder = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); - Mock checkpointer = new(); + MemoryTransferCheckpointer checkpointer = new(); var resources = Enumerable.Range(0, items).Select(_ => { @@ -114,7 +137,7 @@ public async Task BasicItemTransfer( partsProcessor, chunksProcessor, jobBuilder, - checkpointer.Object, + checkpointer, default); List transfers = new(); @@ -138,6 +161,7 @@ public async Task BasicItemTransfer( srcResource.VerifyNoOtherCalls(); dstResource.VerifyNoOtherCalls(); } + Assert.That(checkpointer.Jobs.Count, Is.EqualTo(items), "Jobs not added to checkpointer."); Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(items), "Error during initial Job queueing."); // process jobs @@ -151,6 +175,14 @@ public async Task BasicItemTransfer( srcResource.VerifyNoOtherCalls(); dstResource.VerifyNoOtherCalls(); } + foreach (MemoryTransferCheckpointer.Job job in checkpointer.Jobs.Values) + { + Assert.That(job.Parts.Count, Is.EqualTo(1), "Items should be single-part."); + Assert.That(job.Parts.Values.First().Status.State, Is.EqualTo(DataTransferState.Queued), "Bad part status."); + Assert.That(job.Parts.Keys.First(), Is.EqualTo(0), "Parts should be zero-indexed."); + Assert.That(job.EnumerationComplete, "Enumeration not marked comlete."); + Assert.That(job.Status.State, Is.EqualTo(DataTransferState.InProgress), "Transfer state not updated."); + } // process parts Assert.That(await partsProcessor.StepAll(), Is.EqualTo(items)); @@ -163,10 +195,20 @@ public async Task BasicItemTransfer( srcResource.VerifyNoOtherCalls(); dstResource.VerifyNoOtherCalls(); } + foreach (MemoryTransferCheckpointer.Job job in checkpointer.Jobs.Values) + { + foreach (MemoryTransferCheckpointer.JobPart part in job.Parts.Values) + { + Assert.That(part.Status.State, Is.EqualTo(DataTransferState.InProgress), "Part state not updated."); + } + } + + await ProcessChunksAssert( + chunksProcessor, + chunksPerPart, + expectedChunksInQueue, + items); - // process chunks - Assert.That(await chunksProcessor.StepAll(), Is.EqualTo(expectedChunksInQueue)); - Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0)); foreach ((Mock srcResource, Mock dstResource) in resources) { srcResource.VerifySourceResourceOnChunkProcess(); @@ -175,12 +217,20 @@ public async Task BasicItemTransfer( dstResource.VerifyNoOtherCalls(); } - await Task.Delay(20); // TODO flaky that we need this; a random one will often fail without + await Task.Delay(50); // TODO flaky that we need this; a random one will often fail without foreach (DataTransfer transfer in transfers) { Assert.That(transfer.HasCompleted); } + foreach (MemoryTransferCheckpointer.Job job in checkpointer.Jobs.Values) + { + foreach (MemoryTransferCheckpointer.JobPart part in job.Parts.Values) + { + Assert.That(part.Status.State, Is.EqualTo(DataTransferState.Completed), "Part state not updated."); + } + Assert.That(job.Status.State, Is.EqualTo(DataTransferState.Completed), "Job state not updated."); + } } [Test] @@ -192,40 +242,34 @@ public async Task BasicContainerTransfer( { static int GetItemCountFromContainerIndex(int i) => i*i + 1; - int numJobParts = Enumerable.Range(1, numJobs).Select(GetItemCountFromContainerIndex).Sum(); + int totalJobParts = Enumerable.Range(1, numJobs).Select(GetItemCountFromContainerIndex).Sum(); int chunksPerPart = (int)Math.Ceiling((float)itemSize / chunkSize); // TODO: below should be only `items * chunksPerPart` but can't in some cases due to // a bug in how work items are processed on multipart uploads. - int numChunks = Math.Max(chunksPerPart - 1, 1) * numJobParts; + int numChunks = Math.Max(chunksPerPart - 1, 1) * totalJobParts; Uri srcUri = new("file:///foo/bar"); Uri dstUri = new("https://example.com/fizz/buzz"); (var jobsProcessor, var partsProcessor, var chunksProcessor) = StepProcessors(); JobBuilder jobBuilder = new(ArrayPool.Shared, default, new ClientDiagnostics(ClientOptions.Default)); - Mock checkpointer = new(); - - var resources = Enumerable.Range(1, numJobs).Select(i => - { - Mock srcResource = new(MockBehavior.Strict); - Mock dstResource = new(MockBehavior.Strict); - (srcResource, dstResource).BasicSetup(srcUri, dstUri, GetItemCountFromContainerIndex(i), itemSize); - return (Source: srcResource, Destination: dstResource); - }).ToList(); + MemoryTransferCheckpointer checkpointer = new(); await using TransferManager transferManager = new( jobsProcessor, partsProcessor, chunksProcessor, jobBuilder, - checkpointer.Object, + checkpointer, default); - List transfers = new(); + List<(DataTransfer Transfer, int ExpectedPartCount, Mock Source, Mock Destination)> transfers = new(); - // queue jobs - foreach ((Mock srcResource, Mock dstResource) in resources) + foreach (int i in Enumerable.Range(1, numJobs)) { + Mock srcResource = new(MockBehavior.Strict); + Mock dstResource = new(MockBehavior.Strict); + (srcResource, dstResource).BasicSetup(srcUri, dstUri, GetItemCountFromContainerIndex(i), itemSize); DataTransfer transfer = await transferManager.StartTransferAsync( srcResource.Object, dstResource.Object, @@ -234,22 +278,28 @@ public async Task BasicContainerTransfer( InitialTransferSize = chunkSize, MaximumTransferChunkSize = chunkSize, }); - Assert.That(transfer.HasCompleted, Is.False); - transfers.Add(transfer); + transfers.Add((transfer, GetItemCountFromContainerIndex(i), srcResource, dstResource)); + Assert.That(transfer.HasCompleted, Is.False); srcResource.VerifySourceResourceOnQueue(); dstResource.VerifyDestinationResourceOnQueue(); srcResource.VerifyNoOtherCalls(); dstResource.VerifyNoOtherCalls(); } + Assert.That(checkpointer.Jobs.Count, Is.EqualTo(numJobs), "Jobs not added to checkpointer."); Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(numJobs), "Error during initial Job queueing."); // process jobs - Assert.That(await jobsProcessor.StepAll(), Is.EqualTo(numJobs)); - Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(0)); - Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(numJobParts), "Error during Job => Part processing."); - foreach ((Mock srcResource, Mock dstResource) in resources) + Assert.That(await jobsProcessor.StepAll(), Is.EqualTo(numJobs), "Failed to step through jobs queue."); + Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(0), "Failed to step through jobs queue."); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(totalJobParts), "Error during Job => Part processing."); + foreach ((DataTransfer transfer, int parts, Mock srcResource, Mock dstResource) in transfers) { + Assert.That(checkpointer.Jobs[transfer.Id].Parts.Count, Is.EqualTo(parts), "Containers should have several parts."); + Assert.That(checkpointer.Jobs[transfer.Id].Parts.Keys, Is.EquivalentTo(Enumerable.Range(0, checkpointer.Jobs[transfer.Id].Parts.Count).ToList()), + "Part nums should be sequential and zero-indexed."); + Assert.That(checkpointer.Jobs[transfer.Id].EnumerationComplete, "Enumeration not marked comlete."); + Assert.That(checkpointer.Jobs[transfer.Id].Status.State, Is.EqualTo(DataTransferState.InProgress), "Transfer state not updated."); srcResource.VerifySourceResourceOnJobProcess(); dstResource.VerifyDestinationResourceOnJobProcess(); srcResource.VerifyNoOtherCalls(); @@ -257,19 +307,26 @@ public async Task BasicContainerTransfer( } // process parts - Assert.That(await partsProcessor.StepAll(), Is.EqualTo(numJobParts)); - Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(0)); + Assert.That(await partsProcessor.StepAll(), Is.EqualTo(totalJobParts), "Failed to step through parts queue."); + Assert.That(partsProcessor.ItemsInQueue, Is.EqualTo(0), "Failed to step through parts queue."); Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(numChunks), "Error during Part => Chunk processing."); - foreach ((Mock srcResource, Mock dstResource) in resources) + foreach ((DataTransfer transfer, int parts, Mock srcResource, Mock dstResource) in transfers) { + foreach (MemoryTransferCheckpointer.JobPart part in checkpointer.Jobs[transfer.Id].Parts.Values) + { + Assert.That(part.Status.State, Is.EqualTo(DataTransferState.InProgress), "Part state not updated."); + } srcResource.VerifyNoOtherCalls(); dstResource.VerifyNoOtherCalls(); } - // process chunks - Assert.That(await chunksProcessor.StepAll(), Is.EqualTo(numChunks)); - Assert.That(chunksProcessor.ItemsInQueue, Is.EqualTo(0)); - foreach ((Mock srcResource, Mock dstResource) in resources) + await ProcessChunksAssert( + chunksProcessor, + chunksPerPart, + numChunks, + totalJobParts); + + foreach ((DataTransfer transfer, int parts, Mock srcResource, Mock dstResource) in transfers) { srcResource.VerifyNoOtherCalls(); dstResource.VerifyNoOtherCalls(); @@ -277,9 +334,14 @@ public async Task BasicContainerTransfer( await Task.Delay(10); // TODO flaky that we need this; a random one will often fail without - foreach (DataTransfer transfer in transfers) + foreach ((DataTransfer transfer, int parts, Mock srcResource, Mock dstResource) in transfers) { Assert.That(transfer.HasCompleted); + foreach (MemoryTransferCheckpointer.JobPart part in checkpointer.Jobs[transfer.Id].Parts.Values) + { + Assert.That(part.Status.State, Is.EqualTo(DataTransferState.Completed), "Part state not updated."); + } + Assert.That(checkpointer.Jobs[transfer.Id].Status.State, Is.EqualTo(DataTransferState.Completed), "Job state not updated."); } } @@ -298,40 +360,36 @@ public async Task TransferFailAtQueue( { CallBase = true, }; - Mock checkpointer = new(); + Mock checkpointer = new() + { + CallBase = true, + }; (StorageResource srcResource, StorageResource dstResource, Func srcThrowScope, Func dstThrowScope) = GetBasicSetupResources(isContainer, srcUri, dstUri); Exception expectedException = new(); Exception cleanupException = throwCleanup ? new() : null; - List capturedTransferIds = new(); + bool expectTransferInCheckpointer = failAt == 0 && throwCleanup; + switch (failAt) { - var checkpointerAddJob = checkpointer.Setup(c => c.AddNewJobAsync(Capture.In(capturedTransferIds), - It.IsAny(), It.IsAny(), It.IsAny())); - var checkpointerRemoveJob = checkpointer.Setup(c => c.TryRemoveStoredTransferAsync( - It.IsAny(), It.IsAny())); - - switch (failAt) - { - case 0: - jobBuilder.Setup(b => b.BuildJobAsync(It.IsAny(), It.IsAny(), - It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny(), It.IsAny()) - ).Throws(expectedException); - break; - case 1: - checkpointerAddJob.Throws(expectedException); - break; - } - if (throwCleanup) - { - checkpointerRemoveJob.Throws(cleanupException); - } - else - { - checkpointerRemoveJob.Returns(Task.FromResult(true)); - } + case 0: + jobBuilder.Setup(b => b.BuildJobAsync(It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny()) + ).Throws(expectedException); + break; + case 1: + checkpointer.Setup(c => c.AddNewJobAsync(It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny()) + ).Throws(expectedException); + break; + } + if (throwCleanup) + { + checkpointer.Setup(c => c.TryRemoveStoredTransferAsync( + It.IsAny(), It.IsAny()) + ).Throws(cleanupException); } await using TransferManager transferManager = new( @@ -352,10 +410,10 @@ public async Task TransferFailAtQueue( Assert.That(transfer, Is.Null); - Assert.That(capturedTransferIds.Count, Is.EqualTo(1)); - checkpointer.Verify(c => c.AddNewJobAsync(capturedTransferIds.First(), It.IsAny(), + Assert.That(checkpointer.Object.Jobs.Count, Is.EqualTo(expectTransferInCheckpointer ? 1 : 0)); + checkpointer.Verify(c => c.AddNewJobAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); - checkpointer.Verify(c => c.TryRemoveStoredTransferAsync(capturedTransferIds.First(), + checkpointer.Verify(c => c.TryRemoveStoredTransferAsync(It.IsAny(), It.IsAny()), Times.Once); checkpointer.VerifyNoOtherCalls(); } @@ -370,7 +428,14 @@ public async Task TransferFailAtJobProcess( (var jobsProcessor, var partsProcessor, var chunksProcessor) = StepProcessors(); JobBuilder jobBuilder = new(ArrayPool.Shared, default, new(ClientOptions.Default)); + + List capturedTransferIds = new(); + List capturedTransferStatuses = new(); Mock checkpointer = new(MockBehavior.Loose); + checkpointer.Setup(c => c.AddNewJobAsync(Capture.In(capturedTransferIds), + It.IsAny(), It.IsAny(), It.IsAny())); + checkpointer.Setup(c => c.SetJobStatusAsync(It.IsAny(), CaptureTransferStatus(capturedTransferStatuses), + It.IsAny())); (StorageResource srcResource, StorageResource dstResource, Func srcThrowScope, Func dstThrowScope) = GetBasicSetupResources(isContainer, srcUri, dstUri); @@ -383,17 +448,12 @@ public async Task TransferFailAtJobProcess( checkpointer.Object, default); - //Exception expectedException = new(); - //checkpointer.Setup(c => c.AddNewJobPartAsync(It.IsAny(), It.IsAny(), It.IsAny(), - // It.IsAny()) - //).Throws(expectedException); - // need to listen to events to get exception that takes place in processing List failures = new(); DataTransferOptions options = new(); options.ItemTransferFailed += e => { failures.Add(e); return Task.CompletedTask; }; - DataTransfer transfer = await transferManager.StartTransferAsync(srcResource, dstResource); + DataTransfer transfer = await transferManager.StartTransferAsync(srcResource, dstResource, options); using (srcThrowScope()) { @@ -401,11 +461,24 @@ public async Task TransferFailAtJobProcess( } Assert.That(jobsProcessor.ItemsInQueue, Is.Zero); Assert.That(partsProcessor.ItemsInQueue, Is.Zero); // because of failure - // TODO Failures in processing job into job part(s) should surface errors (currently doesn't) - // Assert.That(transfer.TransferStatus.HasFailedItems); - // Assert.That(failures, Is.Not.Empty); - // TODO determine checkpointer status of job parts - // need checkpointer API refactor for this + Assert.That(transfer.TransferStatus.HasFailedItems); + Assert.That(failures, Is.Not.Empty); + + string transferId = capturedTransferIds.First(); + checkpointer.Verify(c => c.AddNewJobAsync(transferId, It.IsAny(), It.IsAny(), + It.IsAny())); + checkpointer.Verify(c => c.SetJobStatusAsync(transferId, It.IsAny(), + It.IsAny()), Times.Exactly(3)); + if (!isContainer) + { + checkpointer.Verify(c => c.GetCurrentJobPartCountAsync(It.IsAny(), It.IsAny()), Times.Once); + } + Assert.That(capturedTransferStatuses[0].State, Is.EqualTo(DataTransferState.InProgress)); + Assert.That(capturedTransferStatuses[1].State, Is.EqualTo(DataTransferState.Stopping)); + Assert.That(capturedTransferStatuses[2].IsCompletedWithFailedItems); + checkpointer.VerifyNoOtherCalls(); + + // TODO checkpointer probably shouldn't be in this state. } [Test] @@ -418,10 +491,17 @@ public async Task TransferFailAtPartProcess( (var jobsProcessor, var partsProcessor, var chunksProcessor) = StepProcessors(); JobBuilder jobBuilder = new(ArrayPool.Shared, default, new(ClientOptions.Default)); - Mock checkpointer = new(MockBehavior.Loose); + + Mock checkpointer = new() + { + CallBase = true + }; + List capturedTransferStatuses = new(); + checkpointer.Setup(c => c.SetJobStatusAsync(It.IsAny(), CaptureTransferStatus(capturedTransferStatuses), + It.IsAny())); (StorageResource srcResource, StorageResource dstResource, Func srcThrowScope, Func dstThrowScope) - = GetBasicSetupResources(isContainer, srcUri, dstUri); + = GetBasicSetupResources(isContainer, srcUri, dstUri, includeDelete: true); await using TransferManager transferManager = new( jobsProcessor, @@ -451,8 +531,12 @@ public async Task TransferFailAtPartProcess( Assert.That(transfer.TransferStatus.HasFailedItems); Assert.That(failures, Is.Not.Empty); - // TODO determine checkpointer status of job chunks - // need checkpointer API refactor for this + + Assert.That(capturedTransferStatuses.Count, Is.EqualTo(4)); + Assert.That(capturedTransferStatuses[0].State, Is.EqualTo(DataTransferState.InProgress)); + Assert.That(capturedTransferStatuses[1].State, Is.EqualTo(DataTransferState.InProgress)); + Assert.That(capturedTransferStatuses[2].State, Is.EqualTo(DataTransferState.Stopping)); + Assert.That(capturedTransferStatuses[3].IsCompletedWithFailedItems); } [Test] @@ -486,6 +570,17 @@ public async Task MultipleTransfersAddedCheckpointer(int numJobs) }); Assert.That(jobsProcessor.ItemsInQueue, Is.EqualTo(numJobs), "Error during initial Job queueing."); } + + /// + /// DataTransferStatus is stateful across transfer. This makes it difficult to verify mocks, as verifications + /// are lazily performed. This captures deep copies of statuses for custom assertion. + /// + private static DataTransferStatus CaptureTransferStatus(ICollection statuses) + => Match.Create(status => + { + statuses.Add(status.DeepCopy()); + return true; + }); } internal static partial class MockExtensions @@ -540,6 +635,10 @@ public static void BasicSetup( new(itemSize, default, default, new()))); }); + items.Source.Setup(r => r.IsContainer).Returns(false); + + items.Source.Setup(r => r.ProviderId).Returns("mock"); + items.Destination.Setup(r => r.CopyFromStreamAsync( It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) @@ -558,6 +657,10 @@ public static void BasicSetup( CancellationHelper.ThrowIfCancellationRequested(cancellationToken); return Task.CompletedTask; }); + + items.Destination.Setup(r => r.IsContainer).Returns(false); + + items.Destination.Setup(r => r.ProviderId).Returns("mock"); } public static void BasicSetup( @@ -595,11 +698,25 @@ async IAsyncEnumerable SubResourcesAsAsyncEnumerable( containers.Source.Setup(r => r.GetStorageResourcesAsync(It.IsAny(), It.IsAny())) .Returns(SubResourcesAsAsyncEnumerable); + containers.Source.Setup(r => r.GetStorageResourceReference(It.IsAny(), It.IsAny())) + .Returns((path, resId) => subResources + .Where(pair => pair.Source.Object.Uri.AbsolutePath.Contains(path)) + .FirstOrDefault().Source?.Object + ); + containers.Destination.Setup(r => r.GetStorageResourceReference(It.IsAny(), It.IsAny())) .Returns((path, resId) => subResources .Where(pair => pair.Source.Object.Uri.AbsolutePath.Contains(path)) .FirstOrDefault().Destination?.Object - ); + ); + + containers.Source.Setup(r => r.IsContainer).Returns(true); + + containers.Source.Setup(r => r.ProviderId).Returns("mock"); + + containers.Destination.Setup(r => r.IsContainer).Returns(true); + + containers.Destination.Setup(r => r.ProviderId).Returns("mock"); } public static void VerifyTransferManagerCtorInvocations(this Mock> processor) diff --git a/sdk/storage/Azure.Storage.DataMovement/tests/TransferValidationTests.cs b/sdk/storage/Azure.Storage.DataMovement/tests/TransferValidationTests.cs index fddd5757ee38..28b03fca5d78 100644 --- a/sdk/storage/Azure.Storage.DataMovement/tests/TransferValidationTests.cs +++ b/sdk/storage/Azure.Storage.DataMovement/tests/TransferValidationTests.cs @@ -2,18 +2,15 @@ // Licensed under the MIT License. using System; +using System.Linq; using System.Threading; using System.Threading.Tasks; using NUnit.Framework; namespace Azure.Storage.DataMovement.Tests { - public class TransferValidationTests : DataMovementTestBase + public class TransferValidationTests { - public TransferValidationTests(bool async) : base(async, default) - { - } - [Test, Pairwise] public async Task LargeSingleFile( [Values(TransferDirection.Copy, TransferDirection.Upload, TransferDirection.Download)] TransferDirection transferDirection, @@ -62,7 +59,7 @@ public async Task LargeSingleFile_Fail_Source( Assert.That(transfer.HasCompleted, Is.True); Assert.That(events.FailedEvents, Is.Not.Empty); - Assert.That(events.FailedEvents[0].Exception.Message, Does.Contain("Intentionally failing")); + Assert.That(events.FailedEvents.First().Exception.Message, Does.Contain("Intentionally failing")); } [Test, Pairwise] @@ -82,12 +79,12 @@ public async Task LargeSingleFile_Fail_Destination( TestEventsRaised events = new(options); DataTransfer transfer = await transferManager.StartTransferAsync(srcResource, dstResource, options); - CancellationTokenSource tokenSource = new(TimeSpan.FromSeconds(10)); + CancellationTokenSource tokenSource = new(TimeSpan.FromSeconds(30)); await transfer.WaitForCompletionAsync(tokenSource.Token); Assert.That(transfer.HasCompleted, Is.True); Assert.That(events.FailedEvents, Is.Not.Empty); - Assert.That(events.FailedEvents[0].Exception.Message, Does.Contain("Intentionally failing")); + Assert.That(events.FailedEvents.First().Exception.Message, Does.Contain("Intentionally failing")); } } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md index 27804061ada5..a5d4e5644226 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/CHANGELOG.md @@ -3,12 +3,7 @@ ## 12.22.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2025-05-05. ## 12.21.0 (2024-11-12) diff --git a/sdk/storage/Azure.Storage.Files.DataLake/README.md b/sdk/storage/Azure.Storage.Files.DataLake/README.md index e5136a042ff5..5a228acaaf33 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/README.md +++ b/sdk/storage/Azure.Storage.Files.DataLake/README.md @@ -260,19 +260,19 @@ additional questions or comments. [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Files.DataLake/samples [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.DataLake/src [package]: https://www.nuget.org/packages/Azure.Storage.Files.DataLake/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage.files.datalake -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/datalakestoragegen2/filesystem -[product_docs]: https://docs.microsoft.com/azure/storage/blobs/?toc=%2fazure%2fstorage%2fblobs%2ftoc.json +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage.files.datalake +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/filesystem +[product_docs]: https://learn.microsoft.com/azure/storage/blobs/?toc=%2fazure%2fstorage%2fblobs%2ftoc.json [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs index c5b8a7798a0c..7a1c3bd97cad 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net6.0.cs @@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake { public partial class DataLakeClientOptions : Azure.Core.ClientOptions { - public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { } + public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } } public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -36,6 +36,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs index 373451bb75ef..e1cee30d2348 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.net8.0.cs @@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake { public partial class DataLakeClientOptions : Azure.Core.ClientOptions { - public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { } + public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } } public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -36,6 +36,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient diff --git a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs index c5b8a7798a0c..7a1c3bd97cad 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/api/Azure.Storage.Files.DataLake.netstandard2.0.cs @@ -2,7 +2,7 @@ namespace Azure.Storage.Files.DataLake { public partial class DataLakeClientOptions : Azure.Core.ClientOptions { - public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_01_05) { } + public DataLakeClientOptions(Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion version = Azure.Storage.Files.DataLake.DataLakeClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Files.DataLake.Models.DataLakeAudience? Audience { get { throw null; } set { } } public Azure.Storage.Files.DataLake.Models.DataLakeCustomerProvidedKey? CustomerProvidedKey { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } @@ -36,6 +36,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class DataLakeDirectoryClient : Azure.Storage.Files.DataLake.DataLakePathClient diff --git a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs index 5f8fd0849ba0..5fcb4ca03f06 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/src/DataLakeClientOptions.cs @@ -156,7 +156,12 @@ public enum ServiceVersion /// /// The 2025-01-05 service version. /// - V2025_01_05 = 25 + V2025_01_05 = 25, + + /// + /// The 2025-05-05 service version. + /// + V2025_05_05 = 26 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs index eab0498c5dfc..8d1b0227c208 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/DataLakeClientTestFixtureAttribute.cs @@ -34,6 +34,7 @@ public DataLakeClientTestFixtureAttribute() DataLakeClientOptions.ServiceVersion.V2024_08_04, DataLakeClientOptions.ServiceVersion.V2024_11_04, DataLakeClientOptions.ServiceVersion.V2025_01_05, + DataLakeClientOptions.ServiceVersion.V2025_05_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion) { diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index b458e7277407..420d6cc0e768 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -3,12 +3,18 @@ ## 12.22.0-beta.1 (Unreleased) ### Features Added +- Added support for service version 2025-05-05. +- Added support for NFS over REST. ### Breaking Changes +- The following APIs no longer send the x-ms-file-permission-key, x-ms-file-attributes, x-ms-file-creation-time, and x-ms-file-last-write-time request headers by default. These headers have been optional in the REST API since x-ms-version 2021-06-08: + - ShareFileClient.Create() and .CreateAsync() + - ShareFileClient.SetHttpHeaders() and .SetHttpHeadersAsync() + - ShareDirectoryClient.Create() and .CreateAsync() + - ShareDirectoryClient.SetHttpHeaders() and .SetHttpHeadersAsync() ### Bugs Fixed - -### Other Changes +- Fixed \[BUG\] Unable to create directory with only whiteSpaceChars #42891 ## 12.21.0 (2024-11-12) diff --git a/sdk/storage/Azure.Storage.Files.Shares/README.md b/sdk/storage/Azure.Storage.Files.Shares/README.md index e6e673a6a251..312f9cb83bac 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.Files.Shares/README.md @@ -233,18 +233,18 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Files.Shares/src [package]: https://www.nuget.org/packages/Azure.Storage.Files.Shares/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage.files.shares -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/file-service-rest-api -[product_docs]: https://docs.microsoft.com/azure/storage/files/storage-files-introduction +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage.files.shares +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/file-service-rest-api +[product_docs]: https://learn.microsoft.com/azure/storage/files/storage-files-introduction [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/file-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/file-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Files.Shares/samples/ [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs index b1b355dda471..59961ca412ee 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net6.0.cs @@ -115,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential } public partial class ShareClientOptions : Azure.Core.ClientOptions { - public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { } + public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_05_05) { } public bool? AllowSourceTrailingDot { get { throw null; } set { } } public bool? AllowTrailingDot { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } } @@ -149,6 +149,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class ShareDirectoryClient @@ -267,6 +268,8 @@ public ShareFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCredent public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.Response CreateHardLink(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateHardLinkAsync(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Delete(System.Threading.CancellationToken cancellationToken) { throw null; } @@ -494,6 +497,15 @@ public enum FilePermissionFormat Sddl = 0, Binary = 1, } + public partial class FilePosixProperties + { + public FilePosixProperties() { } + public Azure.Storage.Files.Shares.Models.NfsFileMode FileMode { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.NfsFileType? FileType { get { throw null; } } + public string Group { get { throw null; } set { } } + public long? LinkCount { get { throw null; } } + public string Owner { get { throw null; } set { } } + } public partial class FileSmbProperties { public FileSmbProperties() { } @@ -511,16 +523,67 @@ public FileSmbProperties() { } } public static partial class FilesModelFactory { + public static Azure.Storage.Files.Shares.Models.FilePosixProperties FilePosixProperties(Azure.Storage.Files.Shares.Models.NfsFileMode fileMode, string owner, string group, Azure.Storage.Files.Shares.Models.NfsFileType fileType, long? linkCount) { throw null; } + public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareFileItem ShareFileItem(bool isDirectory = false, string name = null, long? fileSize = default(long?), string id = null, Azure.Storage.Files.Shares.Models.ShareFileItemProperties properties = null, Azure.Storage.Files.Shares.Models.NtfsFileAttributes? fileAttributes = default(Azure.Storage.Files.Shares.Models.NtfsFileAttributes?), string permissionKey = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata = null, Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareFileDownloadInfo StorageFileDownloadInfo(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletionTime = default(System.DateTimeOffset), string copyStatusDescription = null, string contentDisposition = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServerEncrypted = false, string cacheControl = null, string fileAttributes = null, System.Collections.Generic.IEnumerable contentEncoding = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), byte[] contentHash = null, System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string contentRange = null, string filePermissionKey = null, string contentType = null, string fileId = null, long contentLength = (long)0, string fileParentId = null, System.Collections.Generic.IDictionary metadata = null, System.IO.Stream content = null, string copyId = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, string contentRange = null, Azure.ETag eTag = default(Azure.ETag), System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServiceEncrypted = false, Azure.Storage.Files.Shares.Models.ShareLeaseDuration leaseDuration = Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite, Azure.Storage.Files.Shares.Models.ShareLeaseState leaseState = Azure.Storage.Files.Shares.Models.ShareLeaseState.Available, Azure.Storage.Files.Shares.Models.ShareLeaseStatus leaseStatus = Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentType, string contentRange, Azure.ETag eTag, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, string acceptRanges, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, byte[] fileContentHash, bool isServiceEncrypted) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, string filePermissionKey = null, string fileAttributes = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string fileId = null, string fileParentId = null, Azure.Storage.Files.Shares.Models.NfsFileMode nfsFileMode = null, string owner = null, string group = null, Azure.Storage.Files.Shares.Models.NfsFileType nfsFileType = default(Azure.Storage.Files.Shares.Models.NfsFileType)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileItem StorageFileItem(bool isDirectory, string name, long? fileSize) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, long contentLength = (long)0, string contentType = null, Azure.ETag eTag = default(Azure.ETag), byte[] contentHash = null, System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, string copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, Azure.Storage.Files.Shares.Models.NtfsFileAttributes fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } } + public enum ModeCopyMode + { + Source = 0, + Override = 1, + } + public partial class NfsFileMode + { + public NfsFileMode() { } + public bool EffectiveGroupIdentity { get { throw null; } set { } } + public bool EffectiveUserIdentity { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Group { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Other { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Owner { get { throw null; } set { } } + public bool StickyBit { get { throw null; } set { } } + public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseOctalFileMode(string modeString) { throw null; } + public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseSymbolicFileMode(string modeString) { throw null; } + public string ToOctalFileMode() { throw null; } + public override string ToString() { throw null; } + public string ToSymbolicFileMode() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NfsFileType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NfsFileType(string value) { throw null; } + public static Azure.Storage.Files.Shares.Models.NfsFileType Directory { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.NfsFileType Regular { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.NfsFileType SymLink { get { throw null; } } + public bool Equals(Azure.Storage.Files.Shares.Models.NfsFileType 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.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; } + public static implicit operator Azure.Storage.Files.Shares.Models.NfsFileType (string value) { throw null; } + public static bool operator !=(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; } + public override string ToString() { throw null; } + } [System.FlagsAttribute] public enum NtfsFileAttributes { @@ -535,6 +598,11 @@ public enum NtfsFileAttributes NotContentIndexed = 256, NoScrubData = 512, } + public enum OwnerCopyMode + { + Source = 0, + Override = 1, + } public enum PermissionCopyMode { Source = 0, @@ -545,6 +613,14 @@ public partial class PermissionInfo internal PermissionInfo() { } public string FilePermissionKey { get { throw null; } } } + [System.FlagsAttribute] + public enum PosixRolePermissions + { + None = 0, + Execute = 1, + Write = 2, + Read = 4, + } public partial class ShareAccessPolicy { public ShareAccessPolicy() { } @@ -629,6 +705,7 @@ public partial class ShareDirectoryCreateOptions public ShareDirectoryCreateOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectoryGetFilesAndDirectoriesOptions @@ -643,6 +720,7 @@ public partial class ShareDirectoryInfo internal ShareDirectoryInfo() { } public Azure.ETag ETag { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectoryProperties @@ -652,12 +730,14 @@ internal ShareDirectoryProperties() { } public bool IsServerEncrypted { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectorySetHttpHeadersOptions { public ShareDirectorySetHttpHeadersOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -767,7 +847,10 @@ public ShareFileCopyOptions() { } public Azure.Storage.Files.Shares.Models.PermissionCopyMode? FilePermissionCopyMode { get { throw null; } set { } } public bool? IgnoreReadOnly { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.ModeCopyMode? ModeCopyMode { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.OwnerCopyMode? OwnerCopyMode { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } } } @@ -777,6 +860,7 @@ public ShareFileCreateOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileDownloadDetails @@ -802,6 +886,7 @@ internal ShareFileDownloadDetails() { } public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileDownloadInfo : System.IDisposable @@ -879,6 +964,7 @@ internal ShareFileInfo() { } public Azure.ETag ETag { get { throw null; } } public bool IsServerEncrypted { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileItem @@ -966,6 +1052,7 @@ internal ShareFileProperties() { } public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileRangeInfo @@ -1007,6 +1094,7 @@ public ShareFileSetHttpHeadersOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } } public long? NewSize { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } [System.FlagsAttribute] @@ -1225,7 +1313,9 @@ public ShareSmbSettings() { } } public static partial class SharesModelFactory { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; } } public partial class ShareSnapshotInfo diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs index 9391c7f96c97..fb9a9a56c7b6 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.net8.0.cs @@ -115,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential } public partial class ShareClientOptions : Azure.Core.ClientOptions { - public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { } + public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_05_05) { } public bool? AllowSourceTrailingDot { get { throw null; } set { } } public bool? AllowTrailingDot { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } } @@ -149,6 +149,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class ShareDirectoryClient @@ -267,6 +268,8 @@ public ShareFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCredent public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.Response CreateHardLink(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateHardLinkAsync(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Delete(System.Threading.CancellationToken cancellationToken) { throw null; } @@ -494,6 +497,15 @@ public enum FilePermissionFormat Sddl = 0, Binary = 1, } + public partial class FilePosixProperties + { + public FilePosixProperties() { } + public Azure.Storage.Files.Shares.Models.NfsFileMode FileMode { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.NfsFileType? FileType { get { throw null; } } + public string Group { get { throw null; } set { } } + public long? LinkCount { get { throw null; } } + public string Owner { get { throw null; } set { } } + } public partial class FileSmbProperties { public FileSmbProperties() { } @@ -511,16 +523,67 @@ public FileSmbProperties() { } } public static partial class FilesModelFactory { + public static Azure.Storage.Files.Shares.Models.FilePosixProperties FilePosixProperties(Azure.Storage.Files.Shares.Models.NfsFileMode fileMode, string owner, string group, Azure.Storage.Files.Shares.Models.NfsFileType fileType, long? linkCount) { throw null; } + public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareFileItem ShareFileItem(bool isDirectory = false, string name = null, long? fileSize = default(long?), string id = null, Azure.Storage.Files.Shares.Models.ShareFileItemProperties properties = null, Azure.Storage.Files.Shares.Models.NtfsFileAttributes? fileAttributes = default(Azure.Storage.Files.Shares.Models.NtfsFileAttributes?), string permissionKey = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata = null, Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareFileDownloadInfo StorageFileDownloadInfo(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletionTime = default(System.DateTimeOffset), string copyStatusDescription = null, string contentDisposition = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServerEncrypted = false, string cacheControl = null, string fileAttributes = null, System.Collections.Generic.IEnumerable contentEncoding = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), byte[] contentHash = null, System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string contentRange = null, string filePermissionKey = null, string contentType = null, string fileId = null, long contentLength = (long)0, string fileParentId = null, System.Collections.Generic.IDictionary metadata = null, System.IO.Stream content = null, string copyId = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, string contentRange = null, Azure.ETag eTag = default(Azure.ETag), System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServiceEncrypted = false, Azure.Storage.Files.Shares.Models.ShareLeaseDuration leaseDuration = Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite, Azure.Storage.Files.Shares.Models.ShareLeaseState leaseState = Azure.Storage.Files.Shares.Models.ShareLeaseState.Available, Azure.Storage.Files.Shares.Models.ShareLeaseStatus leaseStatus = Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentType, string contentRange, Azure.ETag eTag, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, string acceptRanges, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, byte[] fileContentHash, bool isServiceEncrypted) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, string filePermissionKey = null, string fileAttributes = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string fileId = null, string fileParentId = null, Azure.Storage.Files.Shares.Models.NfsFileMode nfsFileMode = null, string owner = null, string group = null, Azure.Storage.Files.Shares.Models.NfsFileType nfsFileType = default(Azure.Storage.Files.Shares.Models.NfsFileType)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileItem StorageFileItem(bool isDirectory, string name, long? fileSize) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, long contentLength = (long)0, string contentType = null, Azure.ETag eTag = default(Azure.ETag), byte[] contentHash = null, System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, string copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, Azure.Storage.Files.Shares.Models.NtfsFileAttributes fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } } + public enum ModeCopyMode + { + Source = 0, + Override = 1, + } + public partial class NfsFileMode + { + public NfsFileMode() { } + public bool EffectiveGroupIdentity { get { throw null; } set { } } + public bool EffectiveUserIdentity { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Group { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Other { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Owner { get { throw null; } set { } } + public bool StickyBit { get { throw null; } set { } } + public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseOctalFileMode(string modeString) { throw null; } + public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseSymbolicFileMode(string modeString) { throw null; } + public string ToOctalFileMode() { throw null; } + public override string ToString() { throw null; } + public string ToSymbolicFileMode() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NfsFileType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NfsFileType(string value) { throw null; } + public static Azure.Storage.Files.Shares.Models.NfsFileType Directory { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.NfsFileType Regular { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.NfsFileType SymLink { get { throw null; } } + public bool Equals(Azure.Storage.Files.Shares.Models.NfsFileType 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.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; } + public static implicit operator Azure.Storage.Files.Shares.Models.NfsFileType (string value) { throw null; } + public static bool operator !=(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; } + public override string ToString() { throw null; } + } [System.FlagsAttribute] public enum NtfsFileAttributes { @@ -535,6 +598,11 @@ public enum NtfsFileAttributes NotContentIndexed = 256, NoScrubData = 512, } + public enum OwnerCopyMode + { + Source = 0, + Override = 1, + } public enum PermissionCopyMode { Source = 0, @@ -545,6 +613,14 @@ public partial class PermissionInfo internal PermissionInfo() { } public string FilePermissionKey { get { throw null; } } } + [System.FlagsAttribute] + public enum PosixRolePermissions + { + None = 0, + Execute = 1, + Write = 2, + Read = 4, + } public partial class ShareAccessPolicy { public ShareAccessPolicy() { } @@ -629,6 +705,7 @@ public partial class ShareDirectoryCreateOptions public ShareDirectoryCreateOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectoryGetFilesAndDirectoriesOptions @@ -643,6 +720,7 @@ public partial class ShareDirectoryInfo internal ShareDirectoryInfo() { } public Azure.ETag ETag { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectoryProperties @@ -652,12 +730,14 @@ internal ShareDirectoryProperties() { } public bool IsServerEncrypted { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectorySetHttpHeadersOptions { public ShareDirectorySetHttpHeadersOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -767,7 +847,10 @@ public ShareFileCopyOptions() { } public Azure.Storage.Files.Shares.Models.PermissionCopyMode? FilePermissionCopyMode { get { throw null; } set { } } public bool? IgnoreReadOnly { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.ModeCopyMode? ModeCopyMode { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.OwnerCopyMode? OwnerCopyMode { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } } } @@ -777,6 +860,7 @@ public ShareFileCreateOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileDownloadDetails @@ -802,6 +886,7 @@ internal ShareFileDownloadDetails() { } public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileDownloadInfo : System.IDisposable @@ -879,6 +964,7 @@ internal ShareFileInfo() { } public Azure.ETag ETag { get { throw null; } } public bool IsServerEncrypted { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileItem @@ -967,6 +1053,7 @@ internal ShareFileProperties() { } public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileRangeInfo @@ -1008,6 +1095,7 @@ public ShareFileSetHttpHeadersOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } } public long? NewSize { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } [System.FlagsAttribute] @@ -1226,7 +1314,9 @@ public ShareSmbSettings() { } } public static partial class SharesModelFactory { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; } } public partial class ShareSnapshotInfo diff --git a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs index b1b355dda471..59961ca412ee 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/api/Azure.Storage.Files.Shares.netstandard2.0.cs @@ -115,7 +115,7 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential } public partial class ShareClientOptions : Azure.Core.ClientOptions { - public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_01_05) { } + public ShareClientOptions(Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion version = Azure.Storage.Files.Shares.ShareClientOptions.ServiceVersion.V2025_05_05) { } public bool? AllowSourceTrailingDot { get { throw null; } set { } } public bool? AllowTrailingDot { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareAudience? Audience { get { throw null; } set { } } @@ -149,6 +149,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class ShareDirectoryClient @@ -267,6 +268,8 @@ public ShareFileClient(System.Uri fileUri, Azure.Storage.StorageSharedKeyCredent public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> CreateAsync(long maxSize, Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders httpHeaders, System.Collections.Generic.IDictionary metadata, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties, string filePermission, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.Response CreateHardLink(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateHardLinkAsync(string targetFile, Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Response Delete(System.Threading.CancellationToken cancellationToken) { throw null; } @@ -494,6 +497,15 @@ public enum FilePermissionFormat Sddl = 0, Binary = 1, } + public partial class FilePosixProperties + { + public FilePosixProperties() { } + public Azure.Storage.Files.Shares.Models.NfsFileMode FileMode { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.NfsFileType? FileType { get { throw null; } } + public string Group { get { throw null; } set { } } + public long? LinkCount { get { throw null; } } + public string Owner { get { throw null; } set { } } + } public partial class FileSmbProperties { public FileSmbProperties() { } @@ -511,16 +523,67 @@ public FileSmbProperties() { } } public static partial class FilesModelFactory { + public static Azure.Storage.Files.Shares.Models.FilePosixProperties FilePosixProperties(Azure.Storage.Files.Shares.Models.NfsFileMode fileMode, string owner, string group, Azure.Storage.Files.Shares.Models.NfsFileType fileType, long? linkCount) { throw null; } + public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareFileItem ShareFileItem(bool isDirectory = false, string name = null, long? fileSize = default(long?), string id = null, Azure.Storage.Files.Shares.Models.ShareFileItemProperties properties = null, Azure.Storage.Files.Shares.Models.NtfsFileAttributes? fileAttributes = default(Azure.Storage.Files.Shares.Models.NtfsFileAttributes?), string permissionKey = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata = null, Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareDirectoryProperties StorageDirectoryProperties(System.Collections.Generic.IDictionary metadata, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } public static Azure.Storage.Files.Shares.Models.ShareFileDownloadInfo StorageFileDownloadInfo(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletionTime = default(System.DateTimeOffset), string copyStatusDescription = null, string contentDisposition = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServerEncrypted = false, string cacheControl = null, string fileAttributes = null, System.Collections.Generic.IEnumerable contentEncoding = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), byte[] contentHash = null, System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string contentRange = null, string filePermissionKey = null, string contentType = null, string fileId = null, long contentLength = (long)0, string fileParentId = null, System.Collections.Generic.IDictionary metadata = null, System.IO.Stream content = null, string copyId = null) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, string contentRange = null, Azure.ETag eTag = default(Azure.ETag), System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, string acceptRanges = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, System.Uri copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, byte[] fileContentHash = null, bool isServiceEncrypted = false, Azure.Storage.Files.Shares.Models.ShareLeaseDuration leaseDuration = Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite, Azure.Storage.Files.Shares.Models.ShareLeaseState leaseState = Azure.Storage.Files.Shares.Models.ShareLeaseState.Available, Azure.Storage.Files.Shares.Models.ShareLeaseStatus leaseStatus = Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileDownloadDetails StorageFileDownloadProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentType, string contentRange, Azure.ETag eTag, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, string acceptRanges, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, byte[] fileContentHash, bool isServiceEncrypted) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileInfo StorageFileInfo(Azure.ETag eTag = default(Azure.ETag), System.DateTimeOffset lastModified = default(System.DateTimeOffset), bool isServerEncrypted = false, string filePermissionKey = null, string fileAttributes = null, System.DateTimeOffset fileCreationTime = default(System.DateTimeOffset), System.DateTimeOffset fileLastWriteTime = default(System.DateTimeOffset), System.DateTimeOffset fileChangeTime = default(System.DateTimeOffset), string fileId = null, string fileParentId = null, Azure.Storage.Files.Shares.Models.NfsFileMode nfsFileMode = null, string owner = null, string group = null, Azure.Storage.Files.Shares.Models.NfsFileType nfsFileType = default(Azure.Storage.Files.Shares.Models.NfsFileType)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileItem StorageFileItem(bool isDirectory, string name, long? fileSize) { throw null; } + public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified = default(System.DateTimeOffset), System.Collections.Generic.IDictionary metadata = null, long contentLength = (long)0, string contentType = null, Azure.ETag eTag = default(Azure.ETag), byte[] contentHash = null, System.Collections.Generic.IEnumerable contentEncoding = null, string cacheControl = null, string contentDisposition = null, System.Collections.Generic.IEnumerable contentLanguage = null, System.DateTimeOffset copyCompletedOn = default(System.DateTimeOffset), string copyStatusDescription = null, string copyId = null, string copyProgress = null, string copySource = null, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = Azure.Storage.Files.Shares.Models.CopyStatus.Pending, bool isServerEncrypted = false, Azure.Storage.Files.Shares.Models.FileSmbProperties smbProperties = null, Azure.Storage.Files.Shares.Models.FilePosixProperties posixProperties = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, Azure.Storage.Files.Shares.Models.NtfsFileAttributes fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareFileProperties StorageFileProperties(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, System.Collections.Generic.IEnumerable contentEncoding, string cacheControl, string contentDisposition, System.Collections.Generic.IEnumerable contentLanguage, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, string copySource, Azure.Storage.Files.Shares.Models.CopyStatus copyStatus, bool isServerEncrypted, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string filePermissionKey, string fileId, string fileParentId) { throw null; } } + public enum ModeCopyMode + { + Source = 0, + Override = 1, + } + public partial class NfsFileMode + { + public NfsFileMode() { } + public bool EffectiveGroupIdentity { get { throw null; } set { } } + public bool EffectiveUserIdentity { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Group { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Other { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.PosixRolePermissions Owner { get { throw null; } set { } } + public bool StickyBit { get { throw null; } set { } } + public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseOctalFileMode(string modeString) { throw null; } + public static Azure.Storage.Files.Shares.Models.NfsFileMode ParseSymbolicFileMode(string modeString) { throw null; } + public string ToOctalFileMode() { throw null; } + public override string ToString() { throw null; } + public string ToSymbolicFileMode() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NfsFileType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NfsFileType(string value) { throw null; } + public static Azure.Storage.Files.Shares.Models.NfsFileType Directory { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.NfsFileType Regular { get { throw null; } } + public static Azure.Storage.Files.Shares.Models.NfsFileType SymLink { get { throw null; } } + public bool Equals(Azure.Storage.Files.Shares.Models.NfsFileType 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.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; } + public static implicit operator Azure.Storage.Files.Shares.Models.NfsFileType (string value) { throw null; } + public static bool operator !=(Azure.Storage.Files.Shares.Models.NfsFileType left, Azure.Storage.Files.Shares.Models.NfsFileType right) { throw null; } + public override string ToString() { throw null; } + } [System.FlagsAttribute] public enum NtfsFileAttributes { @@ -535,6 +598,11 @@ public enum NtfsFileAttributes NotContentIndexed = 256, NoScrubData = 512, } + public enum OwnerCopyMode + { + Source = 0, + Override = 1, + } public enum PermissionCopyMode { Source = 0, @@ -545,6 +613,14 @@ public partial class PermissionInfo internal PermissionInfo() { } public string FilePermissionKey { get { throw null; } } } + [System.FlagsAttribute] + public enum PosixRolePermissions + { + None = 0, + Execute = 1, + Write = 2, + Read = 4, + } public partial class ShareAccessPolicy { public ShareAccessPolicy() { } @@ -629,6 +705,7 @@ public partial class ShareDirectoryCreateOptions public ShareDirectoryCreateOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectoryGetFilesAndDirectoriesOptions @@ -643,6 +720,7 @@ public partial class ShareDirectoryInfo internal ShareDirectoryInfo() { } public Azure.ETag ETag { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectoryProperties @@ -652,12 +730,14 @@ internal ShareDirectoryProperties() { } public bool IsServerEncrypted { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareDirectorySetHttpHeadersOptions { public ShareDirectorySetHttpHeadersOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -767,7 +847,10 @@ public ShareFileCopyOptions() { } public Azure.Storage.Files.Shares.Models.PermissionCopyMode? FilePermissionCopyMode { get { throw null; } set { } } public bool? IgnoreReadOnly { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.ModeCopyMode? ModeCopyMode { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.OwnerCopyMode? OwnerCopyMode { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FilePermissionFormat? PermissionFormat { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.CopyableFileSmbProperties SmbPropertiesToCopy { get { throw null; } set { } } } @@ -777,6 +860,7 @@ public ShareFileCreateOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileDownloadDetails @@ -802,6 +886,7 @@ internal ShareFileDownloadDetails() { } public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileDownloadInfo : System.IDisposable @@ -879,6 +964,7 @@ internal ShareFileInfo() { } public Azure.ETag ETag { get { throw null; } } public bool IsServerEncrypted { get { throw null; } } public System.DateTimeOffset LastModified { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileItem @@ -966,6 +1052,7 @@ internal ShareFileProperties() { } public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get { throw null; } } public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } public partial class ShareFileRangeInfo @@ -1007,6 +1094,7 @@ public ShareFileSetHttpHeadersOptions() { } public Azure.Storage.Files.Shares.Models.ShareFilePermission FilePermission { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.ShareFileHttpHeaders HttpHeaders { get { throw null; } set { } } public long? NewSize { get { throw null; } set { } } + public Azure.Storage.Files.Shares.Models.FilePosixProperties PosixProperties { get { throw null; } set { } } public Azure.Storage.Files.Shares.Models.FileSmbProperties SmbProperties { get { throw null; } set { } } } [System.FlagsAttribute] @@ -1225,7 +1313,9 @@ public ShareSmbSettings() { } } public static partial class SharesModelFactory { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.FileSmbProperties FileSmbProperties(System.DateTimeOffset? fileChangedOn, string fileId, string parentId) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Files.Shares.Models.ShareDirectoryInfo StorageDirectoryInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string filePermissionKey, string fileAttributes, System.DateTimeOffset fileCreationTime, System.DateTimeOffset fileLastWriteTime, System.DateTimeOffset fileChangeTime, string fileId, string fileParentId) { throw null; } } public partial class ShareSnapshotInfo diff --git a/sdk/storage/Azure.Storage.Files.Shares/assets.json b/sdk/storage/Azure.Storage.Files.Shares/assets.json index c2b5c3d31e6a..8781ff7bc054 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/assets.json +++ b/sdk/storage/Azure.Storage.Files.Shares/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/storage/Azure.Storage.Files.Shares", - "Tag": "net/storage/Azure.Storage.Files.Shares_df67d82d59" + "Tag": "net/storage/Azure.Storage.Files.Shares_92c08b30c4" } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs index 2893eee8248c..2eaa2796f382 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryCreateHeaders.cs @@ -7,6 +7,7 @@ using System; using Azure.Core; +using Azure.Storage.Files.Shares.Models; namespace Azure.Storage.Files.Shares { @@ -37,5 +38,13 @@ public DirectoryCreateHeaders(Response response) public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; /// The parent fileId of the directory. public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. Type of the file or directory. + public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs index 43cac7bf4939..c7706aa60067 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryGetPropertiesHeaders.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.Storage.Files.Shares.Models; namespace Azure.Storage.Files.Shares { @@ -40,5 +41,13 @@ public DirectoryGetPropertiesHeaders(Response response) public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; /// The parent fileId of the directory. public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. Type of the file or directory. + public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs index 8a2edb8b9913..927f91370d88 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectoryRestClient.cs @@ -33,7 +33,7 @@ internal partial class DirectoryRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". + /// Specifies the version of the operation to use for this request. The default value is "2025-05-05". /// If true, the trailing dot will not be trimmed from the target URI. /// Valid value is backup. /// If true, the trailing dot will not be trimmed from the source URI. @@ -49,7 +49,7 @@ public DirectoryRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pip _allowSourceTrailingDot = allowSourceTrailingDot; } - internal HttpMessage CreateCreateRequest(string fileAttributes, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime) + internal HttpMessage CreateCreateRequest(int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -83,7 +83,10 @@ internal HttpMessage CreateCreateRequest(string fileAttributes, int? timeout, ID { request.Headers.Add("x-ms-file-permission-key", filePermissionKey); } - request.Headers.Add("x-ms-file-attributes", fileAttributes); + if (fileAttributes != null) + { + request.Headers.Add("x-ms-file-attributes", fileAttributes); + } if (fileCreationTime != null) { request.Headers.Add("x-ms-file-creation-time", fileCreationTime); @@ -100,30 +103,39 @@ internal HttpMessage CreateCreateRequest(string fileAttributes, int? timeout, ID { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (owner != null) + { + request.Headers.Add("x-ms-owner", owner); + } + if (group != null) + { + request.Headers.Add("x-ms-group", group); + } + if (fileMode != null) + { + request.Headers.Add("x-ms-mode", fileMode); + } request.Headers.Add("Accept", "application/xml"); return message; } /// Creates a new directory under the specified share or parent directory. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// A name-value pair to associate with a file storage object. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. /// The cancellation token to use. - /// is null. - public async Task> CreateAsync(string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default) + public async Task> CreateAsync(int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateCreateRequest(fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime); + using var message = CreateCreateRequest(timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new DirectoryCreateHeaders(message.Response); switch (message.Response.Status) @@ -136,25 +148,22 @@ public async Task> CreateAsync(strin } /// Creates a new directory under the specified share or parent directory. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// A name-value pair to associate with a file storage object. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. /// The cancellation token to use. - /// is null. - public ResponseWithHeaders Create(string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Create(int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateCreateRequest(fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime); + using var message = CreateCreateRequest(timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode); _pipeline.Send(message, cancellationToken); var headers = new DirectoryCreateHeaders(message.Response); switch (message.Response.Status) @@ -292,7 +301,7 @@ public ResponseWithHeaders Delete(int? timeout = null, C } } - internal HttpMessage CreateSetPropertiesRequest(string fileAttributes, int? timeout, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime) + internal HttpMessage CreateSetPropertiesRequest(int? timeout, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -319,7 +328,10 @@ internal HttpMessage CreateSetPropertiesRequest(string fileAttributes, int? time { request.Headers.Add("x-ms-file-permission-key", filePermissionKey); } - request.Headers.Add("x-ms-file-attributes", fileAttributes); + if (fileAttributes != null) + { + request.Headers.Add("x-ms-file-attributes", fileAttributes); + } if (fileCreationTime != null) { request.Headers.Add("x-ms-file-creation-time", fileCreationTime); @@ -340,29 +352,38 @@ internal HttpMessage CreateSetPropertiesRequest(string fileAttributes, int? time { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (owner != null) + { + request.Headers.Add("x-ms-owner", owner); + } + if (group != null) + { + request.Headers.Add("x-ms-group", group); + } + if (fileMode != null) + { + request.Headers.Add("x-ms-mode", fileMode); + } request.Headers.Add("Accept", "application/xml"); return message; } /// Sets properties on the directory. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. /// The cancellation token to use. - /// is null. - public async Task> SetPropertiesAsync(string fileAttributes, int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default) + public async Task> SetPropertiesAsync(int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateSetPropertiesRequest(fileAttributes, timeout, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime); + using var message = CreateSetPropertiesRequest(timeout, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new DirectorySetPropertiesHeaders(message.Response); switch (message.Response.Status) @@ -375,24 +396,21 @@ public async Task> SetPropert } /// Sets properties on the directory. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. /// The cancellation token to use. - /// is null. - public ResponseWithHeaders SetProperties(string fileAttributes, int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders SetProperties(int? timeout = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateSetPropertiesRequest(fileAttributes, timeout, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime); + using var message = CreateSetPropertiesRequest(timeout, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode); _pipeline.Send(message, cancellationToken); var headers = new DirectorySetPropertiesHeaders(message.Response); switch (message.Response.Status) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs index 122579967f52..70c784d9fcd7 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/DirectorySetPropertiesHeaders.cs @@ -37,5 +37,11 @@ public DirectorySetPropertiesHeaders(Response response) public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; /// The parent fileId of the directory. public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHardLinkHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHardLinkHeaders.cs new file mode 100644 index 000000000000..0760e0e32c2a --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHardLinkHeaders.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Storage.Files.Shares.Models; + +namespace Azure.Storage.Files.Shares +{ + internal partial class FileCreateHardLinkHeaders + { + private readonly Response _response; + public FileCreateHardLinkHeaders(Response response) + { + _response = response; + } + /// Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. + public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null; + /// Indicates the version of the File service used to execute the request. + public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Creation time for the file. + public DateTimeOffset? FileCreationTime => _response.Headers.TryGetValue("x-ms-file-creation-time", out DateTimeOffset? value) ? value : null; + /// Last write time for the file. + public DateTimeOffset? FileLastWriteTime => _response.Headers.TryGetValue("x-ms-file-last-write-time", out DateTimeOffset? value) ? value : null; + /// Change time for the file. + public DateTimeOffset? FileChangeTime => _response.Headers.TryGetValue("x-ms-file-change-time", out DateTimeOffset? value) ? value : null; + /// The fileId of the file. + public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; + /// The parent fileId of the directory. + public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The link count of the file or directory. + public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. Type of the file or directory. + public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null; + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs index 69e1975f86c7..5a28bfff5489 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateHeaders.cs @@ -7,6 +7,7 @@ using System; using Azure.Core; +using Azure.Storage.Files.Shares.Models; namespace Azure.Storage.Files.Shares { @@ -37,5 +38,13 @@ public FileCreateHeaders(Response response) public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; /// The parent fileId of the file. public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. Type of the file or directory. + public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateSymbolicLinkHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateSymbolicLinkHeaders.cs new file mode 100644 index 000000000000..bda9480cdb73 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileCreateSymbolicLinkHeaders.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Storage.Files.Shares.Models; + +namespace Azure.Storage.Files.Shares +{ + internal partial class FileCreateSymbolicLinkHeaders + { + private readonly Response _response; + public FileCreateSymbolicLinkHeaders(Response response) + { + _response = response; + } + /// Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. + public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null; + /// Indicates the version of the File service used to execute the request. + public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// Creation time for the file. + public DateTimeOffset? FileCreationTime => _response.Headers.TryGetValue("x-ms-file-creation-time", out DateTimeOffset? value) ? value : null; + /// Last write time for the file. + public DateTimeOffset? FileLastWriteTime => _response.Headers.TryGetValue("x-ms-file-last-write-time", out DateTimeOffset? value) ? value : null; + /// Change time for the file. + public DateTimeOffset? FileChangeTime => _response.Headers.TryGetValue("x-ms-file-change-time", out DateTimeOffset? value) ? value : null; + /// The fileId of the file. + public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; + /// The parent fileId of the directory. + public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. Type of the file or directory. + public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null; + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs index b1db3dbf3963..131cec8d9c14 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDeleteHeaders.cs @@ -18,5 +18,7 @@ public FileDeleteHeaders(Response response) } /// Indicates the version of the File service used to execute the request. public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// NFS only. The link count of the file or directory. + public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs index c4d7056a5cfa..174d478602c2 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileDownloadHeaders.cs @@ -83,5 +83,13 @@ public FileDownloadHeaders(Response response) public string StructuredBodyType => _response.Headers.TryGetValue("x-ms-structured-body", out string value) ? value : null; /// The length of the blob/file content inside the message body when the response body is returned as a structured message. Will always be smaller than Content-Length. public long? StructuredContentLength => _response.Headers.TryGetValue("x-ms-structured-content-length", out long? value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. The link count of the file or directory. + public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs index 4e2050c13c06..29e642249add 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetPropertiesHeaders.cs @@ -75,5 +75,15 @@ public FileGetPropertiesHeaders(Response response) public ShareLeaseState? LeaseState => _response.Headers.TryGetValue("x-ms-lease-state", out string value) ? value.ToShareLeaseState() : null; /// The current lease status of the file. public ShareLeaseStatus? LeaseStatus => _response.Headers.TryGetValue("x-ms-lease-status", out string value) ? value.ToShareLeaseStatus() : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. The link count of the file or directory. + public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null; + /// NFS only. Type of the file or directory. + public NfsFileType? NfsFileType => _response.Headers.TryGetValue("x-ms-file-file-type", out string value) ? new NfsFileType(value) : (NfsFileType?)null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetSymbolicLinkHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetSymbolicLinkHeaders.cs new file mode 100644 index 000000000000..255a50bc98f9 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileGetSymbolicLinkHeaders.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Storage.Files.Shares +{ + internal partial class FileGetSymbolicLinkHeaders + { + private readonly Response _response; + public FileGetSymbolicLinkHeaders(Response response) + { + _response = response; + } + /// Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. + public DateTimeOffset? LastModified => _response.Headers.TryGetValue("Last-Modified", out DateTimeOffset? value) ? value : null; + /// Indicates the version of the File service used to execute the request. + public string Version => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null; + /// The path to the original file, the symbolic link is pointing to. The path is of type string which is not resolved and is stored as is. The path can be absolute path or the relative path depending on the content stored in the symbolic link file. + public string LinkText => _response.Headers.TryGetValue("x-ms-link-text", out string value) ? value : null; + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs index 07f88af545ae..0800d2818937 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs @@ -34,7 +34,7 @@ internal partial class FileRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". + /// Specifies the version of the operation to use for this request. The default value is "2025-05-05". /// Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range. The default value is "update". /// If true, the trailing dot will not be trimmed from the target URI. /// Valid value is backup. @@ -52,7 +52,7 @@ public FileRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline _allowSourceTrailingDot = allowSourceTrailingDot; } - internal HttpMessage CreateCreateRequest(long fileContentLength, string fileAttributes, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateCreateRequest(long fileContentLength, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode, NfsFileType? nfsFileType, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -111,7 +111,10 @@ internal HttpMessage CreateCreateRequest(long fileContentLength, string fileAttr { request.Headers.Add("x-ms-file-permission-key", filePermissionKey); } - request.Headers.Add("x-ms-file-attributes", fileAttributes); + if (fileAttributes != null) + { + request.Headers.Add("x-ms-file-attributes", fileAttributes); + } if (fileCreationTime != null) { request.Headers.Add("x-ms-file-creation-time", fileCreationTime); @@ -132,33 +135,47 @@ internal HttpMessage CreateCreateRequest(long fileContentLength, string fileAttr { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (owner != null) + { + request.Headers.Add("x-ms-owner", owner); + } + if (group != null) + { + request.Headers.Add("x-ms-group", group); + } + if (fileMode != null) + { + request.Headers.Add("x-ms-mode", fileMode); + } + if (nfsFileType != null) + { + request.Headers.Add("x-ms-file-file-type", nfsFileType.Value.ToString()); + } request.Headers.Add("Accept", "application/xml"); return message; } /// Creates a new file or replaces a file. Note it only initializes the file with no content. /// Specifies the maximum size for the file, up to 4 TB. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// A name-value pair to associate with a file storage object. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. + /// Optional, NFS only. Type of the file or directory. /// Parameter group. /// Parameter group. /// The cancellation token to use. - /// is null. - public async Task> CreateAsync(long fileContentLength, string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> CreateAsync(long fileContentLength, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, NfsFileType? nfsFileType = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateCreateRequest(fileContentLength, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions); + using var message = CreateCreateRequest(fileContentLength, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, nfsFileType, fileHttpHeaders, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new FileCreateHeaders(message.Response); switch (message.Response.Status) @@ -172,27 +189,25 @@ public async Task> CreateAsync(long fileC /// Creates a new file or replaces a file. Note it only initializes the file with no content. /// Specifies the maximum size for the file, up to 4 TB. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// A name-value pair to associate with a file storage object. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. + /// Optional, NFS only. Type of the file or directory. /// Parameter group. /// Parameter group. /// The cancellation token to use. - /// is null. - public ResponseWithHeaders Create(long fileContentLength, string fileAttributes, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders Create(long fileContentLength, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, NfsFileType? nfsFileType = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateCreateRequest(fileContentLength, fileAttributes, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions); + using var message = CreateCreateRequest(fileContentLength, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, nfsFileType, fileHttpHeaders, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new FileCreateHeaders(message.Response); switch (message.Response.Status) @@ -432,7 +447,7 @@ public ResponseWithHeaders Delete(int? timeout = null, ShareF } } - internal HttpMessage CreateSetHttpHeadersRequest(string fileAttributes, int? timeout, long? fileContentLength, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateSetHttpHeadersRequest(int? timeout, long? fileContentLength, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string fileAttributes, string fileCreationTime, string fileLastWriteTime, string fileChangeTime, string owner, string group, string fileMode, FileHttpHeaders fileHttpHeaders, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -486,7 +501,10 @@ internal HttpMessage CreateSetHttpHeadersRequest(string fileAttributes, int? tim { request.Headers.Add("x-ms-file-permission-key", filePermissionKey); } - request.Headers.Add("x-ms-file-attributes", fileAttributes); + if (fileAttributes != null) + { + request.Headers.Add("x-ms-file-attributes", fileAttributes); + } if (fileCreationTime != null) { request.Headers.Add("x-ms-file-creation-time", fileCreationTime); @@ -511,32 +529,41 @@ internal HttpMessage CreateSetHttpHeadersRequest(string fileAttributes, int? tim { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (owner != null) + { + request.Headers.Add("x-ms-owner", owner); + } + if (group != null) + { + request.Headers.Add("x-ms-group", group); + } + if (fileMode != null) + { + request.Headers.Add("x-ms-mode", fileMode); + } request.Headers.Add("Accept", "application/xml"); return message; } /// Sets HTTP headers on the file. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// Resizes a file to the specified size. If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. /// Parameter group. /// Parameter group. /// The cancellation token to use. - /// is null. - public async Task> SetHttpHeadersAsync(string fileAttributes, int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> SetHttpHeadersAsync(int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateSetHttpHeadersRequest(fileAttributes, timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions); + using var message = CreateSetHttpHeadersRequest(timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, fileHttpHeaders, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new FileSetHttpHeadersHeaders(message.Response); switch (message.Response.Status) @@ -549,27 +576,24 @@ public async Task> SetHttpHeaders } /// Sets HTTP headers on the file. - /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. /// Resizes a file to the specified size. If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared. /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. /// Creation time for the file/directory. Default value: Now. /// Last write time for the file/directory. Default value: Now. /// Change time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. /// Parameter group. /// Parameter group. /// The cancellation token to use. - /// is null. - public ResponseWithHeaders SetHttpHeaders(string fileAttributes, int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders SetHttpHeaders(int? timeout = null, long? fileContentLength = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string fileAttributes = null, string fileCreationTime = null, string fileLastWriteTime = null, string fileChangeTime = null, string owner = null, string group = null, string fileMode = null, FileHttpHeaders fileHttpHeaders = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { - if (fileAttributes == null) - { - throw new ArgumentNullException(nameof(fileAttributes)); - } - - using var message = CreateSetHttpHeadersRequest(fileAttributes, timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, fileHttpHeaders, shareFileRequestConditions); + using var message = CreateSetHttpHeadersRequest(timeout, fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, fileMode, fileHttpHeaders, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new FileSetHttpHeadersHeaders(message.Response); switch (message.Response.Status) @@ -1308,7 +1332,7 @@ public ResponseWithHeaders GetRange } } - internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, CopyFileSmbInfo copyFileSmbInfo, ShareFileRequestConditions shareFileRequestConditions) + internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDictionary metadata, string filePermission, FilePermissionFormat? filePermissionFormat, string filePermissionKey, string owner, string group, string fileMode, ModeCopyMode? fileModeCopyMode, OwnerCopyMode? fileOwnerCopyMode, CopyFileSmbInfo copyFileSmbInfo, ShareFileRequestConditions shareFileRequestConditions) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1382,6 +1406,26 @@ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDi { request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); } + if (owner != null) + { + request.Headers.Add("x-ms-owner", owner); + } + if (group != null) + { + request.Headers.Add("x-ms-group", group); + } + if (fileMode != null) + { + request.Headers.Add("x-ms-mode", fileMode); + } + if (fileModeCopyMode != null) + { + request.Headers.Add("x-ms-file-mode-copy-mode", fileModeCopyMode.Value.ToSerialString()); + } + if (fileOwnerCopyMode != null) + { + request.Headers.Add("x-ms-file-owner-copy-mode", fileOwnerCopyMode.Value.ToSerialString()); + } request.Headers.Add("Accept", "application/xml"); return message; } @@ -1393,18 +1437,23 @@ internal HttpMessage CreateStartCopyRequest(string copySource, int? timeout, IDi /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. + /// NFS only. Applicable only when the copy source is a File. Determines the copy behavior of the mode bits of the file. source: The mode on the destination file is copied from the source file. override: The mode on the destination file is determined via the x-ms-mode header. + /// NFS only. Determines the copy behavior of the owner user identifier (UID) and group identifier (GID) of the file. source: The owner user identifier (UID) and group identifier (GID) on the destination file is copied from the source file. override: The owner user identifier (UID) and group identifier (GID) on the destination file is determined via the x-ms-owner and x-ms-group headers. /// Parameter group. /// Parameter group. /// The cancellation token to use. /// is null. - public async Task> StartCopyAsync(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public async Task> StartCopyAsync(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string owner = null, string group = null, string fileMode = null, ModeCopyMode? fileModeCopyMode = null, OwnerCopyMode? fileOwnerCopyMode = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { if (copySource == null) { throw new ArgumentNullException(nameof(copySource)); } - using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions); + using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, shareFileRequestConditions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new FileStartCopyHeaders(message.Response); switch (message.Response.Status) @@ -1423,18 +1472,23 @@ public async Task> StartCopyAsync(stri /// If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. /// Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission. /// Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Optional, NFS only. The file mode of the file or directory. + /// NFS only. Applicable only when the copy source is a File. Determines the copy behavior of the mode bits of the file. source: The mode on the destination file is copied from the source file. override: The mode on the destination file is determined via the x-ms-mode header. + /// NFS only. Determines the copy behavior of the owner user identifier (UID) and group identifier (GID) of the file. source: The owner user identifier (UID) and group identifier (GID) on the destination file is copied from the source file. override: The owner user identifier (UID) and group identifier (GID) on the destination file is determined via the x-ms-owner and x-ms-group headers. /// Parameter group. /// Parameter group. /// The cancellation token to use. /// is null. - public ResponseWithHeaders StartCopy(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + public ResponseWithHeaders StartCopy(string copySource, int? timeout = null, IDictionary metadata = null, string filePermission = null, FilePermissionFormat? filePermissionFormat = null, string filePermissionKey = null, string owner = null, string group = null, string fileMode = null, ModeCopyMode? fileModeCopyMode = null, OwnerCopyMode? fileOwnerCopyMode = null, CopyFileSmbInfo copyFileSmbInfo = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) { if (copySource == null) { throw new ArgumentNullException(nameof(copySource)); } - using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, copyFileSmbInfo, shareFileRequestConditions); + using var message = CreateStartCopyRequest(copySource, timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, shareFileRequestConditions); _pipeline.Send(message, cancellationToken); var headers = new FileStartCopyHeaders(message.Response); switch (message.Response.Status) @@ -1859,5 +1913,250 @@ public ResponseWithHeaders Rename(string renameSource, int? t throw new RequestFailedException(message.Response); } } + + internal HttpMessage CreateCreateSymbolicLinkRequest(string linkText, int? timeout, IDictionary metadata, string fileCreationTime, string fileLastWriteTime, string owner, string group, ShareFileRequestConditions shareFileRequestConditions) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_url, false); + uri.AppendQuery("restype", "symboliclink", true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + request.Uri = uri; + request.Headers.Add("x-ms-version", _version); + if (metadata != null) + { + request.Headers.Add("x-ms-meta-", metadata); + } + if (fileCreationTime != null) + { + request.Headers.Add("x-ms-file-creation-time", fileCreationTime); + } + if (fileLastWriteTime != null) + { + request.Headers.Add("x-ms-file-last-write-time", fileLastWriteTime); + } + if (shareFileRequestConditions?.LeaseId != null) + { + request.Headers.Add("x-ms-lease-id", shareFileRequestConditions.LeaseId); + } + if (owner != null) + { + request.Headers.Add("x-ms-owner", owner); + } + if (group != null) + { + request.Headers.Add("x-ms-group", group); + } + request.Headers.Add("x-ms-link-text", linkText); + if (_fileRequestIntent != null) + { + request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); + } + request.Headers.Add("Accept", "application/xml"); + return message; + } + + /// Creates a symbolic link. + /// NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is of type string which is not resolved and is stored as is. The path can be absolute path or the relative path depending on the content stored in the symbolic link file. + /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. + /// A name-value pair to associate with a file storage object. + /// Creation time for the file/directory. Default value: Now. + /// Last write time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Parameter group. + /// The cancellation token to use. + /// is null. + public async Task> CreateSymbolicLinkAsync(string linkText, int? timeout = null, IDictionary metadata = null, string fileCreationTime = null, string fileLastWriteTime = null, string owner = null, string group = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + { + if (linkText == null) + { + throw new ArgumentNullException(nameof(linkText)); + } + + using var message = CreateCreateSymbolicLinkRequest(linkText, timeout, metadata, fileCreationTime, fileLastWriteTime, owner, group, shareFileRequestConditions); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new FileCreateSymbolicLinkHeaders(message.Response); + switch (message.Response.Status) + { + case 201: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a symbolic link. + /// NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is of type string which is not resolved and is stored as is. The path can be absolute path or the relative path depending on the content stored in the symbolic link file. + /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. + /// A name-value pair to associate with a file storage object. + /// Creation time for the file/directory. Default value: Now. + /// Last write time for the file/directory. Default value: Now. + /// Optional, NFS only. The owner of the file or directory. + /// Optional, NFS only. The owning group of the file or directory. + /// Parameter group. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders CreateSymbolicLink(string linkText, int? timeout = null, IDictionary metadata = null, string fileCreationTime = null, string fileLastWriteTime = null, string owner = null, string group = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + { + if (linkText == null) + { + throw new ArgumentNullException(nameof(linkText)); + } + + using var message = CreateCreateSymbolicLinkRequest(linkText, timeout, metadata, fileCreationTime, fileLastWriteTime, owner, group, shareFileRequestConditions); + _pipeline.Send(message, cancellationToken); + var headers = new FileCreateSymbolicLinkHeaders(message.Response); + switch (message.Response.Status) + { + case 201: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSymbolicLinkRequest(int? timeout, string sharesnapshot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_url, false); + uri.AppendQuery("restype", "symboliclink", true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + if (sharesnapshot != null) + { + uri.AppendQuery("sharesnapshot", sharesnapshot, true); + } + request.Uri = uri; + request.Headers.Add("x-ms-version", _version); + if (_fileRequestIntent != null) + { + request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); + } + request.Headers.Add("Accept", "application/xml"); + return message; + } + + /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. + /// The cancellation token to use. + public async Task> GetSymbolicLinkAsync(int? timeout = null, string sharesnapshot = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetSymbolicLinkRequest(timeout, sharesnapshot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new FileGetSymbolicLinkHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. + /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. + /// The cancellation token to use. + public ResponseWithHeaders GetSymbolicLink(int? timeout = null, string sharesnapshot = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetSymbolicLinkRequest(timeout, sharesnapshot); + _pipeline.Send(message, cancellationToken); + var headers = new FileGetSymbolicLinkHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateHardLinkRequest(string targetFile, int? timeout, ShareFileRequestConditions shareFileRequestConditions) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(_url, false); + uri.AppendQuery("restype", "hardlink", true); + if (timeout != null) + { + uri.AppendQuery("timeout", timeout.Value, true); + } + request.Uri = uri; + request.Headers.Add("x-ms-version", _version); + request.Headers.Add("x-ms-type", "file"); + if (shareFileRequestConditions?.LeaseId != null) + { + request.Headers.Add("x-ms-lease-id", shareFileRequestConditions.LeaseId); + } + request.Headers.Add("x-ms-file-target-file", targetFile); + if (_fileRequestIntent != null) + { + request.Headers.Add("x-ms-file-request-intent", _fileRequestIntent.Value.ToString()); + } + request.Headers.Add("Accept", "application/xml"); + return message; + } + + /// Creates a hard link. + /// NFS only. Required. Specifies the path of the target file to which the link will be created, up to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share and hence the same storage account. + /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. + /// Parameter group. + /// The cancellation token to use. + /// is null. + public async Task> CreateHardLinkAsync(string targetFile, int? timeout = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + { + if (targetFile == null) + { + throw new ArgumentNullException(nameof(targetFile)); + } + + using var message = CreateCreateHardLinkRequest(targetFile, timeout, shareFileRequestConditions); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new FileCreateHardLinkHeaders(message.Response); + switch (message.Response.Status) + { + case 201: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a hard link. + /// NFS only. Required. Specifies the path of the target file to which the link will be created, up to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share and hence the same storage account. + /// The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>. + /// Parameter group. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders CreateHardLink(string targetFile, int? timeout = null, ShareFileRequestConditions shareFileRequestConditions = null, CancellationToken cancellationToken = default) + { + if (targetFile == null) + { + throw new ArgumentNullException(nameof(targetFile)); + } + + using var message = CreateCreateHardLinkRequest(targetFile, timeout, shareFileRequestConditions); + _pipeline.Send(message, cancellationToken); + var headers = new FileCreateHardLinkHeaders(message.Response); + switch (message.Response.Status) + { + case 201: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs index ff2030851669..cb6c9cb38d06 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileSetHttpHeadersHeaders.cs @@ -37,5 +37,13 @@ public FileSetHttpHeadersHeaders(Response response) public string FileId => _response.Headers.TryGetValue("x-ms-file-id", out string value) ? value : null; /// The parent fileId of the directory. public string FileParentId => _response.Headers.TryGetValue("x-ms-file-parent-id", out string value) ? value : null; + /// NFS only. The mode of the file or directory. + public string FileMode => _response.Headers.TryGetValue("x-ms-mode", out string value) ? value : null; + /// NFS only. The owner of the file or directory. + public string Owner => _response.Headers.TryGetValue("x-ms-owner", out string value) ? value : null; + /// NFS only. The owning group of the file or directory. + public string Group => _response.Headers.TryGetValue("x-ms-group", out string value) ? value : null; + /// NFS only. The link count of the file or directory. + public long? LinkCount => _response.Headers.TryGetValue("x-ms-link-count", out long? value) ? value : null; } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.Serialization.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.Serialization.cs new file mode 100644 index 000000000000..40e7ec8999e7 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Storage.Files.Shares.Models +{ + internal static partial class ModeCopyModeExtensions + { + public static string ToSerialString(this ModeCopyMode value) => value switch + { + ModeCopyMode.Source => "source", + ModeCopyMode.Override => "override", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ModeCopyMode value.") + }; + + public static ModeCopyMode ToModeCopyMode(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "source")) return ModeCopyMode.Source; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "override")) return ModeCopyMode.Override; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ModeCopyMode value."); + } + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.cs new file mode 100644 index 000000000000..517b6cd1e07f --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/ModeCopyMode.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Storage.Files.Shares.Models +{ + /// The ModeCopyMode. + public enum ModeCopyMode + { + /// source. + Source, + /// override. + Override + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/NfsFileType.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/NfsFileType.cs new file mode 100644 index 000000000000..efc9c74d412e --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/NfsFileType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Storage.Files.Shares.Models +{ + /// The NfsFileType. + public readonly partial struct NfsFileType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NfsFileType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegularValue = "Regular"; + private const string DirectoryValue = "Directory"; + private const string SymLinkValue = "SymLink"; + + /// Regular. + public static NfsFileType Regular { get; } = new NfsFileType(RegularValue); + /// Directory. + public static NfsFileType Directory { get; } = new NfsFileType(DirectoryValue); + /// SymLink. + public static NfsFileType SymLink { get; } = new NfsFileType(SymLinkValue); + /// Determines if two values are the same. + public static bool operator ==(NfsFileType left, NfsFileType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NfsFileType left, NfsFileType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NfsFileType(string value) => new NfsFileType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NfsFileType other && Equals(other); + /// + public bool Equals(NfsFileType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.Serialization.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.Serialization.cs new file mode 100644 index 000000000000..38bc10e4d598 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Storage.Files.Shares.Models +{ + internal static partial class OwnerCopyModeExtensions + { + public static string ToSerialString(this OwnerCopyMode value) => value switch + { + OwnerCopyMode.Source => "source", + OwnerCopyMode.Override => "override", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OwnerCopyMode value.") + }; + + public static OwnerCopyMode ToOwnerCopyMode(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "source")) return OwnerCopyMode.Source; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "override")) return OwnerCopyMode.Override; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OwnerCopyMode value."); + } + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.cs new file mode 100644 index 000000000000..6d12e8c85591 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/Models/OwnerCopyMode.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Storage.Files.Shares.Models +{ + /// The OwnerCopyMode. + public enum OwnerCopyMode + { + /// source. + Source, + /// override. + Override + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs index fe5ea495a7a1..d3182cfe4d21 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ServiceRestClient.cs @@ -31,7 +31,7 @@ internal partial class ServiceRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". + /// Specifies the version of the operation to use for this request. The default value is "2025-05-05". /// Valid value is backup. /// , , or is null. public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, ShareTokenIntent? fileRequestIntent = null) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs index 69bb02404dd4..7740558db7a4 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/ShareRestClient.cs @@ -32,7 +32,7 @@ internal partial class ShareRestClient /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The URL of the service account, share, directory or file that is the target of the desired operation. - /// Specifies the version of the operation to use for this request. The default value is "2025-01-05". + /// Specifies the version of the operation to use for this request. The default value is "2025-05-05". /// Valid value is backup. /// , , or is null. public ShareRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version, ShareTokenIntent? fileRequestIntent = null) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/FilePosixProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FilePosixProperties.cs new file mode 100644 index 000000000000..84f1a02dd1cc --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FilePosixProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma warning disable SA1402 // File may only contain a single type + +using System.Collections.Generic; +using System; + +namespace Azure.Storage.Files.Shares.Models +{ + /// + /// NFS properties. + /// Note that these properties only apply to files or directories in + /// premium NFS file accounts. + /// + public class FilePosixProperties + { + /// + /// Optional. Version TBD and newer. The mode permissions to be set on the file or directory. + /// + public NfsFileMode FileMode { get; set; } + + /// + /// Optional. The owner user identifier (UID) to be set on the file or directory. The default value is 0 (root). + /// + public string Owner { get; set; } + + /// + /// Optional. The owner group identifier (GID) to be set on the file or directory. The default value is 0 (root group). + /// + public string Group { get; set; } + + /// + /// Optional, only applicable to files. The type of the file. The default value is . + /// + public NfsFileType? FileType { get; internal set; } + + /// + /// The link count of the file or directory. + /// + public long? LinkCount { get; internal set; } + } + + /// + /// FilesModelFactory provides utilities for mocking. + /// + public static partial class FilesModelFactory + { + /// + /// Creates a new StorageFileDownloadProperties instance for mocking. + /// + public static FilePosixProperties FilePosixProperties( + NfsFileMode fileMode, + string owner, + string group, + NfsFileType fileType, + long? linkCount) + { + return new FilePosixProperties + { + FileMode = fileMode, + Owner = owner, + Group = group, + FileType = fileType, + LinkCount = linkCount + }; + } + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs index 4c8569cc28e6..4a6069bc9eaa 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/FileSmbProperties.cs @@ -74,14 +74,34 @@ public override bool Equals(object other) public override int GetHashCode() => base.GetHashCode(); } - /// - /// FilesModelFactory provides utilities for mocking. - /// + /// + /// FilesModelFactory provides utilities for mocking. + /// + public static partial class FilesModelFactory + { + /// + /// Creates a new FileSmbProperties instance for mocking. + /// + public static FileSmbProperties FileSmbProperties( + DateTimeOffset? fileChangedOn, + string fileId, + string parentId) => new FileSmbProperties + { + FileChangedOn = fileChangedOn, + FileId = fileId, + ParentId = parentId + }; + } + + /// + /// FilesModelFactory provides utilities for mocking. + /// public static partial class SharesModelFactory { /// /// Creates a new FileSmbProperties instance for mocking. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static FileSmbProperties FileSmbProperties( DateTimeOffset? fileChangedOn, string fileId, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/NfsFileMode.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/NfsFileMode.cs new file mode 100644 index 000000000000..d1271a4e52ac --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/NfsFileMode.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Globalization; +using System.Text; + +namespace Azure.Storage.Files.Shares.Models +{ + /// + /// The mode permissions of the file or directory. + /// + public class NfsFileMode + { + /// + /// Permissions the owner has over the file or directory. + /// + public PosixRolePermissions Owner { get; set; } + + /// + /// Permissions the group has over the file or directory. + /// + public PosixRolePermissions Group { get; set; } + + /// + /// Permissions other have over the file or directory. + /// + public PosixRolePermissions Other { get; set; } + + /// + /// Set effective user ID (setuid) on the file or directory. + /// + public bool EffectiveUserIdentity { get; set; } + + /// + /// Set effective group ID (setgid) on the file or directory. + /// + public bool EffectiveGroupIdentity { get; set; } + + /// + /// The sticky bit may be set on directories. The files in that + /// directory may only be renamed or deleted by the file's owner, the directory's owner, or the root user. + /// + public bool StickyBit { get; set; } + + /// + /// Returns the octal represenation of this as a string. + /// + public string ToOctalFileMode() + { + // https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation + StringBuilder stringBuilder = new StringBuilder(); + + int higherOrderDigit = 0; + + if (EffectiveUserIdentity) + { + higherOrderDigit |= 4; + } + + if (EffectiveGroupIdentity) + { + higherOrderDigit |= 2; + } + + if (StickyBit) + { + higherOrderDigit |= 1; + } + + stringBuilder.Append(higherOrderDigit.ToString(CultureInfo.InvariantCulture)); + stringBuilder.Append(Owner.ToOctalRolePermissions()); + stringBuilder.Append(Group.ToOctalRolePermissions()); + stringBuilder.Append(Other.ToOctalRolePermissions()); + return stringBuilder.ToString(); + } + + /// + /// Returns a from the octal string representation. + /// + /// + /// A 4-digit octal string representation of a File Mode. + /// + public static NfsFileMode ParseOctalFileMode(string modeString) + { + // https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation + if (modeString == null) + { + return null; + } + + if (modeString.Length != 4) + { + throw Errors.InvalidFormat(nameof(modeString)); + } + + NfsFileMode nfsFileMode = new NfsFileMode + { + Owner = RolePermissionExtensions.ParseOctalRolePermissions(modeString[1]), + Group = RolePermissionExtensions.ParseOctalRolePermissions(modeString[2]), + Other = RolePermissionExtensions.ParseOctalRolePermissions(modeString[3]) + }; + + int value = (int)char.GetNumericValue(modeString[0]); + + if ((value & 4) > 0) + { + nfsFileMode.EffectiveUserIdentity = true; + } + + if ((value & 2) > 0) + { + nfsFileMode.EffectiveGroupIdentity = true; + } + + if ((value & 1) > 0) + { + nfsFileMode.StickyBit = true; + } + + return nfsFileMode; + } + + /// + /// Returns this as a string in symbolic notation. + /// + public string ToSymbolicFileMode() + { + // https://en.wikipedia.org/wiki/File-system_permissions#Symbolic_notation + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(Owner.ToSymbolicRolePermissions()); + stringBuilder.Append(Group.ToSymbolicRolePermissions()); + stringBuilder.Append(Other.ToSymbolicRolePermissions()); + + if (EffectiveUserIdentity) + { + if (stringBuilder[2] == 'x') + { + stringBuilder[2] = 's'; + } + else + { + stringBuilder[2] = 'S'; + } + } + + if (EffectiveGroupIdentity) + { + if (stringBuilder[5] == 'x') + { + stringBuilder[5] = 's'; + } + else + { + stringBuilder[5] = 'S'; + } + } + + if (StickyBit) + { + if (stringBuilder[8] == 'x') + { + stringBuilder[8] = 't'; + } + else + { + stringBuilder[8] = 'T'; + } + } + return stringBuilder.ToString(); + } + /// + /// Returns a from the symbolic string representation. + /// + /// + /// A 9-character symbolic string representation of a File Mode. + /// + public static NfsFileMode ParseSymbolicFileMode(string modeString) + { + // https://en.wikipedia.org/wiki/File-system_permissions#Symbolic_notation + if (modeString == null) + { + return null; + } + + if (modeString.Length != 9) + { + throw Errors.InvalidFormat(nameof(modeString)); + } + + NfsFileMode nfsFileMode = new NfsFileMode(); + + nfsFileMode.Owner = RolePermissionExtensions.ParseSymbolicRolePermissions(modeString.Substring(0, 3), out bool effectiveUserIdentity); + nfsFileMode.EffectiveUserIdentity = effectiveUserIdentity; + + nfsFileMode.Group = RolePermissionExtensions.ParseSymbolicRolePermissions(modeString.Substring(3, 3), out bool effectiveGroupIdentity); + nfsFileMode.EffectiveGroupIdentity = effectiveGroupIdentity; + + nfsFileMode.Other = RolePermissionExtensions.ParseSymbolicRolePermissions(modeString.Substring(6, 3), out bool stickyBit); + nfsFileMode.StickyBit = stickyBit; + + return nfsFileMode; + } + + /// + public override string ToString() => ToSymbolicFileMode(); + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/PosixRolePermissions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/PosixRolePermissions.cs new file mode 100644 index 000000000000..6f7cf6d54967 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/PosixRolePermissions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Azure.Storage.Files.Shares.Models +{ + /// + /// Represents file permissions for a specific role. + /// + [Flags] + public enum PosixRolePermissions + { + /// + /// No permissions. + /// + None = 0, + + /// + /// The execute permission. + /// + Execute = 1, + + /// + /// The write permission. + /// + Write = 2, + + /// + /// The read permission. + /// + Read = 4, + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/RolePermissionExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/RolePermissionExtensions.cs new file mode 100644 index 000000000000..dfb65f0af884 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/RolePermissionExtensions.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Globalization; +using System.Text; + +namespace Azure.Storage.Files.Shares.Models +{ + /// + /// Extension methods for . + /// + internal static class RolePermissionExtensions + { + /// + /// Parses octal char to RolePermissions. + /// + public static PosixRolePermissions ParseOctalRolePermissions(char c) + { + PosixRolePermissions rolePermissions = PosixRolePermissions.None; + + int value = (int)char.GetNumericValue(c); + + if (value < 0 || value > 7) + { + throw Errors.MustBeBetweenInclusive(nameof(c), 0, 7, value); + } + + if ((value & 4) > 0) + { + rolePermissions |= PosixRolePermissions.Read; + } + + if ((value & 2) > 0) + { + rolePermissions |= PosixRolePermissions.Write; + } + + if ((value & 1) > 0) + { + rolePermissions |= PosixRolePermissions.Execute; + } + + return rolePermissions; + } + + /// + /// Returns the octal string representation of this RolePermissions. + /// + public static string ToOctalRolePermissions(this PosixRolePermissions rolePermissions) + { + int result = 0; + + if (rolePermissions.HasFlag(PosixRolePermissions.Read)) + { + result |= 4; + } + + if (rolePermissions.HasFlag(PosixRolePermissions.Write)) + { + result |= 2; + } + + if (rolePermissions.HasFlag(PosixRolePermissions.Execute)) + { + result |= 1; + } + + return result.ToString(CultureInfo.InvariantCulture); + } + + /// + /// Returns the symbolic string representation of this RolePermissions. + /// + public static string ToSymbolicRolePermissions(this PosixRolePermissions rolePermissions) + { + StringBuilder stringBuilder = new StringBuilder(); + + if (rolePermissions.HasFlag(PosixRolePermissions.Read)) + { + stringBuilder.Append("r"); + } + else + { + stringBuilder.Append("-"); + } + + if (rolePermissions.HasFlag(PosixRolePermissions.Write)) + { + stringBuilder.Append("w"); + } + else + { + stringBuilder.Append("-"); + } + + if (rolePermissions.HasFlag(PosixRolePermissions.Execute)) + { + stringBuilder.Append("x"); + } + else + { + stringBuilder.Append("-"); + } + + return stringBuilder.ToString(); + } + + public static PosixRolePermissions ParseSymbolicRolePermissions(string s, out bool setSticky) + { + if (s == null) + { + throw new ArgumentNullException("s"); + } + if (s.Length != 3) + { + throw new FormatException($"s must be 3 characters long"); + } + + PosixRolePermissions rolePermissions = new PosixRolePermissions(); + setSticky = false; + + // Read character + if (s[0] == 'r') + { + rolePermissions |= PosixRolePermissions.Read; + } + else if (s[0] != '-') + { + throw new ArgumentException($"Invalid character in symbolic role permission: {s[0]}"); + } + + // Write character + if (s[1] == 'w') + { + rolePermissions |= PosixRolePermissions.Write; + } + else if (s[1] != '-') + { + throw new ArgumentException($"Invalid character in symbolic role permission: {s[1]}"); + } + + // Execute character + if (s[2] == 'x' || s[2] == 's' || s[2] == 't') + { + rolePermissions |= PosixRolePermissions.Execute; + if (s[2] == 's' || s[2] == 't') + { + setSticky = true; + } + } + if (s[2] == 'S' || s[2] == 'T') + { + setSticky = true; + } + + if (s[2] != 'x' && s[2] != 's' && s[2] != 'S' && s[2] != 't' && s[2] != 'T' && s[2] != '-') + { + throw new ArgumentException($"Invalid character in symbolic role permission: {s[2]}"); + } + + return rolePermissions; + } + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs index 929ad0adc9e3..018e2ab43520 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryCreateOptions.cs @@ -24,5 +24,13 @@ public class ShareDirectoryCreateOptions /// Optional file permission to set on the directory. /// public ShareFilePermission FilePermission { get; set; } + + /// + /// + /// Optional properties to set on NFS directories. + /// Note that this property is only applicable to directories created in NFS shares. + /// + /// + public FilePosixProperties PosixProperties { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs index 1d9f258b79ca..5f9527be6fa3 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryInfo.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text; #pragma warning disable SA1402 // File may only contain a single type @@ -30,12 +31,40 @@ public class ShareDirectoryInfo /// public FileSmbProperties SmbProperties { get; set; } + /// + /// The directory's NFS properties. + /// Only applicable to files in a NFS share. + /// + public FilePosixProperties PosixProperties { get; internal set; } + /// /// Constructor. /// internal ShareDirectoryInfo() { } } + /// + /// FilesModelFactory provides utilities for mocking. + /// + public static partial class FilesModelFactory + { + /// + /// Creates a new StorageDirectoryInfo instance for mocking. + /// + public static ShareDirectoryInfo StorageDirectoryInfo( + ETag eTag = default, + DateTimeOffset lastModified = default, + FileSmbProperties smbProperties = default, + FilePosixProperties posixProperties = default) + => new ShareDirectoryInfo + { + ETag = eTag, + LastModified = lastModified, + SmbProperties = smbProperties, + PosixProperties = posixProperties, + }; + } + /// /// FilesModelFactory provides utilities for mocking. /// @@ -44,6 +73,7 @@ public static partial class SharesModelFactory /// /// Creates a new StorageDirectoryInfo instance for mocking. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ShareDirectoryInfo StorageDirectoryInfo( ETag eTag, DateTimeOffset lastModified, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs index b225e512ac38..2300c581cd82 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectoryProperties.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text; #pragma warning disable SA1402 // File may only contain a single type @@ -41,6 +42,12 @@ public class ShareDirectoryProperties /// public FileSmbProperties SmbProperties { get; set; } + /// + /// NFS properties. + /// Note that this property is only applicable to directories created in NFS shares. + /// + public FilePosixProperties PosixProperties { get; internal set; } + /// /// Constructor. /// @@ -55,6 +62,28 @@ public static partial class FilesModelFactory /// /// Creates a new StorageDirectoryProperties instance for mocking. /// + public static ShareDirectoryProperties StorageDirectoryProperties( + IDictionary metadata = default, + ETag eTag = default, + DateTimeOffset lastModified = default, + bool isServerEncrypted = default, + FileSmbProperties smbProperties = default, + FilePosixProperties posixProperties = default + ) + => new ShareDirectoryProperties + { + Metadata = metadata, + ETag = eTag, + LastModified = lastModified, + IsServerEncrypted = isServerEncrypted, + SmbProperties = smbProperties, + PosixProperties = posixProperties + }; + + /// + /// Creates a new StorageDirectoryProperties instance for mocking. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ShareDirectoryProperties StorageDirectoryProperties( IDictionary metadata, ETag eTag, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs index 9c07466061b1..d45a01d3ba30 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareDirectorySetHttpHeadersOptions.cs @@ -18,5 +18,11 @@ public class ShareDirectorySetHttpHeadersOptions /// Optional file permission to set for the directory. /// public ShareFilePermission FilePermission { get; set; } + + /// + /// Optional properties to set on NFS files. + /// Note that this property is only applicable to directories created in NFS shares. + /// + public FilePosixProperties PosixProperties { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs index d74113002f18..57ac32b4adde 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCopyOptions.cs @@ -64,5 +64,22 @@ public class ShareFileCopyOptions /// SMB properties to copy from the source file. /// public CopyableFileSmbProperties SmbPropertiesToCopy { get; set; } + + /// + /// Only applicable to NFS Files. NFS properties to set on the destination file. + /// + public FilePosixProperties PosixProperties { get; set; } + + /// + /// Optional, only applicable to NFS Files. + /// If not populated, the desination file will have the default File Mode. + /// + public ModeCopyMode? ModeCopyMode { get; set; } + + /// + /// Optional, only applicable to NFS Files. + /// If not populated, the desination file will have the default Owner and Group. + /// + public OwnerCopyMode? OwnerCopyMode { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs index 9f3a51732183..aabd3b3cc3b4 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateOptions.cs @@ -22,6 +22,7 @@ public class ShareFileCreateOptions /// /// Optional SMB properties to set for the file. + /// Note that this property is only applicable to files created in SMB shares. /// public FileSmbProperties SmbProperties { get; set; } @@ -29,5 +30,11 @@ public class ShareFileCreateOptions /// Optional file permission to set on file. /// public ShareFilePermission FilePermission { get; set; } + + /// + /// Optional properties to set on NFS files. + /// Note that this property is only applicable to files created in NFS shares. + /// + public FilePosixProperties PosixProperties { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateSymbolicLinkOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateSymbolicLinkOptions.cs new file mode 100644 index 000000000000..7efafb00c3e1 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileCreateSymbolicLinkOptions.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Metadata = System.Collections.Generic.IDictionary; + +namespace Azure.Storage.Files.Shares.Models +{ + /// + /// NFS only. Options for creating a symbolic link. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal class ShareFileCreateSymbolicLinkOptions + { + /// + /// Optional custom metadata to set for the symbolic link. + /// + public Metadata Metadata { get; set; } + + /// + /// The creation time of the symbolic link. + /// + public DateTimeOffset? FileCreatedOn { get; set; } + + /// + /// The last write time of the symbolic link. + /// + public DateTimeOffset? FileLastWrittenOn { get; set; } + + /// + /// Optional. The owner user identifier (UID) to be set on the symbolic link. The default value is 0 (root). + /// + public string Owner { get; set; } + + /// + /// Optional. The owner group identifier (GID) to be set on the symbolic link. The default value is 0 (root group). + /// + public string Group { get; set; } + + /// + /// Optional to add conditions + /// on creating the symbolic link. + /// + public ShareFileRequestConditions Conditions { get; set; } + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs index 8de847b910f6..011af2e84cf8 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileDownloadDetails.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; #pragma warning disable SA1402 // File may only contain a single type @@ -122,10 +123,16 @@ public partial class ShareFileDownloadDetails public ShareLeaseStatus LeaseStatus { get; internal set; } /// - /// The SMB properties for the file + /// The SMB properties for the file. /// public FileSmbProperties SmbProperties { get; set; } + /// + /// NFS properties. + /// Note that this property is only applicable to files created in NFS shares. + /// + public FilePosixProperties PosixProperties { get; internal set; } + /// /// Constructor. /// @@ -140,6 +147,60 @@ public static partial class FilesModelFactory /// /// Creates a new StorageFileDownloadProperties instance for mocking. /// + public static ShareFileDownloadDetails StorageFileDownloadProperties( + DateTimeOffset lastModified = default, + IDictionary metadata = default, + string contentRange = default, + ETag eTag = default, + IEnumerable contentEncoding = default, + string cacheControl = default, + string contentDisposition = default, + IEnumerable contentLanguage = default, + string acceptRanges = default, + DateTimeOffset copyCompletedOn = default, + string copyStatusDescription = default, + string copyId = default, + string copyProgress = default, + Uri copySource = default, + CopyStatus copyStatus = default, + byte[] fileContentHash = default, + bool isServiceEncrypted = default, + ShareLeaseDuration leaseDuration = default, + ShareLeaseState leaseState = default, + ShareLeaseStatus leaseStatus = default, + FileSmbProperties smbProperties = default, + FilePosixProperties posixProperties = default) + { + return new ShareFileDownloadDetails + { + LastModified = lastModified, + Metadata = metadata, + ContentRange = contentRange, + ETag = eTag, + ContentEncoding = contentEncoding, + CacheControl = cacheControl, + ContentDisposition = contentDisposition, + ContentLanguage = contentLanguage, + AcceptRanges = acceptRanges, + CopyCompletedOn = copyCompletedOn, + CopyStatusDescription = copyStatusDescription, + CopyId = copyId, + CopyProgress = copyProgress, + CopySource = copySource, + CopyStatus = copyStatus, + FileContentHash = fileContentHash, + IsServerEncrypted = isServiceEncrypted, + LeaseDuration = leaseDuration, + LeaseState = leaseState, + SmbProperties = smbProperties, + PosixProperties = posixProperties, + }; + } + + /// + /// Creates a new StorageFileDownloadProperties instance for mocking. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ShareFileDownloadDetails StorageFileDownloadProperties( DateTimeOffset lastModified, IDictionary metadata, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs index 46212582505f..29ce3b2f834b 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileInfo.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text; #pragma warning disable SA1402 // File may only contain a single type @@ -31,9 +32,16 @@ public class ShareFileInfo /// /// The file's SMB properties. + /// Only applicable to files in a SMB share. /// public FileSmbProperties SmbProperties { get; set; } + /// + /// The file's NFS properties. + /// Only applicable to files in a NFS share. + /// + public FilePosixProperties PosixProperties { get; internal set; } + /// /// Constructor. /// @@ -48,6 +56,49 @@ public static partial class FilesModelFactory /// /// Creates a new StorageFileInfo instance for mocking. /// + public static ShareFileInfo StorageFileInfo( + ETag eTag = default, + DateTimeOffset lastModified = default, + bool isServerEncrypted = default, + string filePermissionKey = default, + string fileAttributes = default, + DateTimeOffset fileCreationTime = default, + DateTimeOffset fileLastWriteTime = default, + DateTimeOffset fileChangeTime = default, + string fileId = default, + string fileParentId = default, + NfsFileMode nfsFileMode = default, + string owner = default, + string group = default, + NfsFileType nfsFileType = default) + => new ShareFileInfo + { + ETag = eTag, + LastModified = lastModified, + IsServerEncrypted = isServerEncrypted, + SmbProperties = new FileSmbProperties + { + FileAttributes = ShareModelExtensions.ToFileAttributes(fileAttributes), + FilePermissionKey = filePermissionKey, + FileCreatedOn = fileCreationTime, + FileLastWrittenOn = fileLastWriteTime, + FileChangedOn = fileChangeTime, + FileId = fileId, + ParentId = fileParentId + }, + PosixProperties = new FilePosixProperties + { + FileMode = nfsFileMode, + Owner = owner, + Group = group, + FileType = nfsFileType, + } + }; + + /// + /// Creates a new StorageFileInfo instance for mocking. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ShareFileInfo StorageFileInfo( ETag eTag, DateTimeOffset lastModified, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs index 05715a8e12b6..722a99361a8e 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileProperties.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; #pragma warning disable SA1402 // File may only contain a single type @@ -119,6 +120,12 @@ public class ShareFileProperties /// public ShareLeaseStatus LeaseStatus { get; internal set; } + /// + /// NFS properties. + /// Note that this property is only applicable to files created in NFS shares. + /// + public FilePosixProperties PosixProperties { get; internal set; } + /// /// Constructor. /// @@ -133,6 +140,53 @@ public static partial class FilesModelFactory /// /// Creates a new StorageFileProperties instance for mocking. /// + public static ShareFileProperties StorageFileProperties( + DateTimeOffset lastModified = default, + IDictionary metadata = default, + long contentLength = default, + string contentType = default, + ETag eTag = default, + byte[] contentHash = default, + IEnumerable contentEncoding = default, + string cacheControl = default, + string contentDisposition = default, + IEnumerable contentLanguage = default, + DateTimeOffset copyCompletedOn = default, + string copyStatusDescription = default, + string copyId = default, + string copyProgress = default, + string copySource = default, + CopyStatus copyStatus = default, + bool isServerEncrypted = default, + FileSmbProperties smbProperties = default, + FilePosixProperties posixProperties = default + ) => new ShareFileProperties + { + LastModified = lastModified, + Metadata = metadata, + ContentLength = contentLength, + ContentType = contentType, + ETag = eTag, + ContentHash = contentHash, + ContentEncoding = contentEncoding, + CacheControl = cacheControl, + ContentDisposition = contentDisposition, + ContentLanguage = contentLanguage, + CopyCompletedOn = copyCompletedOn, + CopyStatusDescription = copyStatusDescription, + CopyId = copyId, + CopyProgress = copyProgress, + CopySource = copySource, + CopyStatus = copyStatus, + IsServerEncrypted = isServerEncrypted, + SmbProperties = smbProperties, + PosixProperties = posixProperties, + }; + + /// + /// Creates a new StorageFileProperties instance for mocking. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ShareFileProperties StorageFileProperties( DateTimeOffset lastModified, IDictionary metadata, @@ -194,6 +248,7 @@ string fileParentId /// /// Creates a new StorageFileProperties instance for mocking. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ShareFileProperties StorageFileProperties( DateTimeOffset lastModified, IDictionary metadata, diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs index 3f73e0e99e75..6b3e95eae9c0 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSetHttpHeadersOptions.cs @@ -31,5 +31,11 @@ public class ShareFileSetHttpHeadersOptions /// Optional file permission to set for the file. /// public ShareFilePermission FilePermission { get; set; } + + /// + /// Optional properties to set on NFS files. + /// Note that this property is only applicable to files created in NFS shares. + /// + public FilePosixProperties PosixProperties { get; set; } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSymbolicLinkInfo.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSymbolicLinkInfo.cs new file mode 100644 index 000000000000..990ac2ec5fce --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Models/ShareFileSymbolicLinkInfo.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma warning disable SA1402 // File may only contain a single type + +using System; + +namespace Azure.Storage.Files.Shares.Models +{ + /// + /// Infomation about a Symbolic Link. + /// Only applicable to NFS files. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal class ShareFileSymbolicLinkInfo + { + /// + /// The ETag contains a value which represents the version of the file, in quotes. + /// + public ETag ETag { get; internal set; } + + /// + /// Returns the date and time the file was last modified. + /// + public DateTimeOffset LastModified { get; internal set; } + + /// + /// Text of the symbolic link. + /// + public string LinkText { get; internal set; } + } + + public static partial class SharesModelFactory + { + /// + /// Creates a new FileSymolicLinkInfo for mocking. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal static ShareFileSymbolicLinkInfo FileSymbolicLinkInfo( + ETag eTag = default, + DateTimeOffset lastModified = default, + string linkText = default) + => new ShareFileSymbolicLinkInfo + { + ETag = eTag, + LastModified = lastModified, + LinkText = linkText + }; + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs index 75d4430e5b26..b1289a14422e 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs @@ -3710,6 +3710,7 @@ public virtual Response CreateDirectory( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, async: false, cancellationToken, operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}") @@ -3765,6 +3766,7 @@ public virtual Response CreateDirectory( smbProperties, filePermission, filePermissionFormat: null, + posixProperties: null, async: false, cancellationToken, operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}") @@ -3809,6 +3811,7 @@ public virtual async Task> CreateDirectoryAsync( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, async: true, cancellationToken, operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}") @@ -3864,6 +3867,7 @@ public virtual async Task> CreateDirectoryAsync( smbProperties, filePermission, filePermissionFormat: null, + posixProperties: null, async: true, cancellationToken, operationName: $"{nameof(ShareClient)}.{nameof(CreateDirectory)}") diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs index 30c5ab3b0515..e536e194a80d 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareClientOptions.cs @@ -153,7 +153,12 @@ public enum ServiceVersion /// /// The 2025-01-05 service version. /// - V2025_01_05 = 25 + V2025_01_05 = 25, + + /// + /// The 2025-05-05 service version. + /// + V2025_05_05 = 26 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs index 1deeef8b6c6d..4b1d45d8a65d 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs @@ -561,6 +561,7 @@ public virtual Response Create( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, async: false, // async cancellationToken: cancellationToken) .EnsureCompleted(); @@ -607,6 +608,7 @@ public virtual Response Create( smbProperties, filePermission, filePermissionFormat: null, + posixProperties: null, false, // async cancellationToken) .EnsureCompleted(); @@ -642,6 +644,7 @@ await CreateInternal( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, async: true, cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -688,6 +691,7 @@ await CreateInternal( smbProperties, filePermission, filePermissionFormat: null, + posixProperties: null, true, // async cancellationToken) .ConfigureAwait(false); @@ -712,6 +716,9 @@ await CreateInternal( /// /// Optional file permission format. /// + /// + /// Optional NFS properties. + /// /// /// Whether to invoke the operation asynchronously. /// @@ -735,6 +742,7 @@ internal async Task> CreateInternal( FileSmbProperties smbProperties, string filePermission, FilePermissionFormat? filePermissionFormat, + FilePosixProperties posixProperties, bool async, CancellationToken cancellationToken, string operationName = default) @@ -754,38 +762,40 @@ internal async Task> CreateInternal( FileSmbProperties smbProps = smbProperties ?? new FileSmbProperties(); ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey); - if (filePermission == null && smbProps.FilePermissionKey == null) - { - filePermission = Constants.File.FilePermissionInherit; - } ResponseWithHeaders response; if (async) { response = await DirectoryRestClient.CreateAsync( - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, + fileAttributes: smbProps?.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps?.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps?.FileLastWrittenOn.ToFileDateTimeString(), metadata: metadata, filePermission: filePermission, filePermissionFormat: filePermissionFormat, - filePermissionKey: smbProps.FilePermissionKey, - fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + filePermissionKey: smbProps?.FilePermissionKey, + fileChangeTime: smbProps?.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), cancellationToken: cancellationToken) .ConfigureAwait(false); } else { response = DirectoryRestClient.Create( - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, + fileAttributes: smbProps?.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps?.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps?.FileLastWrittenOn.ToFileDateTimeString(), metadata: metadata, filePermission: filePermission, filePermissionFormat: filePermissionFormat, - filePermissionKey: smbProps.FilePermissionKey, - fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + filePermissionKey: smbProps?.FilePermissionKey, + fileChangeTime: smbProps?.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), cancellationToken: cancellationToken); } @@ -841,6 +851,7 @@ public virtual Response CreateIfNotExists( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, async: false, cancellationToken).EnsureCompleted(); @@ -887,6 +898,7 @@ public virtual Response CreateIfNotExists( smbProperties, filePermission, filePermissionFormat: null, + posixProperties: null, async: false, cancellationToken).EnsureCompleted(); @@ -922,6 +934,7 @@ await CreateIfNotExistsInternal( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, async: true, cancellationToken: cancellationToken).ConfigureAwait(false); @@ -968,6 +981,7 @@ await CreateIfNotExistsInternal( smbProperties, filePermission, filePermissionFormat: null, + posixProperties: null, async: true, cancellationToken).ConfigureAwait(false); @@ -992,6 +1006,9 @@ await CreateIfNotExistsInternal( /// /// Optional file permission format. /// + /// + /// Optional NFS properties. + /// /// /// Whether to invoke the operation asynchronously. /// @@ -1015,6 +1032,7 @@ internal async Task> CreateIfNotExistsInternal( FileSmbProperties smbProperties, string filePermission, FilePermissionFormat? filePermissionFormat, + FilePosixProperties posixProperties, bool async, CancellationToken cancellationToken, string operationName = default) @@ -1031,6 +1049,7 @@ internal async Task> CreateIfNotExistsInternal( smbProperties, filePermission, filePermissionFormat, + posixProperties, async, cancellationToken, operationName: operationName ?? $"{nameof(ShareDirectoryClient)}.{nameof(CreateIfNotExists)}") @@ -1566,6 +1585,7 @@ public virtual Response SetHttpHeaders( options?.SmbProperties, options?.FilePermission?.Permission, options?.FilePermission?.PermissionFormat, + options?.PosixProperties, false, // async cancellationToken) .EnsureCompleted(); @@ -1598,6 +1618,7 @@ await SetHttpHeadersInternal( options?.SmbProperties, options?.FilePermission?.Permission, options?.FilePermission?.PermissionFormat, + options?.PosixProperties, true, // async cancellationToken) .ConfigureAwait(false); @@ -1639,6 +1660,7 @@ public virtual Response SetHttpHeaders( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, false, // async cancellationToken) .EnsureCompleted(); @@ -1678,6 +1700,7 @@ await SetHttpHeadersInternal( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, true, // async cancellationToken) .ConfigureAwait(false); @@ -1699,6 +1722,9 @@ await SetHttpHeadersInternal( /// /// Optional file permission format. /// + /// + /// Optional NFS properties. + /// /// /// Whether to invoke the operation asynchronously. /// @@ -1718,6 +1744,7 @@ private async Task> SetHttpHeadersInternal( FileSmbProperties smbProperties, string filePermission, FilePermissionFormat? filePermissionFormat, + FilePosixProperties posixProperties, bool async, CancellationToken cancellationToken) { @@ -1736,36 +1763,38 @@ private async Task> SetHttpHeadersInternal( FileSmbProperties smbProps = smbProperties ?? new FileSmbProperties(); ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey); - if (filePermission == null && smbProps.FilePermissionKey == null) - { - filePermission = Constants.File.Preserve; - } ResponseWithHeaders response; if (async) { response = await DirectoryRestClient.SetPropertiesAsync( - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve, + fileAttributes: smbProps?.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(), filePermission: filePermission, filePermissionFormat: filePermissionFormat, filePermissionKey: smbProps.FilePermissionKey, fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), cancellationToken: cancellationToken) .ConfigureAwait(false); } else { response = DirectoryRestClient.SetProperties( - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve, + fileAttributes: smbProps?.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(), filePermission: filePermission, filePermissionFormat: filePermissionFormat, filePermissionKey: smbProps.FilePermissionKey, fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), cancellationToken: cancellationToken); } @@ -2863,7 +2892,7 @@ private async Task> RenameInternal( CopyFileSmbInfo copyFileSmbInfo = new CopyFileSmbInfo { - FileAttributes = options?.SmbProperties?.FileAttributes?.ToAttributesString(), + FileAttributes = options?.SmbProperties?.FileAttributes.ToAttributesString(), FileCreationTime = options?.SmbProperties?.FileCreatedOn.ToFileDateTimeString(), FileLastWriteTime = options?.SmbProperties?.FileLastWrittenOn.ToFileDateTimeString(), FileChangeTime = options?.SmbProperties?.FileChangedOn.ToFileDateTimeString(), diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs index 4d7a0950ab0d..d616f072cf67 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareExtensions.cs @@ -6,7 +6,9 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; +using System.Text.RegularExpressions; using Azure.Core; using Azure.Storage.Files.Shares.Models; @@ -16,14 +18,14 @@ internal static partial class ShareExtensions { internal static void AssertValidFilePermissionAndKey(string filePermission, string filePermissionKey) { - if (filePermission != null && filePermissionKey != null) + if (filePermission != null && Encoding.UTF8.GetByteCount(filePermission) > Constants.File.MaxFilePermissionHeaderSize) { - throw Errors.CannotBothBeNotNull(nameof(filePermission), nameof(filePermissionKey)); + throw Errors.MustBeLessThanOrEqualTo(nameof(filePermission), Constants.File.MaxFilePermissionHeaderSize); } - if (filePermission != null && Encoding.UTF8.GetByteCount(filePermission) > Constants.File.MaxFilePermissionHeaderSize) + if (filePermission != null && filePermissionKey != null) { - throw Errors.MustBeLessThanOrEqualTo(nameof(filePermission), Constants.File.MaxFilePermissionHeaderSize); + throw new ArgumentException("filePermission and filePermissionKey cannot both be set"); } } @@ -113,6 +115,13 @@ internal static ShareDirectoryInfo ToShareDirectoryInfo(this ResponseWithHeaders FileChangedOn = response.Headers.FileChangeTime, FileId = response.Headers.FileId, ParentId = response.Headers.FileParentId + }, + PosixProperties = new FilePosixProperties + { + FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode), + Owner = response.Headers.Owner, + Group = response.Headers.Group, + FileType = response.Headers.NfsFileType, } }; } @@ -138,6 +147,13 @@ internal static ShareDirectoryProperties ToShareDirectoryProperties(this Respons FileChangedOn = response.Headers.FileChangeTime, FileId = response.Headers.FileId, ParentId = response.Headers.FileParentId + }, + PosixProperties = new FilePosixProperties() + { + FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode), + Owner = response.Headers.Owner, + Group = response.Headers.Group, + FileType = response.Headers.NfsFileType, } }; } @@ -161,6 +177,12 @@ internal static ShareDirectoryInfo ToShareDirectoryInfo(this ResponseWithHeaders FileChangedOn = response.Headers.FileChangeTime, FileId = response.Headers.FileId, ParentId = response.Headers.FileParentId + }, + PosixProperties = new FilePosixProperties + { + FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode), + Owner = response.Headers.Owner, + Group = response.Headers.Group } }; } @@ -279,7 +301,7 @@ internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders response) @@ -347,7 +378,15 @@ internal static ShareFileProperties ToShareFileProperties(this ResponseWithHeade }, LeaseDuration = response.Headers.LeaseDuration.GetValueOrDefault(), LeaseState = response.Headers.LeaseState.GetValueOrDefault(), - LeaseStatus = response.Headers.LeaseStatus.GetValueOrDefault() + LeaseStatus = response.Headers.LeaseStatus.GetValueOrDefault(), + PosixProperties = new FilePosixProperties() + { + FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode), + Owner = response.Headers.Owner, + Group = response.Headers.Group, + FileType = response.Headers.NfsFileType, + LinkCount = response.Headers.LinkCount + } }; if (response.Headers.ContentEncoding != null) @@ -383,6 +422,13 @@ internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders ToShareFilePermission(this Respons }, response.GetRawResponse()); } + + internal static ShareFileSymbolicLinkInfo ToFileSymbolicLinkInfo(this ResponseWithHeaders response) + { + if (response == null) + { + return null; + } + + return new ShareFileSymbolicLinkInfo + { + ETag = response.GetRawResponse().Headers.TryGetValue(Constants.HeaderNames.ETag, out string value) ? new ETag(value) : default, + LastModified = response.Headers.LastModified.GetValueOrDefault(), + LinkText = response.Headers.LinkText + }; + } + + internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders response) + { + if (response == null) + { + return null; + } + return new ShareFileInfo + { + ETag = response.GetRawResponse().Headers.TryGetValue(Constants.HeaderNames.ETag, out string value) ? new ETag(value) : default, + LastModified = response.Headers.LastModified.GetValueOrDefault(), + SmbProperties = new FileSmbProperties + { + FileCreatedOn = response.Headers.FileCreationTime, + FileLastWrittenOn = response.Headers.FileLastWriteTime, + FileChangedOn = response.Headers.FileChangeTime, + FileId = response.Headers.FileId, + ParentId = response.Headers.FileParentId + }, + PosixProperties = new FilePosixProperties() + { + FileType = response.Headers.NfsFileType, + FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode), + Owner = response.Headers.Owner, + Group = response.Headers.Group + } + }; + } + + internal static ShareFileInfo ToShareFileInfo(this ResponseWithHeaders response) + { + if (response == null) + { + return null; + } + return new ShareFileInfo + { + ETag = response.GetRawResponse().Headers.TryGetValue(Constants.HeaderNames.ETag, out string value) ? new ETag(value) : default, + LastModified = response.Headers.LastModified.GetValueOrDefault(), + SmbProperties = new FileSmbProperties + { + FileCreatedOn = response.Headers.FileCreationTime, + FileLastWrittenOn = response.Headers.FileLastWriteTime, + FileChangedOn = response.Headers.FileChangeTime, + FileId = response.Headers.FileId, + ParentId = response.Headers.FileParentId + }, + PosixProperties = new FilePosixProperties() + { + FileMode = NfsFileMode.ParseOctalFileMode(response.Headers.FileMode), + Owner = response.Headers.Owner, + Group = response.Headers.Group, + LinkCount = response.Headers.LinkCount, + FileType = response.Headers.NfsFileType + } + }; + } } } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs index f713200a524d..3b204c64c3b5 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs @@ -15,6 +15,7 @@ using Azure.Storage.Sas; using Metadata = System.Collections.Generic.IDictionary; using Azure.Storage.Common; +using System.Net.Http.Headers; #pragma warning disable SA1402 // File may only contain a single type @@ -129,7 +130,7 @@ public virtual string Path /// public virtual bool CanGenerateSasUri => ClientConfiguration.SharedKeyCredential != null; - //const string fileType = "file"; + //const string filetype = "file"; //// FileMaxUploadRangeBytes indicates the maximum number of bytes that can be sent in a call to UploadRange. //public const Int64 FileMaxUploadRangeBytes = 4 * Constants.MB; // 4MB @@ -578,6 +579,7 @@ public virtual Response Create( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, conditions, async: false, cancellationToken) @@ -628,6 +630,7 @@ await CreateInternal( smbProperties: options?.SmbProperties, filePermission: options?.FilePermission?.Permission, filePermissionFormat: options?.FilePermission?.PermissionFormat, + posixProperties: options?.PosixProperties, conditions, async: true, cancellationToken) @@ -693,6 +696,7 @@ public virtual Response Create( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions, async: false, cancellationToken) @@ -753,6 +757,7 @@ public virtual Response Create( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions: default, async: false, cancellationToken) @@ -818,6 +823,7 @@ await CreateInternal( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions, async: true, cancellationToken) @@ -878,6 +884,7 @@ await CreateInternal( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions: default, async: true, cancellationToken) @@ -912,6 +919,9 @@ await CreateInternal( /// /// Optional file permission format. /// + /// + /// Optional NFS properties. + /// /// /// Optional to add conditions /// on creating the file. @@ -941,6 +951,7 @@ private async Task> CreateInternal( FileSmbProperties smbProperties, string filePermission, FilePermissionFormat? filePermissionFormat, + FilePosixProperties posixProperties, ShareFileRequestConditions conditions, bool async, CancellationToken cancellationToken, @@ -965,21 +976,20 @@ private async Task> CreateInternal( ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey); - if (filePermission == null && smbProps.FilePermissionKey == null) - { - filePermission = Constants.File.FilePermissionInherit; - } - ResponseWithHeaders response; if (async) { response = await FileRestClient.CreateAsync( fileContentLength: maxSize, - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, + fileAttributes: smbProps.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(), fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), + nfsFileType: posixProperties?.FileType, metadata: metadata, filePermission: filePermission, filePermissionFormat: filePermissionFormat, @@ -993,10 +1003,14 @@ private async Task> CreateInternal( { response = FileRestClient.Create( fileContentLength: maxSize, - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.FileAttributesNone, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.FileTimeNow, + fileAttributes: smbProps.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(), fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), + nfsFileType: posixProperties?.FileType, metadata: metadata, filePermission: filePermission, filePermissionFormat: filePermissionFormat, @@ -1308,6 +1322,9 @@ public virtual Response StartCopy( setArchiveAttribute: options?.Archive, conditions: options?.Conditions, copyableFileSmbProperties: options?.SmbPropertiesToCopy, + posixProperties: options?.PosixProperties, + modeCopyMode: options?.ModeCopyMode, + ownerCopyMode: options?.OwnerCopyMode, async: false, cancellationToken: cancellationToken) .EnsureCompleted(); @@ -1385,6 +1402,9 @@ public virtual Response StartCopy( setArchiveAttribute, conditions, copyableFileSmbProperties: default, + posixProperties: default, + modeCopyMode: default, + ownerCopyMode: default, async: false, cancellationToken) .EnsureCompleted(); @@ -1432,6 +1452,9 @@ public virtual Response StartCopy( setArchiveAttribute: default, conditions: default, copyableFileSmbProperties: default, + posixProperties: default, + modeCopyMode: default, + ownerCopyMode: default, async: false, cancellationToken) .EnsureCompleted(); @@ -1476,6 +1499,9 @@ await StartCopyInternal( setArchiveAttribute: options?.Archive, conditions: options?.Conditions, copyableFileSmbProperties: options?.SmbPropertiesToCopy, + posixProperties: options?.PosixProperties, + modeCopyMode: options?.ModeCopyMode, + ownerCopyMode: options?.OwnerCopyMode, async: true, cancellationToken: cancellationToken). ConfigureAwait(false); @@ -1553,6 +1579,9 @@ await StartCopyInternal( setArchiveAttribute, conditions, copyableFileSmbProperties: default, + posixProperties: default, + modeCopyMode: default, + ownerCopyMode: default, async: true, cancellationToken). ConfigureAwait(false); @@ -1600,6 +1629,9 @@ await StartCopyInternal( setArchiveAttribute: default, conditions: default, copyableFileSmbProperties: default, + posixProperties: default, + modeCopyMode: default, + ownerCopyMode: default, async: true, cancellationToken). ConfigureAwait(false); @@ -1647,6 +1679,17 @@ await StartCopyInternal( /// /// SMB properties to copy from the source file. /// + /// + /// NFS files only. NFS properties to set on the destination file. + /// + /// + /// Optional, only applicable to NFS Files. + /// If not populated, the desination file will have the default File Mode. + /// + /// + /// Optional, only applicable to NFS Files. + /// If not populated, the desination file will have the default Owner and Group. + /// /// /// Whether to invoke the operation asynchronously. /// @@ -1673,6 +1716,9 @@ private async Task> StartCopyInternal( bool? setArchiveAttribute, ShareFileRequestConditions conditions, CopyableFileSmbProperties? copyableFileSmbProperties, + FilePosixProperties posixProperties, + ModeCopyMode? modeCopyMode, + OwnerCopyMode? ownerCopyMode, bool async, CancellationToken cancellationToken) { @@ -1723,7 +1769,7 @@ private async Task> StartCopyInternal( } else { - fileAttributes = smbProperties?.FileAttributes?.ToAttributesString(); + fileAttributes = smbProperties?.FileAttributes.ToAttributesString(); } string fileCreatedOn = null; @@ -1780,6 +1826,11 @@ private async Task> StartCopyInternal( filePermission: filePermission, filePermissionFormat: filePermissionFormat, filePermissionKey: smbProperties?.FilePermissionKey, + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), + fileModeCopyMode: modeCopyMode, + fileOwnerCopyMode: ownerCopyMode, copyFileSmbInfo: copyFileSmbInfo, shareFileRequestConditions: conditions, cancellationToken: cancellationToken) @@ -1793,6 +1844,11 @@ private async Task> StartCopyInternal( filePermission: filePermission, filePermissionFormat: filePermissionFormat, filePermissionKey: smbProperties?.FilePermissionKey, + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode?.ToOctalFileMode(), + fileModeCopyMode: modeCopyMode, + fileOwnerCopyMode: ownerCopyMode, copyFileSmbInfo: copyFileSmbInfo, shareFileRequestConditions: conditions, cancellationToken: cancellationToken); @@ -3395,6 +3451,7 @@ public virtual Response SetHttpHeaders( options?.SmbProperties, options?.FilePermission?.Permission, options?.FilePermission?.PermissionFormat, + options?.PosixProperties, conditions, async: false, cancellationToken) @@ -3437,6 +3494,7 @@ await SetHttpHeadersInternal( options?.SmbProperties, options?.FilePermission?.Permission, options?.FilePermission?.PermissionFormat, + options?.PosixProperties, conditions, async: true, cancellationToken) @@ -3497,6 +3555,7 @@ public virtual Response SetHttpHeaders( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions, async: false, cancellationToken) @@ -3553,6 +3612,7 @@ public virtual Response SetHttpHeaders( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions: default, async: false, cancellationToken) @@ -3613,6 +3673,7 @@ await SetHttpHeadersInternal( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions, async: true, cancellationToken) @@ -3668,6 +3729,7 @@ await SetHttpHeadersInternal( smbProperties, filePermission, filePermissionFormat: default, + posixProperties: default, conditions: default, async: true, cancellationToken) @@ -3699,6 +3761,9 @@ await SetHttpHeadersInternal( /// /// Optional file permission format. /// + /// + /// Optional NFS properties. + /// /// /// Optional to add conditions /// on creating the file. @@ -3724,6 +3789,7 @@ private async Task> SetHttpHeadersInternal( FileSmbProperties smbProperties, string filePermission, FilePermissionFormat? filePermissionFormat, + FilePosixProperties posixProperties, ShareFileRequestConditions conditions, bool async, CancellationToken cancellationToken) @@ -3745,24 +3811,23 @@ private async Task> SetHttpHeadersInternal( FileSmbProperties smbProps = smbProperties ?? new FileSmbProperties(); ShareExtensions.AssertValidFilePermissionAndKey(filePermission, smbProps.FilePermissionKey); - if (filePermission == null && smbProps.FilePermissionKey == null) - { - filePermission = Constants.File.Preserve; - } ResponseWithHeaders response; if (async) { response = await FileRestClient.SetHttpHeadersAsync( - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve, + fileAttributes: smbProps.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(), fileContentLength: newSize, filePermission: filePermission, filePermissionFormat: filePermissionFormat, filePermissionKey: smbProps.FilePermissionKey, fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), fileHttpHeaders: httpHeaders.ToFileHttpHeaders(), shareFileRequestConditions: conditions, cancellationToken: cancellationToken) @@ -3771,14 +3836,17 @@ private async Task> SetHttpHeadersInternal( else { response = FileRestClient.SetHttpHeaders( - fileAttributes: smbProps.FileAttributes?.ToAttributesString() ?? Constants.File.Preserve, - fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString() ?? Constants.File.Preserve, - fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString() ?? Constants.File.Preserve, + fileAttributes: smbProps.FileAttributes.ToAttributesString(), + fileCreationTime: smbProps.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: smbProps.FileLastWrittenOn.ToFileDateTimeString(), fileContentLength: newSize, filePermission: filePermission, filePermissionFormat: filePermissionFormat, filePermissionKey: smbProps.FilePermissionKey, fileChangeTime: smbProps.FileChangedOn.ToFileDateTimeString(), + owner: posixProperties?.Owner, + group: posixProperties?.Group, + fileMode: posixProperties?.FileMode.ToOctalFileMode(), fileHttpHeaders: httpHeaders.ToFileHttpHeaders(), shareFileRequestConditions: conditions, cancellationToken: cancellationToken); @@ -6595,7 +6663,7 @@ private async Task> RenameInternal( CopyFileSmbInfo copyFileSmbInfo = new CopyFileSmbInfo { - FileAttributes = options?.SmbProperties?.FileAttributes?.ToAttributesString(), + FileAttributes = options?.SmbProperties?.FileAttributes.ToAttributesString(), FileCreationTime = options?.SmbProperties?.FileCreatedOn.ToFileDateTimeString(), FileChangeTime = options?.SmbProperties?.FileChangedOn.ToFileDateTimeString(), FileLastWriteTime = options?.SmbProperties?.FileLastWrittenOn.ToFileDateTimeString(), @@ -6660,6 +6728,426 @@ private async Task> RenameInternal( } #endregion Rename + #region GetSymbolicLink + /// + /// Reads the value of the symbolic link. + /// Only applicable if this is pointed at an NFS symbolic link. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the symbolic link. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal virtual Response GetSymbolicLink( + CancellationToken cancellationToken = default) => + GetSymbolicLinkInternal( + async: false, + cancellationToken: cancellationToken) + .EnsureCompleted(); + + /// + /// Reads the value of the symbolic link. + /// Only applicable if this is pointed at an NFS symbolic link. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the symbolic link. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal virtual async Task> GetSymbolicLinkAsync( + CancellationToken cancellationToken = default) => + await GetSymbolicLinkInternal( + async: true, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + /// + /// Reads the value of the symbolic link. + /// Only applicable if this is pointed at an NFS symbolic link. + /// + /// + /// Whether to invoke the operation asynchronously. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the symbolic link. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + private async Task> GetSymbolicLinkInternal( + bool async, + CancellationToken cancellationToken) + { + using (ClientConfiguration.Pipeline.BeginLoggingScope(nameof(ShareFileClient))) + { + ClientConfiguration.Pipeline.LogMethodEnter(nameof(ShareFileClient), message: string.Empty); + + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(ShareFileClient)}.{nameof(GetSymbolicLink)}"); + + ResponseWithHeaders response; + + try + { + scope.Start(); + + if (async) + { + response = await FileRestClient.GetSymbolicLinkAsync( + cancellationToken: cancellationToken) + .ConfigureAwait(false); + } + else + { + response = FileRestClient.GetSymbolicLink( + cancellationToken: cancellationToken); + } + + return Response.FromValue( + response.ToFileSymbolicLinkInfo(), + response.GetRawResponse()); + } + catch (Exception ex) + { + ClientConfiguration.Pipeline.LogException(ex); + scope.Failed(ex); + throw; + } + finally + { + ClientConfiguration.Pipeline.LogMethodExit(nameof(ShareFileClient)); + scope.Dispose(); + } + } + } + #endregion + + #region CreateSymbolicLink + /// + /// NFS only. Creates a symoblic link to the file specified by path. + /// + /// + /// The absolution or relative path to the file to be linked to. + /// + /// + /// Optional parameters. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// state of the file. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal virtual Response CreateSymbolicLink( + string linkText, + ShareFileCreateSymbolicLinkOptions options = default, + CancellationToken cancellationToken = default) => + CreateSymbolicLinkInternal( + linkText: linkText, + options: options, + async: false, + cancellationToken: cancellationToken) + .EnsureCompleted(); + + /// + /// NFS only. Creates a symoblic link to the file specified by path. + /// + /// + /// The absolution or relative path to the file to be linked to. + /// + /// + /// Optional parameters. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// state of the file. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + /// https://github.com/Azure/azure-sdk-for-net/issues/46907 + internal virtual async Task> CreateSymbolicLinkAsync( + string linkText, + ShareFileCreateSymbolicLinkOptions options = default, + CancellationToken cancellationToken = default) => + await CreateSymbolicLinkInternal( + linkText: linkText, + options: options, + async: true, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + /// + /// NFS only. Creates a symoblic link to the file specified by path. + /// + /// + /// The absolution or relative path to the file to be linked to. + /// + /// + /// Optional parameters. + /// + /// + /// Whether to invoke the operation asynchronously. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// state of the file. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + private async Task> CreateSymbolicLinkInternal( + string linkText, + ShareFileCreateSymbolicLinkOptions options, + bool async, + CancellationToken cancellationToken) + { + using (ClientConfiguration.Pipeline.BeginLoggingScope(nameof(ShareFileClient))) + { + ClientConfiguration.Pipeline.LogMethodEnter( + nameof(ShareFileClient), + message: + $"{nameof(Uri)}: {Uri}\n"); + + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(ShareFileClient)}.{nameof(CreateSymbolicLink)}"); + + ResponseWithHeaders response; + + try + { + scope.Start(); + + if (async) + { + response = await FileRestClient.CreateSymbolicLinkAsync( + linkText: linkText, + metadata: options?.Metadata, + fileCreationTime: options?.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: options?.FileLastWrittenOn.ToFileDateTimeString(), + owner: options?.Owner, + group: options?.Group, + shareFileRequestConditions: options?.Conditions, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + } + else + { + response = FileRestClient.CreateSymbolicLink( + linkText: linkText, + metadata: options?.Metadata, + fileCreationTime: options?.FileCreatedOn.ToFileDateTimeString(), + fileLastWriteTime: options?.FileLastWrittenOn.ToFileDateTimeString(), + owner: options?.Owner, + group: options?.Group, + shareFileRequestConditions: options?.Conditions, + cancellationToken: cancellationToken); + } + + return Response.FromValue( + response.ToShareFileInfo(), + response.GetRawResponse()); + } + catch (Exception ex) + { + ClientConfiguration.Pipeline.LogException(ex); + scope.Failed(ex); + throw; + } + finally + { + ClientConfiguration.Pipeline.LogMethodExit(nameof(ShareFileClient)); + scope.Dispose(); + } + } + } + #endregion + + #region CreateHardLink + /// + /// NFS only. Creates a hard link to the file file specified by path. + /// + /// + /// Path of the file to create the hard link to, not including the share. + /// For example: "targetDirectory/targetSubDirectory/.../targetFile" + /// + /// + /// Optional to add conditions + /// on creating the hard link. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// state of the hard link. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response CreateHardLink( + string targetFile, + ShareFileRequestConditions conditions = default, + CancellationToken cancellationToken = default) + => CreateHardLinkInternal( + targetFile: targetFile, + conditions: conditions, + async: false, + cancellationToken: cancellationToken) + .EnsureCompleted(); + + /// + /// NFS only. Creates a hard link to the file file specified by path. + /// + /// + /// Path of the file to create the hard link to, not including the share. + /// For example: "targetDirectory/targetSubDirectory/.../targetFile" + /// + /// + /// Optional to add conditions + /// on creating the hard link. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// state of the hard link. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public async virtual Task> CreateHardLinkAsync( + string targetFile, + ShareFileRequestConditions conditions = default, + CancellationToken cancellationToken = default) + => await CreateHardLinkInternal( + targetFile: targetFile, + conditions: conditions, + async: true, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + + /// + /// NFS only. Creates a hard link to the file file specified by path. + /// + /// + /// Path of the file to create the hard link to, not including the share. + /// + /// + /// Optional to add conditions + /// on creating the hard link. + /// + /// + /// Whether to invoke the operation asynchronously. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the + /// state of the hard link. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + private async Task> CreateHardLinkInternal( + string targetFile, + ShareFileRequestConditions conditions, + bool async, + CancellationToken cancellationToken) + { + using (ClientConfiguration.Pipeline.BeginLoggingScope(nameof(ShareFileClient))) + { + ClientConfiguration.Pipeline.LogMethodEnter( + nameof(ShareFileClient), + message: + $"{nameof(Uri)}: {Uri}\n" + + $"{nameof(targetFile)}: {targetFile}"); + + DiagnosticScope scope = ClientConfiguration.ClientDiagnostics.CreateScope($"{nameof(ShareFileClient)}.{nameof(CreateHardLink)}"); + + try + { + scope.Start(); + + ResponseWithHeaders response; + + if (async) + { + response = await FileRestClient.CreateHardLinkAsync( + targetFile: targetFile, + shareFileRequestConditions: conditions, + cancellationToken: cancellationToken) + .ConfigureAwait(false); + } + else + { + response = FileRestClient.CreateHardLink( + targetFile: targetFile, + shareFileRequestConditions: conditions, + cancellationToken: cancellationToken); + } + + return Response.FromValue( + response.ToShareFileInfo(), + response.GetRawResponse()); + } + catch (Exception ex) + { + ClientConfiguration.Pipeline.LogException(ex); + scope.Failed(ex); + throw; + } + finally + { + ClientConfiguration.Pipeline.LogMethodExit(nameof(ShareFileClient)); + scope.Dispose(); + } + } + } + #endregion + #region OpenWrite /// /// Opens a stream for writing to the file. @@ -6790,6 +7278,7 @@ private async Task OpenWriteInternal( smbProperties: default, filePermission: default, filePermissionFormat: default, + posixProperties: default, conditions: options?.OpenConditions, async: async, cancellationToken: cancellationToken) @@ -6820,6 +7309,7 @@ private async Task OpenWriteInternal( smbProperties: default, filePermission: default, filePermissionFormat: default, + posixProperties: default, conditions: options?.OpenConditions, async: async, cancellationToken: cancellationToken) diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs index 99ec7f24621f..c60edc43386c 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareUriBuilder.cs @@ -288,7 +288,7 @@ private RequestUriBuilder BuildUri() if (!string.IsNullOrWhiteSpace(ShareName)) { path.Append('/').Append(ShareName); - if (!string.IsNullOrWhiteSpace(_directoryOrFilePath)) + if (!string.IsNullOrEmpty(_directoryOrFilePath)) { path.Append('/').Append(_directoryOrFilePath.EscapePath()); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs index 21f3f36b1a13..bcb41d34b900 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/Shared/ShareModelExtensions.cs @@ -17,9 +17,14 @@ internal static partial class ShareModelExtensions /// ToString /// /// string - public static string ToAttributesString(this NtfsFileAttributes attributes) + public static string ToAttributesString(this NtfsFileAttributes? attributes) { - var stringBuilder = new StringBuilder(); + if (attributes == null) + { + return null; + } + + StringBuilder stringBuilder = new StringBuilder(); if ((attributes & NtfsFileAttributes.ReadOnly) == NtfsFileAttributes.ReadOnly) { diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md b/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md index ed634ae30273..b2678f62dd5f 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md +++ b/sdk/storage/Azure.Storage.Files.Shares/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ae95eb6a4701d844bada7d1c4f5ecf4a7444e5b8/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-01-05/file.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/d18a495685ccec837b72891b4deea017f62e8190/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-05-05/file.json generation1-convenience-client: true # https://github.com/Azure/autorest/issues/4075 skip-semantics-validation: true diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs index 35f4f78c33aa..23449be0978b 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ClientBuilderExtensions.cs @@ -59,6 +59,16 @@ public static ShareServiceClient GetServiceClient_OAuthAccount_SharedKey(this Sh public static ShareServiceClient GetServiceClient_PremiumFile(this ShareClientBuilder clientBuilder) => clientBuilder.GetServiceClientFromSharedKeyConfig(clientBuilder.Tenants.TestConfigPremiumFile); + public static ShareServiceClient GetServiceClient_PremiumFileOAuth( + this ShareClientBuilder clientBuilder, + TokenCredential tokenCredential, + ShareClientOptions options = default) + { + options ??= clientBuilder.GetOptions(); + options.ShareTokenIntent = ShareTokenIntent.Backup; + return clientBuilder.GetServiceClientFromOauthConfig(clientBuilder.Tenants.TestConfigPremiumFile, tokenCredential, options); + } + public static ShareServiceClient GetServiceClient_SoftDelete(this ShareClientBuilder clientBuilder) => clientBuilder.GetServiceClientFromSharedKeyConfig(clientBuilder.Tenants.TestConfigSoftDelete); @@ -67,13 +77,14 @@ public static async Task GetTestShareAsync( ShareServiceClient service = default, string shareName = default, IDictionary metadata = default, - ShareClientOptions options = default) + ShareClientOptions options = default, + bool nfs = false) { - service ??= clientBuilder.GetServiceClient_SharedKey(options); + service ??= nfs ? clientBuilder.GetServiceClient_PremiumFile() : clientBuilder.GetServiceClient_SharedKey(options); metadata ??= new Dictionary(StringComparer.OrdinalIgnoreCase); shareName ??= clientBuilder.GetNewShareName(); ShareClient share = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(service.GetShareClient(shareName)); - return await DisposingShare.CreateAsync(share, metadata); + return await DisposingShare.CreateAsync(share, metadata, nfs); } public static async Task GetTestDirectoryAsync( @@ -81,9 +92,10 @@ public static async Task GetTestDirectoryAsync( ShareServiceClient service = default, string shareName = default, string directoryName = default, - ShareClientOptions options = default) + ShareClientOptions options = default, + bool nfs = false) { - DisposingShare test = await clientBuilder.GetTestShareAsync(service, shareName, options: options); + DisposingShare test = await clientBuilder.GetTestShareAsync(service, shareName, options: options, nfs: nfs); directoryName ??= clientBuilder.GetNewDirectoryName(); ShareDirectoryClient directory = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(test.Share.GetDirectoryClient(directoryName)); @@ -96,9 +108,10 @@ public static async Task GetTestFileAsync( string shareName = default, string directoryName = default, string fileName = default, - ShareClientOptions options = default) + ShareClientOptions options = default, + bool nfs = false) { - DisposingDirectory test = await clientBuilder.GetTestDirectoryAsync(service, shareName, directoryName, options); + DisposingDirectory test = await clientBuilder.GetTestDirectoryAsync(service, shareName, directoryName, options, nfs: nfs); fileName ??= clientBuilder.GetNewFileName(); ShareFileClient file = clientBuilder.AzureCoreRecordedTestBase.InstrumentClient(test.Directory.GetFileClient(fileName)); return await DisposingFile.CreateAsync(test, file); diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs index 66f7ea56a121..f96917d2dbfa 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs @@ -585,6 +585,44 @@ public async Task CreateAsync_TrailingDot(bool? allowTrailingDot) } } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateAsync_NFS() + { + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true); + ShareClient share = test.Share; + + // Arrange + var name = GetNewDirectoryName(); + ShareDirectoryClient directory = InstrumentClient(share.GetDirectoryClient(name)); + + string owner = "345"; + string group = "123"; + string fileMode = "7777"; + + ShareDirectoryCreateOptions options = new ShareDirectoryCreateOptions + { + PosixProperties = new FilePosixProperties + { + Owner = owner, + Group = group, + FileMode = NfsFileMode.ParseOctalFileMode(fileMode) + } + }; + + // Act + Response response = await directory.CreateAsync(options); + + // Assert + Assert.AreEqual(NfsFileType.Directory, response.Value.PosixProperties.FileType); + Assert.AreEqual(owner, response.Value.PosixProperties.Owner); + Assert.AreEqual(group, response.Value.PosixProperties.Group); + Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode()); + + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task CreateIfNotExists_NotExists() { @@ -982,6 +1020,27 @@ public async Task GetPropertiesAsync_TrailingDot() AssertPropertiesEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties); } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task GetPropertiesAsync_NFS() + { + // Arrange + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true); + + // Act + Response response = await test.Directory.GetPropertiesAsync(); + + // Assert + Assert.AreEqual(NfsFileType.Directory, response.Value.PosixProperties.FileType); + Assert.AreEqual("0", response.Value.PosixProperties.Owner); + Assert.AreEqual("0", response.Value.PosixProperties.Group); + Assert.AreEqual("0755", response.Value.PosixProperties.FileMode.ToOctalFileMode()); + + Assert.IsNull(response.Value.PosixProperties.LinkCount); + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task SetHttpHeadersAsync() { @@ -1221,6 +1280,40 @@ public async Task SetHttpHeadersAsync_TrailingDot() await directory.SetHttpHeadersAsync(); } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task SetHttpHeadersAsync_NFS() + { + // Arrange + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true); + + string owner = "345"; + string group = "123"; + string fileMode = "7777"; + + ShareDirectorySetHttpHeadersOptions options = new ShareDirectorySetHttpHeadersOptions + { + PosixProperties = new FilePosixProperties + { + Owner = owner, + Group = group, + FileMode = NfsFileMode.ParseOctalFileMode(fileMode) + } + }; + + // Act + Response response = await test.Directory.SetHttpHeadersAsync(options); + + // Assert + Assert.AreEqual(owner, response.Value.PosixProperties.Owner); + Assert.AreEqual(group, response.Value.PosixProperties.Group); + Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode()); + + Assert.IsNull(response.Value.PosixProperties.LinkCount); + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task SetMetadataAsync() { @@ -1904,6 +1997,7 @@ public async Task GetSubdirectoryAsync_NonAsciiName() [TestCase("%21%27%28%29%3B%5B%5D", "%2B%24%2C%23äÄöÖüÜß%3B")] [TestCase("directory", "my cool file")] [TestCase("directory", "file")] + [TestCase(" ", " ")] [RetryOnException(5, typeof(RequestFailedException))] public async Task GetFileClient_SpecialCharacters(string directoryName, string fileName) { @@ -1968,6 +2062,7 @@ public async Task GetFileClient_SpecialCharacters(string directoryName, string f [TestCase("%21%27%28", "%21%27%28%29%3B%5B%5D%40%26äÄöÖüÜß%3B")] [TestCase("directory", "my cool directory")] [TestCase("directory0", "directory1")] + [TestCase(" ", " ")] public async Task GetSubDirectoryClient_SpecialCharacters(string directoryName, string subDirectoryName) { await using DisposingShare test = await GetTestShareAsync(); diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs index 4389023663cf..dbff1885fdbc 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DisposingShare.cs @@ -15,12 +15,18 @@ public class DisposingShare : IDisposingContainer public ShareClient Container { get; private set; } - public static async Task CreateAsync(ShareClient share, IDictionary metadata) + public static async Task CreateAsync(ShareClient share, IDictionary metadata, bool nfs = false) { ShareCreateOptions options = new ShareCreateOptions { Metadata = metadata }; + + if (nfs) + { + options.Protocols = ShareProtocols.Nfs; + } + await share.CreateIfNotExistsAsync(options); return new DisposingShare(share); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs index b1ce4cc25987..23ad04b731a3 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs @@ -10,6 +10,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core.TestFramework; +using Azure.Identity; using Azure.Storage.Files.Shares.Models; using Azure.Storage.Files.Shares.Specialized; using Azure.Storage.Sas; @@ -17,6 +18,7 @@ using Azure.Storage.Test.Shared; using Moq; using NUnit.Framework; +using NUnit.Framework.Internal; namespace Azure.Storage.Files.Shares.Tests { @@ -724,6 +726,46 @@ public async Task CreateAsync_TrailingDot(bool? allowTrailingDot) } } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateAsync_NFS() + { + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true); + ShareDirectoryClient directory = test.Directory; + + // Arrange + string name = GetNewFileName(); + ShareFileClient file = InstrumentClient(directory.GetFileClient(name)); + + string owner = "345"; + string group = "123"; + string fileMode = "7777"; + + ShareFileCreateOptions options = new ShareFileCreateOptions + { + PosixProperties = new FilePosixProperties + { + Owner = owner, + Group = group, + FileMode = NfsFileMode.ParseOctalFileMode(fileMode) + } + }; + + // Act + Response response = await file.CreateAsync( + maxSize: Constants.MB, + options: options); + + // Assert + Assert.AreEqual(NfsFileType.Regular, response.Value.PosixProperties.FileType); + Assert.AreEqual(owner, response.Value.PosixProperties.Owner); + Assert.AreEqual(group, response.Value.PosixProperties.Group); + Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode()); + + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task ExistsAsync_Exists() { @@ -1325,6 +1367,26 @@ public async Task GetPropertiesAsync_TrailingDot() AssertPropertiesEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties); } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task GetProperties_NFS() + { + await using DisposingFile test = await SharesClientBuilder.GetTestFileAsync(nfs: true); + + // Act + Response response = await test.File.GetPropertiesAsync(); + + // Assert + Assert.AreEqual(NfsFileType.Regular, response.Value.PosixProperties.FileType); + Assert.AreEqual("0", response.Value.PosixProperties.Owner); + Assert.AreEqual("0", response.Value.PosixProperties.Group); + Assert.AreEqual("0664", response.Value.PosixProperties.FileMode.ToOctalFileMode()); + Assert.AreEqual(1, response.Value.PosixProperties.LinkCount); + + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task SetHttpHeadersAsync() { @@ -1712,6 +1774,39 @@ public async Task SetHttpHeadersAsync_TrailingDot() Response response = await file.SetHttpHeadersAsync(setHttpHeadersOptions); } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task SetHttpHeadersAsync_NFS() + { + await using DisposingFile test = await SharesClientBuilder.GetTestFileAsync(nfs: true); + + string owner = "345"; + string group = "123"; + string fileMode = "7777"; + + ShareFileSetHttpHeadersOptions options = new ShareFileSetHttpHeadersOptions + { + PosixProperties = new FilePosixProperties + { + Owner = owner, + Group = group, + FileMode = NfsFileMode.ParseOctalFileMode(fileMode) + } + }; + + // Act + Response response = await test.File.SetHttpHeadersAsync(options); + + // Assert + Assert.AreEqual(owner, response.Value.PosixProperties.Owner); + Assert.AreEqual(group, response.Value.PosixProperties.Group); + Assert.AreEqual(fileMode, response.Value.PosixProperties.FileMode.ToOctalFileMode()); + Assert.AreEqual(1, response.Value.PosixProperties.LinkCount); + + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task DeleteAsync() { @@ -2446,6 +2541,80 @@ await TestHelper.AssertExpectedExceptionAsync( } } + [RecordedTest] + [TestCase(null)] + [TestCase(ModeCopyMode.Source)] + [TestCase(ModeCopyMode.Override)] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task StartCopy_NFS(ModeCopyMode? modeAndOwnerCopyMode) + { + // Arrange + await using DisposingFile source = await SharesClientBuilder.GetTestFileAsync(nfs: true); + await using DisposingFile destination = await SharesClientBuilder.GetTestFileAsync(nfs: true); + + byte[] data = GetRandomBuffer(Constants.KB); + using Stream stream = new MemoryStream(data); + await source.File.UploadRangeAsync( + range: new HttpRange(0, Constants.KB), + content: stream); + + await source.File.SetHttpHeadersAsync(new ShareFileSetHttpHeadersOptions + { + PosixProperties = new FilePosixProperties + { + Owner = "999", + Group = "888", + FileMode = NfsFileMode.ParseOctalFileMode("0111") + } + }); + + Response sourceProperties = await source.File.GetPropertiesAsync(); + + string owner; + string group; + NfsFileMode fileMode; + + ShareFileCopyOptions options = new ShareFileCopyOptions + { + PosixProperties = new FilePosixProperties() + }; + + if (modeAndOwnerCopyMode == ModeCopyMode.Override) + { + owner = "54321"; + group = "12345"; + fileMode = NfsFileMode.ParseOctalFileMode("7777"); + options.ModeCopyMode = ModeCopyMode.Override; + options.OwnerCopyMode = OwnerCopyMode.Override; + options.PosixProperties.Owner = owner; + options.PosixProperties.Group = group; + options.PosixProperties.FileMode = fileMode; + } + else if (modeAndOwnerCopyMode == ModeCopyMode.Source) + { + options.ModeCopyMode = ModeCopyMode.Source; + options.OwnerCopyMode = OwnerCopyMode.Source; + owner = sourceProperties.Value.PosixProperties.Owner; + fileMode = sourceProperties.Value.PosixProperties.FileMode; + group = sourceProperties.Value.PosixProperties.Group; + } + else + { + owner = "0"; + group = "0"; + fileMode = NfsFileMode.ParseOctalFileMode("0664"); + } + + // Act + await destination.File.StartCopyAsync(source.File.Uri, options); + Response destinationProperties = await destination.File.GetPropertiesAsync(); + + // Assert + Assert.AreEqual(owner, destinationProperties.Value.PosixProperties.Owner); + Assert.AreEqual(group, destinationProperties.Value.PosixProperties.Group); + Assert.AreEqual(fileMode.ToOctalFileMode(), destinationProperties.Value.PosixProperties.FileMode.ToOctalFileMode()); + } + [RecordedTest] public async Task AbortCopyAsync() { @@ -3073,6 +3242,37 @@ await file.UploadRangeAsync( } } + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task DownloadAsync_NFS() + { + // Arrange + var data = GetRandomBuffer(Constants.KB); + + await using DisposingFile test = await SharesClientBuilder.GetTestFileAsync(nfs: true); + ShareFileClient file = test.File; + + using Stream stream = new MemoryStream(data); + await file.UploadRangeAsync( + range: new HttpRange(0, Constants.KB), + content: stream); + + // Act + Response response = await file.DownloadAsync(new ShareFileDownloadOptions + { + Range = new HttpRange(0, Constants.KB) + }); + + // Assert + Assert.AreEqual("0", response.Value.Details.PosixProperties.Owner); + Assert.AreEqual("0", response.Value.Details.PosixProperties.Group); + Assert.AreEqual("0664", response.Value.Details.PosixProperties.FileMode.ToOctalFileMode()); + Assert.AreEqual(1, response.Value.Details.PosixProperties.LinkCount); + + Assert.IsNull(response.Value.Details.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.Details.SmbProperties.FilePermissionKey); + } + [RecordedTest] public async Task GetRangeListAsync() { @@ -6622,6 +6822,182 @@ public async Task RenameAsync_OAuth() TestHelper.AssertSequenceEqual(data, actual.ToArray()); } + [RecordedTest] + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/46907")] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateGetSymbolicLinkAsync() + { + // Arrange + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true); + ShareDirectoryClient directory = test.Directory; + + ShareFileClient source = InstrumentClient(await directory.CreateFileAsync(GetNewFileName(), maxSize: Constants.KB)); + ShareFileClient symlink = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + IDictionary metdata = BuildMetadata(); + string owner = "345"; + string group = "123"; + DateTimeOffset fileCreatedOn = new DateTimeOffset(2024, 10, 15, 0, 0, 0, TimeSpan.Zero); + DateTimeOffset fileLastWrittenOn = new DateTimeOffset(2025, 5, 2, 0, 0, 0, TimeSpan.Zero); + + ShareFileCreateSymbolicLinkOptions options = new ShareFileCreateSymbolicLinkOptions + { + Metadata = metdata, + FileCreatedOn = fileCreatedOn, + FileLastWrittenOn = fileLastWrittenOn, + Owner = owner, + Group = group + }; + + // Act + Response response = await symlink.CreateSymbolicLinkAsync( + linkText: source.Uri.ToString(), + options: options); + + // Assert + Assert.AreEqual(NfsFileType.SymLink, response.Value.PosixProperties.FileType); + Assert.AreEqual(owner, response.Value.PosixProperties.Owner); + Assert.AreEqual(group, response.Value.PosixProperties.Group); + Assert.AreEqual(fileCreatedOn, response.Value.SmbProperties.FileCreatedOn); + Assert.AreEqual(fileLastWrittenOn, response.Value.SmbProperties.FileLastWrittenOn); + + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + + Assert.IsNotNull(response.Value.SmbProperties.FileId); + Assert.IsNotNull(response.Value.SmbProperties.ParentId); + + // Act + Response getSymLinkResponse = await symlink.GetSymbolicLinkAsync(); + + // Assert + Assert.AreNotEqual(default, getSymLinkResponse.Value.ETag); + Assert.AreNotEqual(default, getSymLinkResponse.Value.LastModified); + Assert.AreEqual(source.Uri.ToString(), getSymLinkResponse.Value.LinkText); + } + + [RecordedTest] + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/46907")] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateGetSymbolicLinkAsync_Error() + { + // Arrange + await using DisposingShare test = await SharesClientBuilder.GetTestShareAsync(nfs: true); + // Note that the parent directory was not created in this test case. + ShareDirectoryClient directory = InstrumentClient(test.Share.GetDirectoryClient(GetNewDirectoryName())); + + ShareFileClient source = InstrumentClient(directory.GetFileClient(GetNewFileName())); + ShareFileClient symlink = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + // Act + await TestHelper.AssertExpectedExceptionAsync( + symlink.CreateSymbolicLinkAsync(linkText: source.Uri.ToString()), + e => Assert.AreEqual("ParentNotFound", e.ErrorCode)); + + await TestHelper.AssertExpectedExceptionAsync( + symlink.GetSymbolicLinkAsync(), + e => Assert.AreEqual("ParentNotFound", e.ErrorCode)); + } + + [RecordedTest] + [PlaybackOnly("https://github.com/Azure/azure-sdk-for-net/issues/46907")] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateGetSymbolicLinkAsync_OAuth() + { + // Arrange + ShareServiceClient oauthServiceClient = GetServiceClient_PremiumFileOAuth(); + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync( + service: oauthServiceClient, + nfs: true); + ShareDirectoryClient directory = test.Directory; + + ShareFileClient source = InstrumentClient(await directory.CreateFileAsync(GetNewFileName(), maxSize: Constants.KB)); + ShareFileClient symlink = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + // Act + await symlink.CreateSymbolicLinkAsync(linkText: source.Uri.ToString()); + await symlink.GetSymbolicLinkAsync(); + } + + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateHardLinkAsync() + { + // Arrange + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync(nfs: true); + ShareDirectoryClient directory = test.Directory; + + ShareFileClient source = InstrumentClient(await directory.CreateFileAsync(GetNewFileName(), maxSize: Constants.KB)); + ShareLeaseClient leaseClient = InstrumentClient(test.Share.GetShareLeaseClient(Recording.Random.NewGuid().ToString())); + ShareFileLease lease = await leaseClient.AcquireAsync(); + try + { + ShareFileClient hardLink = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + // Act + Response response = await hardLink.CreateHardLinkAsync( + targetFile: $"{directory.Name}/{source.Name}", + conditions: new ShareFileRequestConditions() { LeaseId = lease.LeaseId }); + + // Assert + Assert.AreEqual(NfsFileType.Regular, response.Value.PosixProperties.FileType); + Assert.AreEqual("0", response.Value.PosixProperties.Owner); + Assert.AreEqual("0", response.Value.PosixProperties.Group); + Assert.AreEqual("0664", response.Value.PosixProperties.FileMode.ToOctalFileMode()); + Assert.AreEqual(2, response.Value.PosixProperties.LinkCount); + + Assert.IsNotNull(response.Value.SmbProperties.FileCreatedOn); + Assert.IsNotNull(response.Value.SmbProperties.FileLastWrittenOn); + Assert.IsNotNull(response.Value.SmbProperties.FileChangedOn); + Assert.IsNotNull(response.Value.SmbProperties.FileId); + Assert.IsNotNull(response.Value.SmbProperties.ParentId); + + Assert.IsNull(response.Value.SmbProperties.FileAttributes); + Assert.IsNull(response.Value.SmbProperties.FilePermissionKey); + } + finally + { + await leaseClient.ReleaseAsync(); + } + } + + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateHardLinkAsync_OAuth() + { + // Arrange + ShareServiceClient oauthServiceClient = GetServiceClient_PremiumFileOAuth(); + await using DisposingDirectory test = await SharesClientBuilder.GetTestDirectoryAsync( + service: oauthServiceClient, + nfs: true); + ShareDirectoryClient directory = test.Directory; + + ShareFileClient source = InstrumentClient(await directory.CreateFileAsync(GetNewFileName(), maxSize: Constants.KB)); + ShareFileClient hardLink = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + // Act + Response response = await hardLink.CreateHardLinkAsync( + targetFile: $"{directory.Name}/{source.Name}"); + } + + [RecordedTest] + [ServiceVersion(Min = ShareClientOptions.ServiceVersion.V2025_05_05)] + public async Task CreateGetHardLinkAsync_Error() + { + // Arrange + await using DisposingShare test = await SharesClientBuilder.GetTestShareAsync(nfs: true); + // Note that the parent directory was not created in this test case. + ShareDirectoryClient directory = InstrumentClient(test.Share.GetDirectoryClient(GetNewDirectoryName())); + + ShareFileClient source = InstrumentClient(directory.GetFileClient(GetNewFileName())); + ShareFileClient hardLink = InstrumentClient(directory.GetFileClient(GetNewFileName())); + + // Act + await TestHelper.AssertExpectedExceptionAsync( + hardLink.CreateHardLinkAsync(targetFile: $"{directory.Name}/{source.Name}"), + e => Assert.AreEqual("ParentNotFound", e.ErrorCode)); + } + #region GenerateSasTests [RecordedTest] public void CanGenerateSas_ClientConstructors() diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileTestBase.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileTestBase.cs index a2b901bf2e38..8771d81258c8 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileTestBase.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileTestBase.cs @@ -110,6 +110,9 @@ public ShareServiceClient GetServiceClient_FileServiceSasFile(string shareName, public ShareServiceClient GetServiceClient_OAuth() => SharesClientBuilder.GetServiceClient_OAuth(TestEnvironment.Credential); + public ShareServiceClient GetServiceClient_PremiumFileOAuth() + => SharesClientBuilder.GetServiceClient_PremiumFileOAuth(TestEnvironment.Credential); + public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential sharedKeyCredentials = default, AccountSasResourceTypes resourceTypes = AccountSasResourceTypes.Container, AccountSasPermissions permissions = AccountSasPermissions.Create | AccountSasPermissions.Delete) diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/NfsFileModeTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/NfsFileModeTests.cs new file mode 100644 index 000000000000..aa9da871bd8e --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/NfsFileModeTests.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Storage.Files.Shares.Models; +using NUnit.Framework; + +namespace Azure.Storage.Files.Shares.Tests +{ + public class NfsFileModeTests + { + [Test] + [TestCase("0000")] + [TestCase("1111")] + [TestCase("2222")] + [TestCase("3333")] + [TestCase("4444")] + [TestCase("5555")] + [TestCase("6666")] + [TestCase("7777")] + [TestCase("0124")] + [TestCase("4210")] + [TestCase("1357")] + [TestCase("7531")] + public void OctalPermissionsRoundTrip(string s) + { + // Act + NfsFileMode fileMode = NfsFileMode.ParseOctalFileMode(s); + string output = fileMode.ToOctalFileMode(); + + // Assert + Assert.AreEqual(s, output); + } + + [Test] + [TestCase("---------")] + [TestCase("rwxrwxrwx")] + [TestCase("r---w---x")] + [TestCase("rwsrwsrwt")] + [TestCase("rwSrwSrwT")] + public void SymbolicPermissionsRoundTrip(string s) + { + // Act + NfsFileMode fileMode = NfsFileMode.ParseSymbolicFileMode(s); + string output = fileMode.ToSymbolicFileMode(); + + // Assert + Assert.AreEqual(s, output); + } + } +} diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs index e52b1b2da1bc..52916c13b0cd 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ServiceClientTests.cs @@ -151,21 +151,36 @@ public async Task GetSetServicePropertiesAsync_SmbMultiChannel() Response propertiesResponse = await service.GetPropertiesAsync(); ShareServiceProperties properties = propertiesResponse.Value; - // Assert - Assert.IsFalse(properties.Protocol.Smb.Multichannel.Enabled); + if (properties.Protocol.Smb.Multichannel.Enabled == true) + { + // Act + properties.Protocol.Smb.Multichannel.Enabled = false; + await service.SetPropertiesAsync(properties); + propertiesResponse = await service.GetPropertiesAsync(); + properties = propertiesResponse.Value; - // Act - properties.Protocol.Smb.Multichannel.Enabled = true; - await service.SetPropertiesAsync(properties); - propertiesResponse = await service.GetPropertiesAsync(); - properties = propertiesResponse.Value; + // Assert + Assert.IsFalse(properties.Protocol.Smb.Multichannel.Enabled); - // Assert - Assert.IsTrue(properties.Protocol.Smb.Multichannel.Enabled); + // Cleanup + properties.Protocol.Smb.Multichannel.Enabled = true; + await service.SetPropertiesAsync(properties); + } + else + { + // Act + properties.Protocol.Smb.Multichannel.Enabled = true; + await service.SetPropertiesAsync(properties); + propertiesResponse = await service.GetPropertiesAsync(); + properties = propertiesResponse.Value; - // Cleanup - properties.Protocol.Smb.Multichannel.Enabled = false; - await service.SetPropertiesAsync(properties); + // Assert + Assert.IsTrue(properties.Protocol.Smb.Multichannel.Enabled); + + // Cleanup + properties.Protocol.Smb.Multichannel.Enabled = false; + await service.SetPropertiesAsync(properties); + } } [RecordedTest] diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs index 7d078484201b..7daa23151679 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTestFixtureAttribute.cs @@ -38,6 +38,7 @@ public ShareClientTestFixtureAttribute(params object[] additionalParameters) ShareClientOptions.ServiceVersion.V2024_08_04, ShareClientOptions.ServiceVersion.V2024_11_04, ShareClientOptions.ServiceVersion.V2025_01_05, + ShareClientOptions.ServiceVersion.V2025_05_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion }, diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs index f798d99a933a..da5469f8f316 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/ShareClientTests.cs @@ -2288,6 +2288,7 @@ public async Task DeleteDirectoryAsync() [TestCase("%21%27%28%29%3B%5B%5D%40%26%25%3D%2B%24%2C%23äÄöÖüÜß%3B")] [TestCase("my cool directory")] [TestCase("directory")] + [TestCase(" ")] public async Task GetDirectoryClient_SpecialCharacters(string directoryName) { // Arrange diff --git a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md index 33ad2c23f070..38d8078961ca 100644 --- a/sdk/storage/Azure.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Queues/CHANGELOG.md @@ -3,10 +3,7 @@ ## 12.22.0-beta.1 (Unreleased) ### Features Added - -### Breaking Changes - -### Bugs Fixed +- Added support for service version 2025-05-05. ### Other Changes diff --git a/sdk/storage/Azure.Storage.Queues/README.md b/sdk/storage/Azure.Storage.Queues/README.md index afff82fdc87b..6727a035c82a 100644 --- a/sdk/storage/Azure.Storage.Queues/README.md +++ b/sdk/storage/Azure.Storage.Queues/README.md @@ -206,21 +206,21 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.Storage.Queues/src [package]: https://www.nuget.org/packages/Azure.Storage.Queues/ -[docs]: https://docs.microsoft.com/dotnet/api/azure.storage.queues -[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/queue-service-rest-api -[product_docs]: https://docs.microsoft.com/azure/storage/queues/storage-queues-introduction +[docs]: https://learn.microsoft.com/dotnet/api/azure.storage.queues +[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/queue-service-rest-api +[product_docs]: https://learn.microsoft.com/azure/storage/queues/storage-queues-introduction [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://docs.microsoft.com/cli/azure +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[storage_ad]: https://docs.microsoft.com/azure/storage/common/storage-auth-aad +[storage_ad]: https://learn.microsoft.com/azure/storage/common/storage-auth-aad [storage_ad_sample]: samples/Sample02c_Auth_ActiveDirectory.cs [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs -[error_codes]: https://docs.microsoft.com/rest/api/storageservices/queue-service-error-codes +[error_codes]: https://learn.microsoft.com/rest/api/storageservices/queue-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Queues/samples/ [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md [cla]: https://cla.microsoft.com diff --git a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs index 9f440eb3639d..29bb96d69e4a 100644 --- a/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs +++ b/sdk/storage/Azure.Storage.Queues/api/Azure.Storage.Queues.net6.0.cs @@ -74,7 +74,7 @@ public QueueClient(System.Uri queueUri, Azure.Storage.StorageSharedKeyCredential } public partial class QueueClientOptions : Azure.Core.ClientOptions { - public QueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2025_01_05) { } + public QueueClientOptions(Azure.Storage.Queues.QueueClientOptions.ServiceVersion version = Azure.Storage.Queues.QueueClientOptions.ServiceVersion.V2025_05_05) { } public Azure.Storage.Queues.Models.QueueAudience? Audience { get { throw null; } set { } } public bool EnableTenantDiscovery { get { throw null; } set { } } public System.Uri GeoRedundantSecondaryUri { get { throw null; } set { } } @@ -108,6 +108,7 @@ public enum ServiceVersion V2024_08_04 = 23, V2024_11_04 = 24, V2025_01_05 = 25, + V2025_05_05 = 26, } } public partial class QueueMessageDecodingFailedEventArgs : Azure.SyncAsyncEventArgs @@ -426,7 +427,7 @@ public event System.EventHandler /// The 2025-01-05 service version. /// - V2025_01_05 = 25 + V2025_01_05 = 25, + + /// + /// The 2025-05-05 service version. + /// + V2025_05_05 = 26 #pragma warning restore CA1707 // Identifiers should not contain underscores } diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs index b053e71cdf05..ef4a9a5e0bde 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs @@ -37,6 +37,7 @@ public QueueClientTestFixtureAttribute(params object[] additionalParameters) QueueClientOptions.ServiceVersion.V2024_08_04, QueueClientOptions.ServiceVersion.V2024_11_04, QueueClientOptions.ServiceVersion.V2025_01_05, + QueueClientOptions.ServiceVersion.V2025_05_05, StorageVersionExtensions.LatestVersion, StorageVersionExtensions.MaxVersion }, diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md index d2863a09d756..c28482f4ed7e 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md @@ -27,13 +27,13 @@ az storage account create --name --resource-group -n ``` -The connection string can be supplied through [AzureWebJobsStorage app setting](https://docs.microsoft.com/azure/azure-functions/functions-app-settings). +The connection string can be supplied through [AzureWebJobsStorage app setting](https://learn.microsoft.com/azure/azure-functions/functions-app-settings). ## Key concepts @@ -41,7 +41,7 @@ The connection string can be supplied through [AzureWebJobsStorage app setting]( The Blob storage trigger starts a function when a new or updated blob is detected. The blob contents are provided as input to the function. -Please follow the [tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp) to learn about triggering an Azure Function when a blob is modified. +Please follow the [tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp) to learn about triggering an Azure Function when a blob is modified. #### Listening strategies @@ -49,16 +49,16 @@ Blob trigger offers handful of strategies when it comes to listening to blob cre #### Default strategy -By default blob trigger uses [polling](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp#polling) which works as a hybrid between inspecting [Azure Storage analytics logging](https://docs.microsoft.com/azure/storage/common/storage-analytics-logging?tabs=dotnet) and running periodic container scans. +By default blob trigger uses [polling](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=csharp#polling) which works as a hybrid between inspecting [Azure Storage analytics logging](https://learn.microsoft.com/azure/storage/common/storage-analytics-logging?tabs=dotnet) and running periodic container scans. Blobs are scanned in groups of 10,000 at a time with a continuation token used between intervals. -[Azure Storage analytics logging](https://docs.microsoft.com/azure/storage/common/storage-analytics-logging?tabs=dotnet) is not enabled by default, see [Azure Storage analytics logging](https://docs.microsoft.com/azure/storage/common/storage-analytics-logging?tabs=dotnet) for how to enable it. +[Azure Storage analytics logging](https://learn.microsoft.com/azure/storage/common/storage-analytics-logging?tabs=dotnet) is not enabled by default, see [Azure Storage analytics logging](https://learn.microsoft.com/azure/storage/common/storage-analytics-logging?tabs=dotnet) for how to enable it. This strategy is not recommended for high-scale applications or scenarios that require low latency. #### Event grid -[Blob storage events](https://docs.microsoft.com/azure/storage/blobs/storage-blob-event-overview) can be used to listen for changes. This strategy requires [additional setup](https://docs.microsoft.com/azure/event-grid/blob-event-quickstart-portal?toc=/azure/storage/blobs/toc.json). +[Blob storage events](https://learn.microsoft.com/azure/storage/blobs/storage-blob-event-overview) can be used to listen for changes. This strategy requires [additional setup](https://learn.microsoft.com/azure/event-grid/blob-event-quickstart-portal?toc=/azure/storage/blobs/toc.json). This strategy is recommended for high-scale applications. @@ -66,7 +66,7 @@ This strategy is recommended for high-scale applications. The input binding allows you to read blob storage data as input to an Azure Function. The output binding allows you to modify and delete blob storage data in an Azure Function. -Please follow the [input binding tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-input?tabs=csharp) and [output binding tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-output?tabs=csharp) to learn about using this extension for accessing Blobs. +Please follow the [input binding tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-input?tabs=csharp) and [output binding tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-output?tabs=csharp) to learn about using this extension for accessing Blobs. ## Examples @@ -314,11 +314,11 @@ Please refer to [sample functions app](https://github.com/Azure/azure-sdk-for-ne ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -339,10 +339,10 @@ additional questions or comments. [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md index 85cfd0c7d268..f692008f3a2a 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/README.md @@ -27,13 +27,13 @@ az storage account create --name --resource-group -n ``` -The connection string can be supplied through [AzureWebJobsStorage app setting](https://docs.microsoft.com/azure/azure-functions/functions-app-settings). +The connection string can be supplied through [AzureWebJobsStorage app setting](https://learn.microsoft.com/azure/azure-functions/functions-app-settings). ## Key concepts @@ -41,11 +41,11 @@ The connection string can be supplied through [AzureWebJobsStorage app setting]( ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -66,10 +66,10 @@ additional questions or comments. [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md index dabe89ac7d40..a8b40f6391c3 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md @@ -27,13 +27,13 @@ az storage account create --name --resource-group -n ``` -The connection string can be supplied through [AzureWebJobsStorage app setting](https://docs.microsoft.com/azure/azure-functions/functions-app-settings). +The connection string can be supplied through [AzureWebJobsStorage app setting](https://learn.microsoft.com/azure/azure-functions/functions-app-settings). ## Key concepts @@ -41,13 +41,13 @@ The connection string can be supplied through [AzureWebJobsStorage app setting]( The queue storage trigger runs a function as messages are added to Azure Queue storage. -Please follow the [tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=csharp) to learn about how to listen to queues in Azure Functions. +Please follow the [tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=csharp) to learn about how to listen to queues in Azure Functions. ### Using Queue binding Azure Functions can create new Azure Queue storage messages by setting up an output binding. -Please follow the [binding tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-queue-output?tabs=csharp) to learn about using this extension for producing messages into queues in Azure Functions. +Please follow the [binding tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-queue-output?tabs=csharp) to learn about using this extension for producing messages into queues in Azure Functions. ## Examples @@ -265,11 +265,11 @@ Please refer to [sample functions app](https://github.com/Azure/azure-sdk-for-ne ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -290,10 +290,10 @@ additional questions or comments. [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md index c5fcaf70bb01..0b081aff0b36 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/README.md @@ -27,13 +27,13 @@ az storage account create --name --resource-group -n ``` -The connection string can be supplied through [AzureWebJobsStorage app setting](https://docs.microsoft.com/azure/azure-functions/functions-app-settings). +The connection string can be supplied through [AzureWebJobsStorage app setting](https://learn.microsoft.com/azure/azure-functions/functions-app-settings). ## Key concepts @@ -51,11 +51,11 @@ Please refer to [Azure WebJobs Storage Queues](https://github.com/Azure/azure-sd ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -76,10 +76,10 @@ additional questions or comments. [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs [storage_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/CONTRIBUTING.md diff --git a/sdk/storageactions/Azure.ResourceManager.StorageActions/CHANGELOG.md b/sdk/storageactions/Azure.ResourceManager.StorageActions/CHANGELOG.md index 1dd94d0498c8..62b51c4a3444 100644 --- a/sdk/storageactions/Azure.ResourceManager.StorageActions/CHANGELOG.md +++ b/sdk/storageactions/Azure.ResourceManager.StorageActions/CHANGELOG.md @@ -30,4 +30,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/storageactions/Azure.ResourceManager.StorageActions/README.md b/sdk/storageactions/Azure.ResourceManager.StorageActions/README.md index 52203fcb117c..5b4e850d469f 100644 --- a/sdk/storageactions/Azure.ResourceManager.StorageActions/README.md +++ b/sdk/storageactions/Azure.ResourceManager.StorageActions/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/CHANGELOG.md b/sdk/storagecache/Azure.ResourceManager.StorageCache/CHANGELOG.md index 5aca91f511dd..304232a0982c 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/CHANGELOG.md +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/CHANGELOG.md @@ -116,4 +116,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/README.md b/sdk/storagecache/Azure.ResourceManager.StorageCache/README.md index 063288060adf..55ca8961e573 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/README.md +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/CHANGELOG.md b/sdk/storagemover/Azure.ResourceManager.StorageMover/CHANGELOG.md index 496ad6a4aad8..e76af5370f49 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/CHANGELOG.md +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/CHANGELOG.md @@ -80,7 +80,7 @@ This is the first stable release of StorageMover client library. New design of track 2 initial commit. - Corrected the format of all `uuid` type properties / parameters. -- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected all acronyms that don't follow [Microsoft .NET Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). - Prepended `StorageMover` prefix to all single / simple model names - Optimized the name of some models and functions. @@ -96,4 +96,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md b/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md index d57b88ef34a2..d3b94d5b7271 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/CHANGELOG.md b/sdk/storagepool/Azure.ResourceManager.StoragePool/CHANGELOG.md index dd5612094249..c348c687c85a 100644 --- a/sdk/storagepool/Azure.ResourceManager.StoragePool/CHANGELOG.md +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/CHANGELOG.md @@ -53,8 +53,8 @@ Polishing since last public beta release: - Prepended `StoragePool` prefix to all single / simple model names. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -109,4 +109,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/README.md b/sdk/storagepool/Azure.ResourceManager.StoragePool/README.md index e3febccf99c2..998faacd937e 100644 --- a/sdk/storagepool/Azure.ResourceManager.StoragePool/README.md +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/CHANGELOG.md b/sdk/storagesync/Azure.ResourceManager.StorageSync/CHANGELOG.md index 8bda439d626d..48c41c56de70 100644 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/CHANGELOG.md +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/CHANGELOG.md @@ -95,4 +95,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/README.md b/sdk/storagesync/Azure.ResourceManager.StorageSync/README.md index dc990522b0bf..24e6652d9540 100644 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/README.md +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/CHANGELOG.md b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/CHANGELOG.md index 1de44644938a..76114247821a 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/CHANGELOG.md +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/CHANGELOG.md @@ -72,8 +72,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -104,4 +104,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/README.md b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/README.md index 9662c31ac952..ea1d7ffe53d7 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/README.md +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/subscription/Azure.ResourceManager.Subscription/CHANGELOG.md b/sdk/subscription/Azure.ResourceManager.Subscription/CHANGELOG.md index 1857cf7fc775..eb8f838316e1 100644 --- a/sdk/subscription/Azure.ResourceManager.Subscription/CHANGELOG.md +++ b/sdk/subscription/Azure.ResourceManager.Subscription/CHANGELOG.md @@ -79,4 +79,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/subscription/Azure.ResourceManager.Subscription/README.md b/sdk/subscription/Azure.ResourceManager.Subscription/README.md index 9ca10fc783e6..6c04256c0bbb 100644 --- a/sdk/subscription/Azure.ResourceManager.Subscription/README.md +++ b/sdk/subscription/Azure.ResourceManager.Subscription/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/support/Azure.ResourceManager.Support/CHANGELOG.md b/sdk/support/Azure.ResourceManager.Support/CHANGELOG.md index a606168966b7..51458518331c 100644 --- a/sdk/support/Azure.ResourceManager.Support/CHANGELOG.md +++ b/sdk/support/Azure.ResourceManager.Support/CHANGELOG.md @@ -87,8 +87,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -120,4 +120,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/support/Azure.ResourceManager.Support/README.md b/sdk/support/Azure.ResourceManager.Support/README.md index bb09059ac3b4..c0b9b5d201e1 100644 --- a/sdk/support/Azure.ResourceManager.Support/README.md +++ b/sdk/support/Azure.ResourceManager.Support/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md index aa627f12de2e..4877895a0959 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md +++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md @@ -23,7 +23,7 @@ dotnet add package Azure.Analytics.Synapse.AccessControl --prerelease ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Synapse, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account]https://azure.microsoft.com/account). -- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://docs.microsoft.com/cli/azure). +- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://learn.microsoft.com/cli/azure). If you use the Azure CLI, the command looks like below: diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md index 32768e1d7638..1a2bd0147573 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md @@ -23,7 +23,7 @@ dotnet add package Azure.Analytics.Synapse.Artifacts --prerelease ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Synapse, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://docs.microsoft.com/cli/azure). +- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://learn.microsoft.com/cli/azure). If you use the Azure CLI, the command looks like below: diff --git a/sdk/synapse/Azure.Analytics.Synapse.ManagedPrivateEndpoints/README.md b/sdk/synapse/Azure.Analytics.Synapse.ManagedPrivateEndpoints/README.md index 0b8b4ece4402..9df6b1e1be62 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.ManagedPrivateEndpoints/README.md +++ b/sdk/synapse/Azure.Analytics.Synapse.ManagedPrivateEndpoints/README.md @@ -25,7 +25,7 @@ dotnet add package Azure.Analytics.Synapse.ManagedPrivateEndpoints --prerelease ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Synapse, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://docs.microsoft.com/cli/azure). +- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://learn.microsoft.com/cli/azure). If you use the Azure CLI, the command looks like below: diff --git a/sdk/synapse/Azure.Analytics.Synapse.Monitoring/README.md b/sdk/synapse/Azure.Analytics.Synapse.Monitoring/README.md index 23e115295c51..a2eb6c87aeae 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Monitoring/README.md +++ b/sdk/synapse/Azure.Analytics.Synapse.Monitoring/README.md @@ -23,7 +23,7 @@ dotnet add package Azure.Analytics.Synapse.Monitoring --prerelease ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Synapse, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://docs.microsoft.com/cli/azure). +- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://learn.microsoft.com/cli/azure). If you use the Azure CLI, the command looks like below: diff --git a/sdk/synapse/Azure.Analytics.Synapse.Spark/README.md b/sdk/synapse/Azure.Analytics.Synapse.Spark/README.md index 1ca74f7e3baa..c6fcc504b186 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Spark/README.md +++ b/sdk/synapse/Azure.Analytics.Synapse.Spark/README.md @@ -25,7 +25,7 @@ dotnet add package Azure.Analytics.Synapse.Spark --prerelease ### Prerequisites - **Azure Subscription:** To use Azure services, including Azure Synapse, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial](https://azure.microsoft.com/free/dotnet/) or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://azure.microsoft.com/account). -- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://docs.microsoft.com/cli/azure). +- An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the [Azure Portal](https://portal.azure.com/) or [Azure CLI](https://learn.microsoft.com/cli/azure). If you use the Azure CLI, the command looks like below: diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/CHANGELOG.md b/sdk/synapse/Azure.ResourceManager.Synapse/CHANGELOG.md index c2a54a54ccd6..4e4c9b2cb584 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/CHANGELOG.md +++ b/sdk/synapse/Azure.ResourceManager.Synapse/CHANGELOG.md @@ -61,8 +61,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -94,4 +94,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/README.md b/sdk/synapse/Azure.ResourceManager.Synapse/README.md index d85bb0f131be..068597dead8f 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/README.md +++ b/sdk/synapse/Azure.ResourceManager.Synapse/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/tables/Azure.Data.Tables/CHANGELOG.md b/sdk/tables/Azure.Data.Tables/CHANGELOG.md index 08e33625c427..a7f7638829dc 100644 --- a/sdk/tables/Azure.Data.Tables/CHANGELOG.md +++ b/sdk/tables/Azure.Data.Tables/CHANGELOG.md @@ -11,6 +11,7 @@ ### Bugs Fixed ### Other Changes +- Improved the performance of `TableServiceClient.GetTableClient()` ## 12.9.1 (2024-09-17) diff --git a/sdk/tables/Azure.Data.Tables/README.md b/sdk/tables/Azure.Data.Tables/README.md index 764a40edaf9f..ae1e1c18bc13 100644 --- a/sdk/tables/Azure.Data.Tables/README.md +++ b/sdk/tables/Azure.Data.Tables/README.md @@ -288,14 +288,14 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -[tables_rest]: https://docs.microsoft.com/rest/api/storageservices/table-service-rest-api -[azure_cli]: https://docs.microsoft.com/cli/azure +[tables_rest]: https://learn.microsoft.com/rest/api/storageservices/table-service-rest-api +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [table_client_nuget_package]: https://www.nuget.org/packages?q=Azure.Data.Tables [table_client_samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/tables/Azure.Data.Tables/samples [table_client_src]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/tables/Azure.Data.Tables/src [table_change_log]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/tables/Azure.Data.Tables/CHANGELOG.md -[api_reference]: https://docs.microsoft.com/dotnet/api/overview/azure/data.tables-readme +[api_reference]: https://learn.microsoft.com/dotnet/api/overview/azure/data.tables-readme [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/tables/Azure.Data.Tables/samples/Sample1CreateDeleteTables.md b/sdk/tables/Azure.Data.Tables/samples/Sample1CreateDeleteTables.md index 1805b9591b60..591ad19aee11 100644 --- a/sdk/tables/Azure.Data.Tables/samples/Sample1CreateDeleteTables.md +++ b/sdk/tables/Azure.Data.Tables/samples/Sample1CreateDeleteTables.md @@ -36,7 +36,7 @@ var tableClient3 = new TableClient( ## Create a table -A table requires a [unique table name](https://docs.microsoft.com/rest/api/storageservices/understanding-the-table-service-data-model#table-names) +A table requires a [unique table name](https://learn.microsoft.com/rest/api/storageservices/understanding-the-table-service-data-model#table-names) ### Using `TableServiceClient` diff --git a/sdk/tables/Azure.Data.Tables/src/TableClient.cs b/sdk/tables/Azure.Data.Tables/src/TableClient.cs index 8b2346e1727c..4bae886964b6 100644 --- a/sdk/tables/Azure.Data.Tables/src/TableClient.cs +++ b/sdk/tables/Azure.Data.Tables/src/TableClient.cs @@ -234,7 +234,7 @@ public TableClient(string connectionString, string tableName, TableClientOptions _version = options.VersionString; _diagnostics = new ClientDiagnostics(options); _tableOperations = new TableRestClient(_diagnostics, _pipeline, _endpoint.AbsoluteUri, _version); - _batchOperations = new TableRestClient(_diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion); + _batchOperations = new TableRestClient(_diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion); Name = tableName; Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri(); } @@ -286,7 +286,7 @@ public TableClient(Uri endpoint, string tableName, TokenCredential tokenCredenti _version = options.VersionString; _diagnostics = new ClientDiagnostics(options); _tableOperations = new TableRestClient(_diagnostics, _pipeline, _endpoint.AbsoluteUri, _version); - _batchOperations = new TableRestClient(_diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion); + _batchOperations = new TableRestClient(_diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion); Name = tableName; Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri(); } @@ -337,7 +337,7 @@ null when string.IsNullOrWhiteSpace(_endpoint.Query) => policy, _version = options.VersionString; _diagnostics = new ClientDiagnostics(options); _tableOperations = new TableRestClient(_diagnostics, _pipeline, _endpoint.AbsoluteUri, _version); - _batchOperations = new TableRestClient(_diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion); + _batchOperations = new TableRestClient(_diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion); Name = tableName; Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri(); } @@ -363,7 +363,7 @@ internal TableClient( { _tableOperations = tableOperations; } - _batchOperations = new TableRestClient(diagnostics, CreateBatchPipeline(), _tableOperations.endpoint, _tableOperations.clientVersion); + _batchOperations = new TableRestClient(diagnostics, _batchPipeline, _tableOperations.endpoint, _tableOperations.clientVersion); _version = version; Name = table; Uri = new TableUriBuilder(_endpoint) { Query = null, Sas = null, Tablename = Name }.ToUri(); @@ -1743,6 +1743,8 @@ private HttpMessage CreateUpdateOrMergeRequest(TableRestClient batchOperations, return msg; } + private static readonly HttpPipeline _batchPipeline = CreateBatchPipeline(); + /// /// Creates a pipeline to use for processing sub-operations before they are combined into a single multipart request. /// diff --git a/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md b/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md index c966c6919d0a..f4c9425f72a9 100644 --- a/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md +++ b/sdk/tables/Microsoft.Azure.WebJobs.Extensions.Tables/README.md @@ -79,7 +79,7 @@ When using user-assigned manageed identity the `clientId` and `credential` setti #### Using shared key credential -When using [shared key authentication](https://docs.microsoft.com/rest/api/storageservices/authorize-with-shared-key) the `endpoint`, `accountKey` and `accountName` need to be provided. +When using [shared key authentication](https://learn.microsoft.com/rest/api/storageservices/authorize-with-shared-key) the `endpoint`, `accountKey` and `accountName` need to be provided. `__endpoint` = `https://...table.core.windows.net` @@ -91,13 +91,13 @@ When using [shared key authentication](https://docs.microsoft.com/rest/api/stora The input binding allows you to read table as input to an Azure Function. The output binding allows you to modify and delete table rows in an Azure Function. -Please follow the [input binding tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-table-input?tabs=csharp) and [output binding tutorial](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-table-output?tabs=csharp) to learn about using this extension for accessing table service. +Please follow the [input binding tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-table-input?tabs=csharp) and [output binding tutorial](https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-table-output?tabs=csharp) to learn about using this extension for accessing table service. ## Examples Tables extensions provides only bindings. Bindings by themselves can't trigger a function. It can only read or write entries to the table. -In the following example we use [HTTP trigger](https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp) to invoke the function. +In the following example we use [HTTP trigger](https://learn.microsoft.com/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp) to invoke the function. ### Binding to a single entity @@ -275,11 +275,11 @@ public class BindTableClient ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -300,20 +300,20 @@ additional questions or comments. [nuget]: https://www.nuget.org/ -[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview -[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell -[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_docs]: https://learn.microsoft.com/azure/storage/common/storage-account-overview +[storage_account_create_ps]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell +[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[cosmos_tables_account_docs]: https://docs.microsoft.com/azure/cosmos-db/table/introduction -[cosmos_tables_create_ps]: https://docs.microsoft.com/azure/cosmos-db/scripts/powershell/table/create -[cosmos_tables_create_cli]: https://docs.microsoft.com/azure/cosmos-db/scripts/cli/table/create -[cosmos_tables_create_portal]: https://docs.microsoft.com/azure/cosmos-db/table/how-to-create-container +[cosmos_tables_account_docs]: https://learn.microsoft.com/azure/cosmos-db/table/introduction +[cosmos_tables_create_ps]: https://learn.microsoft.com/azure/cosmos-db/scripts/powershell/table/create +[cosmos_tables_create_cli]: https://learn.microsoft.com/azure/cosmos-db/scripts/cli/table/create +[cosmos_tables_create_portal]: https://learn.microsoft.com/azure/cosmos-db/table/how-to-create-container [identity_dac]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential -[appsettings_portal]: https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal -[local_settings_json]: https://docs.microsoft.com/azure/azure-functions/functions-host-json#override-hostjson-values +[appsettings_portal]: https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal +[local_settings_json]: https://learn.microsoft.com/azure/azure-functions/functions-host-json#override-hostjson-values [azure_sub]: https://azure.microsoft.com/free/dotnet/ [RequestFailedException]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core/src/RequestFailedException.cs diff --git a/sdk/template/.content/packageResource/README.md b/sdk/template/.content/packageResource/README.md index 8e498ba4dc70..098ecd77cb54 100644 --- a/sdk/template/.content/packageResource/README.md +++ b/sdk/template/.content/packageResource/README.md @@ -2,10 +2,10 @@ This section should give out brief introduction of the client library. -* First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://docs.microsoft.com/azure/cosmos-db/)). +* First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://learn.microsoft.com/azure/cosmos-db/)). * Next, add a **bulleted list** of the **most common tasks** supported by the package or library, prefaced with "Use the client library for [Product Name] to:". Then, provide code snippets for these tasks in the [Examples](#examples) section later in the document. Keep the task list short but include those tasks most developers need to perform with your package. - [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Template) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Template) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://learn.microsoft.com/azure) ## Getting started @@ -25,7 +25,7 @@ dotnet add package Azure.Template --prerelease 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`. +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://learn.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://learn.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 @@ -85,7 +85,7 @@ If the package or a related package supports it, include tips for logging or ena 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-msft]: https://learn.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/template/Azure.Template/README.png) \ No newline at end of file diff --git a/sdk/template/.content/samples/README.md b/sdk/template/.content/samples/README.md index ec5edcbf0252..d595c1c31d71 100644 --- a/sdk/template/.content/samples/README.md +++ b/sdk/template/.content/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure name: Azure.Template samples for .NET description: Samples for the Azure.Template client library. diff --git a/sdk/template/Azure.Template/README.md b/sdk/template/Azure.Template/README.md index 0122323fb117..784c8bfe3d9a 100644 --- a/sdk/template/Azure.Template/README.md +++ b/sdk/template/Azure.Template/README.md @@ -4,11 +4,11 @@ Azure Template is a managed service that helps developers get secret simply and Use the client library for to: -* [Get secret](https://docs.microsoft.com/azure) +* [Get secret](https://learn.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/template/Azure.Template/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) + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://learn.microsoft.com/azure) ## Getting started @@ -28,7 +28,7 @@ dotnet add package Azure.Template --prerelease 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`. +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://learn.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://learn.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 @@ -96,7 +96,7 @@ If the package or a related package supports it, include tips for logging or ena 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-msft]: https://learn.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/template/Azure.Template/README.png) diff --git a/sdk/template/Azure.Template/samples/README.md b/sdk/template/Azure.Template/samples/README.md index 1abc2a8ecae7..667a980ae07d 100644 --- a/sdk/template/Azure.Template/samples/README.md +++ b/sdk/template/Azure.Template/samples/README.md @@ -3,7 +3,7 @@ page_type: sample languages: - csharp products: -# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product - azure - microsoft-defender name: Azure.Template samples for .NET diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md b/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md index 36417db621cc..bff597427166 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md +++ b/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md @@ -24,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/README.md b/sdk/terraform/Azure.ResourceManager.Terraform/README.md index 7eae62f4da19..556ede749e22 100644 --- a/sdk/terraform/Azure.ResourceManager.Terraform/README.md +++ b/sdk/terraform/Azure.ResourceManager.Terraform/README.md @@ -38,7 +38,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md b/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md index 7795b7421d00..b99adc89c790 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/CHANGELOG.md @@ -375,7 +375,7 @@ This is the first version of the client library that targets the Azure Cognitive ## 5.1.0-beta.3 (2020-11-19) ### New Features -- Added `HealthcareOperation` long running operation for new asynchronous `Text Analytics for health` hosted API with support for batch processing. Note this is a currently in a gated preview where AAD is not supported. More information [here](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview). +- Added `HealthcareOperation` long running operation for new asynchronous `Text Analytics for health` hosted API with support for batch processing. Note this is a currently in a gated preview where AAD is not supported. More information [here](https://learn.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview). - Added `AnalyzeOperation` long running operation for new asynchronous `Analyze API` to support batch processing of Named entity recognition, Personally Identifiable Information and Key phrase extraction. - Both new features listed above are available in `West US2`, `East US2`, `Central US`, `North Europe` and `West Europe` regions and in Standard tier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md index 0cd8a34798b5..564f677cae3f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/README.md +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/README.md @@ -791,7 +791,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [textanalytics_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/src -[language_service_docs]: https://docs.microsoft.com/azure/cognitive-services/language-service/ +[language_service_docs]: https://learn.microsoft.com/azure/cognitive-services/language-service/ [textanalytics_refdocs]: https://aka.ms/azsdk-net-textanalytics-ref-docs [textanalytics_nuget_package]: https://www.nuget.org/packages/Azure.AI.TextAnalytics [textanalytics_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/samples/README.md @@ -802,21 +802,21 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [analyze_sentiment_opinion_mining_sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample2.1_AnalyzeSentimentWithOpinionMining.md [mock_client_sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample_MockClient.md -[healthcare]: https://docs.microsoft.com/azure/cognitive-services/language-service/text-analytics-for-health/overview?tabs=ner -[language_detection]: https://docs.microsoft.com/azure/cognitive-services/language-service/language-detection/overview -[sentiment_analysis]: https://docs.microsoft.com/azure/cognitive-services/language-service/sentiment-opinion-mining/overview -[key_phrase_extraction]: https://docs.microsoft.com/azure/cognitive-services/language-service/key-phrase-extraction/overview -[named_entity_recognition]: https://docs.microsoft.com/azure/cognitive-services/language-service/named-entity-recognition/overview -[entity_linking]: https://docs.microsoft.com/azure/cognitive-services/language-service/entity-linking/overview -[named_entities_categories]: https://docs.microsoft.com/azure/cognitive-services/language-service/named-entity-recognition/concepts/named-entity-categories -[pii_entity]:https://docs.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/overview +[healthcare]: https://learn.microsoft.com/azure/cognitive-services/language-service/text-analytics-for-health/overview?tabs=ner +[language_detection]: https://learn.microsoft.com/azure/cognitive-services/language-service/language-detection/overview +[sentiment_analysis]: https://learn.microsoft.com/azure/cognitive-services/language-service/sentiment-opinion-mining/overview +[key_phrase_extraction]: https://learn.microsoft.com/azure/cognitive-services/language-service/key-phrase-extraction/overview +[named_entity_recognition]: https://learn.microsoft.com/azure/cognitive-services/language-service/named-entity-recognition/overview +[entity_linking]: https://learn.microsoft.com/azure/cognitive-services/language-service/entity-linking/overview +[named_entities_categories]: https://learn.microsoft.com/azure/cognitive-services/language-service/named-entity-recognition/concepts/named-entity-categories +[pii_entity]:https://learn.microsoft.com/azure/cognitive-services/language-service/personally-identifiable-information/overview [textanalytics_client_class]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs [azure_identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity -[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication -[register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[aad_grant_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[cognitive_auth]: https://learn.microsoft.com/azure/cognitive-services/authentication +[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[aad_grant_access]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [data_limits]: https://aka.ms/azsdk/textanalytics/data-limits @@ -835,7 +835,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [extractive_summarize_sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample11_ExtractiveSummarize.md [abstractive_summarize_sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/textanalytics/Azure.AI.TextAnalytics/samples/Sample12_AbstractiveSummarize.md -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [service_access]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [create_ta_resource_azure_portal]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account diff --git a/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/README.md b/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/README.md index 4ee61b0c12c6..6f6df7bf7b16 100644 --- a/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/README.md +++ b/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/README.md @@ -148,20 +148,20 @@ For more information see the Code of Conduct FAQ or contact opencode@microsoft.c [microsoft_sdk_download]: https://azure.microsoft.com/downloads/?sdk=net [azure_sdk_target_frameworks]: https://github.com/azure/azure-sdk-for-net#target-frameworks -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [package]: https://www.nuget.org/packages/Azure.IoT.TimeSeriesInsights [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ [nuget]: https://www.nuget.org/ [azure_portal]: https://portal.azure.com/ -[azure_rest_api]: https://docs.microsoft.com/rest/api/azure/ +[azure_rest_api]: https://learn.microsoft.com/rest/api/azure/ [azure_core_library]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/core/Azure.Core -[token_credential]: https://docs.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet -[azure_cli]: https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest +[token_credential]: https://learn.microsoft.com/dotnet/api/azure.core.tokencredential?view=azure-dotnet +[azure_cli]: https://learn.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest [iot_cli_extension]: https://github.com/Azure/azure-iot-cli-extension/releases -[iot_cli_doc]: https://docs.microsoft.com/cli/azure/ext/azure-iot/dt?view=azure-cli-latest -[http_status_code]: https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1 +[iot_cli_doc]: https://learn.microsoft.com/cli/azure/ext/azure-iot/dt?view=azure-cli-latest +[http_status_code]: https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-3.1 [tsi_nuget]: https://www.nuget.org/packages/Azure.IoT.TimeSeriesInsights [tsi_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/src -[tsi_product_documentation]: https://docs.microsoft.com/azure/time-series-insights/ +[tsi_product_documentation]: https://learn.microsoft.com/azure/time-series-insights/ [tsi_samples]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/samples/Readme.md diff --git a/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/samples/Readme.md b/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/samples/Readme.md index 69b9e9e7d608..310652820bb5 100644 --- a/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/samples/Readme.md +++ b/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/samples/Readme.md @@ -687,8 +687,8 @@ await foreach (TimeSeriesPoint point in query.GetResultsAsync()) [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md -[tsi_instances_learn_more]: https://docs.microsoft.com/azure/time-series-insights/concepts-model-overview#time-series-model-instances -[tsi_id_learn_more]: https://docs.microsoft.com/azure/time-series-insights/how-to-select-tsid -[tsi_hierarchies_learn_more]: https://docs.microsoft.com/azure/time-series-insights/concepts-model-overview#time-series-model-hierarchies -[tsi_numeric_variables]: https://docs.microsoft.com/azure/time-series-insights/concepts-variables#numeric-variables -[tsi_aggregate_variables]: https://docs.microsoft.com/azure/time-series-insights/concepts-variables#aggregate-variables +[tsi_instances_learn_more]: https://learn.microsoft.com/azure/time-series-insights/concepts-model-overview#time-series-model-instances +[tsi_id_learn_more]: https://learn.microsoft.com/azure/time-series-insights/how-to-select-tsid +[tsi_hierarchies_learn_more]: https://learn.microsoft.com/azure/time-series-insights/concepts-model-overview#time-series-model-hierarchies +[tsi_numeric_variables]: https://learn.microsoft.com/azure/time-series-insights/concepts-variables#numeric-variables +[tsi_aggregate_variables]: https://learn.microsoft.com/azure/time-series-insights/concepts-variables#aggregate-variables diff --git a/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/tests/prerequisites/prerequisite readme.md b/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/tests/prerequisites/prerequisite readme.md index 6d8c69bc3a8d..5a8d403ddf14 100644 --- a/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/tests/prerequisites/prerequisite readme.md +++ b/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/tests/prerequisites/prerequisite readme.md @@ -11,7 +11,7 @@ - If already installed, check latest version: - Run `az --version` to make sure `azure-cli` is at least **version 2.3.1** - If it isn't, update it -- Use this link to install [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) +- Use this link to install [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest]) ### Install Bicep diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/CHANGELOG.md b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/CHANGELOG.md index e45d49e7c4b8..4e8369d9ac4e 100644 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/CHANGELOG.md +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/CHANGELOG.md @@ -73,8 +73,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -106,4 +106,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/README.md b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/README.md index df72b8e03d24..69718eb81dfc 100644 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/README.md +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/translation/Azure.AI.Translation.Document/README.md b/sdk/translation/Azure.AI.Translation.Document/README.md index dececb8b7e2b..4d99499fbb68 100644 --- a/sdk/translation/Azure.AI.Translation.Document/README.md +++ b/sdk/translation/Azure.AI.Translation.Document/README.md @@ -492,20 +492,20 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [documenttranslation_client_src]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/translation/Azure.AI.Translation.Document/src -[documenttranslation_docs]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview +[documenttranslation_docs]: https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview [documenttranslation_refdocs]: https://aka.ms/azsdk/net/docs/documenttranslation [documenttranslation_nuget_package]: https://www.nuget.org/packages/Azure.AI.Translation.Document [documenttranslation_samples]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/translation/Azure.AI.Translation.Document/samples/README.md [documenttranslation_rest_api]: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/TranslatorText/stable/v1.0/TranslatorBatch.json [custom_domain_endpoint]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-rest-api?pivots=programming-language-csharp#what-is-the-custom-domain-endpoint -[single_service]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=singleservice%2Cwindows +[single_service]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=singleservice%2Cwindows [azure_portal_create_DT_resource]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation -[cognitive_resource_cli]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli +[cognitive_resource_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli [dotnet_lro]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt [source_containers]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-rest-api?pivots=programming-language-csharp#create-azure-blob-storage-containers -[custom_model]: https://docs.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model -[glossary]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats -[sas_token]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-your-sas-tokens-with-azure-storage-explorer +[custom_model]: https://learn.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model +[glossary]: https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats +[sas_token]: https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-your-sas-tokens-with-azure-storage-explorer [sas_token_permissions]: https://aka.ms/azsdk/documenttranslation/sas-permissions [azure_blob_storage_account]: https://ms.portal.azure.com/#create/Microsoft.StorageAccount [container]: https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-portal#create-a-container @@ -515,9 +515,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [azure_identity]: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/README.md [DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md#defaultazurecredential [register_aad_app]: https://learn.microsoft.com/azure/app-service/configure-authentication-provider-aad?tabs=workforce-tenant#--option-1-create-a-new-app-registration-automatically -[aad_grant_access]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain -[cognitive_auth]: https://docs.microsoft.com/azure/cognitive-services/authentication +[aad_grant_access]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[cognitive_auth]: https://learn.microsoft.com/azure/cognitive-services/authentication [logging]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md [contributing]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md @@ -528,7 +528,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [using_storage_sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationWithAzureBlob.cs [start_translation_with_sourceInput_sample]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationWithSourceInput.cs -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [nuget]: https://www.nuget.org/ [azure_portal]: https://portal.azure.com diff --git a/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml b/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml index 13d9aee63f0f..d24a8e80f9e1 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml +++ b/sdk/translation/Azure.AI.Translation.Document/tsp-location.yaml @@ -1,3 +1,3 @@ directory: specification/translation/Azure.AI.DocumentTranslation -commit: 533d972b32b91774f13e5b56190ab6573760ee85 +commit: a3920ed4082bec9544ac1ae75fc8abba363be7d0 repo: Azure/azure-rest-api-specs diff --git a/sdk/translation/Azure.AI.Translation.Text/samples/Sample0_CreateClient.md b/sdk/translation/Azure.AI.Translation.Text/samples/Sample0_CreateClient.md index 11b34f78994d..83840cb4feaa 100644 --- a/sdk/translation/Azure.AI.Translation.Text/samples/Sample0_CreateClient.md +++ b/sdk/translation/Azure.AI.Translation.Text/samples/Sample0_CreateClient.md @@ -61,9 +61,9 @@ TextTranslationClient client = new(credential); [translator_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/translation/Azure.AI.Translation.Text/src/Custom/TextTranslationClient.cs [translator_vnet]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-reference#virtual-network-support -[custom_subdomain]: https://docs.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain +[custom_subdomain]: https://learn.microsoft.com/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain [translator_token]: https://learn.microsoft.com/azure/cognitive-services/translator/reference/v3-0-reference#authenticating-with-an-access-token [cognitive_resource_azure_portal]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [cognitive_resource_azure_cli]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [service_access]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account diff --git a/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/CHANGELOG.md b/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/CHANGELOG.md index 8a187ebdf378..37586ebacd59 100644 --- a/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/CHANGELOG.md +++ b/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/CHANGELOG.md @@ -26,4 +26,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/README.md b/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/README.md index e07cc3d8bed8..118181446905 100644 --- a/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/README.md +++ b/sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/README.md @@ -44,7 +44,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md b/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md index a6c766461159..5b460179ce2a 100644 --- a/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md +++ b/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/README.md @@ -213,7 +213,7 @@ additional questions or comments. -[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/dotnet/ [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ @@ -222,7 +222,7 @@ additional questions or comments. [package]: https://aka.ms/ava/sdk/client/net [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/videoanalyzer/Azure.Media.VideoAnalyzer.Edge/src [samples]: https://go.microsoft.com/fwlink/?linkid=2162276 -[doc_product]: https://docs.microsoft.com/azure/azure-video-analyzer/video-analyzer-docs/ +[doc_product]: https://learn.microsoft.com/azure/azure-video-analyzer/video-analyzer-docs/ [iot-device-sdk]: https://www.nuget.org/packages/Microsoft.Azure.Devices.Client/ [iot-hub-sdk]: https://www.nuget.org/packages/Microsoft.Azure.Devices/ [github-page-issues]: https://github.com/Azure/azure-sdk-for-net/issues diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/CHANGELOG.md b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/CHANGELOG.md index dd0fa3c84d2f..9d519bc2d814 100644 --- a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/CHANGELOG.md +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/CHANGELOG.md @@ -55,4 +55,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/README.md b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/README.md index 20bdab94f316..cf23f988d1d5 100644 --- a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/README.md +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/README.md @@ -42,7 +42,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/webpubsub/Azure.Messaging.WebPubSub/CHANGELOG.md b/sdk/webpubsub/Azure.Messaging.WebPubSub/CHANGELOG.md index 2c9855e12ec0..35296451bdb9 100644 --- a/sdk/webpubsub/Azure.Messaging.WebPubSub/CHANGELOG.md +++ b/sdk/webpubsub/Azure.Messaging.WebPubSub/CHANGELOG.md @@ -56,7 +56,7 @@ ## 1.0.0-beta.3 (2021-09-07) ### Features Added -- Support for [Azure Active Directory](https://docs.microsoft.com/azure/active-directory/authentication/) based authentication. Users can specify a [`TokenCredential`](https://docs.microsoft.com/dotnet/api/azure.core.tokencredential) when creating a `WebPubSubServiceClient`. For example, you can get started with `new WebPubSubServiceClient(endpoint, hub, new DefaultAzureCredential())` to authenticate via AAD using [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). +- Support for [Azure Active Directory](https://learn.microsoft.com/azure/active-directory/authentication/) based authentication. Users can specify a [`TokenCredential`](https://learn.microsoft.com/dotnet/api/azure.core.tokencredential) when creating a `WebPubSubServiceClient`. For example, you can get started with `new WebPubSubServiceClient(endpoint, hub, new DefaultAzureCredential())` to authenticate via AAD using [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## 1.0.0-beta.2 (2021-07-16) diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/CHANGELOG.md b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/CHANGELOG.md index 9e4c933ac499..c27f269a440b 100644 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/CHANGELOG.md +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/CHANGELOG.md @@ -70,8 +70,8 @@ Polishing since last public beta release: - Corrected the format of all `ETag` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. - Corrected the format of all binary type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -144,4 +144,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/README.md b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/README.md index 83d690faad8b..5fffb757a145 100644 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/README.md +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md index e3eeb84f8d5e..197a81370b55 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md @@ -4,7 +4,7 @@ This extension provides functionality for receiving Web PubSub webhook calls in [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src) | [Package](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub) | -[API reference documentation](https://docs.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.webpubsub) | +[API reference documentation](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.webpubsub) | [Product documentation](https://aka.ms/awps/doc) | [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples) @@ -20,7 +20,7 @@ dotnet add package Microsoft.Azure.WebJobs.Extensions.WebPubSub ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a Web PubSub resource. Follow this [step-by-step tutorial](https://docs.microsoft.com/azure/azure-web-pubsub/howto-develop-create-instance) to create an Azure Web PubSub instance. +You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and an Azure resource group with a Web PubSub resource. Follow this [step-by-step tutorial](https://learn.microsoft.com/azure/azure-web-pubsub/howto-develop-create-instance) to create an Azure Web PubSub instance. ### Authenticate the client @@ -28,7 +28,7 @@ In order to let the extension work with Azure Web PubSub service, you will need You can find the **Keys** for you Azure Web PubSub service in the [Azure Portal](https://portal.azure.com/). -The `AzureWebJobsStorage` connection string is used to preserve the processing checkpoint information as required refer to [Storage considerations](https://docs.microsoft.com/azure/azure-functions/storage-considerations#storage-account-requirements) +The `AzureWebJobsStorage` connection string is used to preserve the processing checkpoint information as required refer to [Storage considerations](https://learn.microsoft.com/azure/azure-functions/storage-considerations#storage-account-requirements) For the local development use the `local.settings.json` file to store the connection string, `` can be set to `WebPubSubConnectionString` as default supported in the extension, or you can set customized names by mapping it with `Connection = ` in function binding attributes: @@ -40,7 +40,7 @@ For the local development use the `local.settings.json` file to store the connec } } ``` -When deployed use the [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. +When deployed use the [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. ## Key concepts @@ -147,11 +147,11 @@ public static WebPubSubEventResponse Run( ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -173,7 +173,7 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub +[docs]: https://learn.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md index 5ff99db13b3c..60d9150213eb 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md @@ -28,7 +28,7 @@ In order to let the extension work with Web PubSub for Socket.IO, you will need #### Access key based configuration -The `AzureWebJobsStorage` connection string is used to preserve the processing checkpoint information as required refer to [Storage considerations](https://docs.microsoft.com/azure/azure-functions/storage-considerations#storage-account-requirements) +The `AzureWebJobsStorage` connection string is used to preserve the processing checkpoint information as required refer to [Storage considerations](https://learn.microsoft.com/azure/azure-functions/storage-considerations#storage-account-requirements) You can find the **Keys** for you Azure Web PubSub service in the [Azure Portal](https://portal.azure.com/). @@ -43,7 +43,7 @@ For the local development, use the `local.settings.json` file to store the conne } ``` -When deployed use the [application settings](https://docs.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. +When deployed use the [application settings](https://learn.microsoft.com/azure/azure-functions/functions-how-to-use-azure-function-app-settings) to set the connection string. #### Identity based configuration @@ -177,11 +177,11 @@ public static class SocketIOTriggerReturnValueFunction ## Troubleshooting -Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. +Please refer to [Monitor Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. ## Next steps -Read the [introduction to Azure Function](https://docs.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function). +Read the [introduction to Azure Function](https://learn.microsoft.com/azure/azure-functions/functions-overview) or [creating an Azure Function guide](https://learn.microsoft.com/azure/azure-functions/functions-create-first-azure-function). ## Contributing @@ -203,7 +203,7 @@ additional questions or comments. [source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src [package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO +[docs]: https://learn.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md index e04e25df3755..eee20f7df22a 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/README.md @@ -87,11 +87,11 @@ public void Configure(IApplicationBuilder app) ## Key concepts -For information about general Web PubSub concepts [Concepts in Azure Web PubSub](https://docs.microsoft.com/azure/azure-web-pubsub/key-concepts) +For information about general Web PubSub concepts [Concepts in Azure Web PubSub](https://learn.microsoft.com/azure/azure-web-pubsub/key-concepts) ### `WebPubSubHub` -`WebPubSubHub` is an abstract class to let users implement the subscribed Web PubSub service events. After user register the [event handler](https://docs.microsoft.com/azure/azure-web-pubsub/howto-develop-eventhandler) in service side, these events will be forwarded from service to server. And `WebPubSubHub` provides methods mapping to the service events to enable users deal with these events, for example, client management, validations or working with `Azure.Messaging.WebPubSub` to broadcast the messages. See samples below for details. +`WebPubSubHub` is an abstract class to let users implement the subscribed Web PubSub service events. After user register the [event handler](https://learn.microsoft.com/azure/azure-web-pubsub/howto-develop-eventhandler) in service side, these events will be forwarded from service to server. And `WebPubSubHub` provides methods mapping to the service events to enable users deal with these events, for example, client management, validations or working with `Azure.Messaging.WebPubSub` to broadcast the messages. See samples below for details. > NOTE > diff --git a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md index 8cbca54df7bb..93427928c114 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md +++ b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- fix the issue of data type mismatch in the AsyncPageable return values. Issue at 'https://github.com/Azure/azure-sdk-for-net/issues/47267 + ### Other Changes ## 1.3.0 (2024-11-19) @@ -172,8 +174,8 @@ Polishing since last public beta release: - Prepended `AppService` prefix to all single / simple model names. - Corrected the format of all `ResourceIdentifier` type properties / parameters. - Corrected the format of all `AzureLocation` type properties / parameters. -- Corrected all acronyms that not follow [.Net Naming Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). -- Corrected enumeration name by following [Naming Enumerations Rule](https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). +- Corrected all acronyms that not follow [.Net Naming Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/naming-guidelines). +- Corrected enumeration name by following [Naming Enumerations Rule](https://learn.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations). - Corrected the suffix of `DateTimeOffset` properties / parameters. - Corrected the name of interval / duration properties / parameters that end with units. - Optimized the name of some models and functions. @@ -343,4 +345,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/websites/Azure.ResourceManager.AppService/README.md b/sdk/websites/Azure.ResourceManager.AppService/README.md index 32f96f141997..ac1ef227d614 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/README.md +++ b/sdk/websites/Azure.ResourceManager.AppService/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.net8.0.cs b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.net8.0.cs index cc2a00c4e5fe..3937356b7eb0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.net8.0.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.net8.0.cs @@ -773,10 +773,14 @@ protected AppServicePlanHybridConnectionNamespaceRelayResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAllWebAppsByHybridConnection(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllWebAppsByHybridConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHybridConnectionKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridConnectionKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Pageable GetWebAppsByHybridConnection(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.AsyncPageable GetWebAppsByHybridConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppService.HybridConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs index cc2a00c4e5fe..3937356b7eb0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs @@ -773,10 +773,14 @@ protected AppServicePlanHybridConnectionNamespaceRelayResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAllWebAppsByHybridConnection(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllWebAppsByHybridConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHybridConnectionKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridConnectionKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Pageable GetWebAppsByHybridConnection(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.AsyncPageable GetWebAppsByHybridConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppService.HybridConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/AppServicePlanHybridConnectionNamespaceRelayResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/AppServicePlanHybridConnectionNamespaceRelayResource.cs new file mode 100644 index 000000000000..9ece7347f466 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/AppServicePlanHybridConnectionNamespaceRelayResource.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing an AppServicePlanHybridConnectionNamespaceRelay along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAppServicePlanHybridConnectionNamespaceRelayResource method. + /// Otherwise you can get one from its parent resource using the GetAppServicePlanHybridConnectionNamespaceRelay method. + /// + public partial class AppServicePlanHybridConnectionNamespaceRelayResource + { + /// + /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites + /// + /// + /// Operation Id + /// AppServicePlans_ListWebAppsByHybridConnection + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual AsyncPageable GetWebAppsByHybridConnectionAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => WebSiteData.DeserializeWebSiteData(e).ToString(), _appServicePlanHybridConnectionNamespaceRelayAppServicePlansClientDiagnostics, Pipeline, "AppServicePlanHybridConnectionNamespaceRelayResource.GetAllWebAppsByHybridConnection", "value", "nextLink", cancellationToken); + } + + /// + /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites + /// + /// + /// Operation Id + /// AppServicePlans_ListWebAppsByHybridConnection + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual Pageable GetWebAppsByHybridConnection(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => WebSiteData.DeserializeWebSiteData(e).ToString(), _appServicePlanHybridConnectionNamespaceRelayAppServicePlansClientDiagnostics, Pipeline, "AppServicePlanHybridConnectionNamespaceRelayResource.GetAllWebAppsByHybridConnection", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanHybridConnectionNamespaceRelayResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanHybridConnectionNamespaceRelayResource.cs index bd4d796e9843..f83e5c6710ca 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanHybridConnectionNamespaceRelayResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanHybridConnectionNamespaceRelayResource.cs @@ -357,12 +357,12 @@ public virtual Response GetHybridConnectionKeys(Cancellatio /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetWebAppsByHybridConnectionAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllWebAppsByHybridConnectionAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => e.GetString(), _appServicePlanHybridConnectionNamespaceRelayAppServicePlansClientDiagnostics, Pipeline, "AppServicePlanHybridConnectionNamespaceRelayResource.GetWebAppsByHybridConnection", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => WebSiteData.DeserializeWebSiteData(e), _appServicePlanHybridConnectionNamespaceRelayAppServicePlansClientDiagnostics, Pipeline, "AppServicePlanHybridConnectionNamespaceRelayResource.GetAllWebAppsByHybridConnection", "value", "nextLink", cancellationToken); } /// @@ -387,12 +387,12 @@ public virtual AsyncPageable GetWebAppsByHybridConnectionAsync(Cancellat /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetWebAppsByHybridConnection(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllWebAppsByHybridConnection(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appServicePlanHybridConnectionNamespaceRelayAppServicePlansRestClient.CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => e.GetString(), _appServicePlanHybridConnectionNamespaceRelayAppServicePlansClientDiagnostics, Pipeline, "AppServicePlanHybridConnectionNamespaceRelayResource.GetWebAppsByHybridConnection", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => WebSiteData.DeserializeWebSiteData(e), _appServicePlanHybridConnectionNamespaceRelayAppServicePlansClientDiagnostics, Pipeline, "AppServicePlanHybridConnectionNamespaceRelayResource.GetAllWebAppsByHybridConnection", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanResourceListResult.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanResourceListResult.Serialization.cs deleted file mode 100644 index ca97a9c574c8..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanResourceListResult.Serialization.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.AppService.Models -{ - internal partial class AppServicePlanResourceListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AppServicePlanResourceListResult)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - AppServicePlanResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AppServicePlanResourceListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAppServicePlanResourceListResult(document.RootElement, options); - } - - internal static AppServicePlanResourceListResult DeserializeAppServicePlanResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AppServicePlanResourceListResult(value, nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AppServicePlanResourceListResult)} does not support writing '{options.Format}' format."); - } - } - - AppServicePlanResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAppServicePlanResourceListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AppServicePlanResourceListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/AppServicePlansRestOperations.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/AppServicePlansRestOperations.cs index 12b000e14e07..ad162112bbe5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/AppServicePlansRestOperations.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/AppServicePlansRestOperations.cs @@ -1070,7 +1070,7 @@ internal HttpMessage CreateListWebAppsByHybridConnectionRequest(string subscript /// The cancellation token to use. /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListWebAppsByHybridConnectionAsync(string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + public async Task> ListWebAppsByHybridConnectionAsync(string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -1084,9 +1084,9 @@ public async Task> ListWebAppsByHybri { case 200: { - AppServicePlanResourceListResult value = default; + WebAppListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanResourceListResult.DeserializeAppServicePlanResourceListResult(document.RootElement); + value = WebAppListResult.DeserializeWebAppListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1103,7 +1103,7 @@ public async Task> ListWebAppsByHybri /// The cancellation token to use. /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListWebAppsByHybridConnection(string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + public Response ListWebAppsByHybridConnection(string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -1117,9 +1117,9 @@ public Response ListWebAppsByHybridConnection( { case 200: { - AppServicePlanResourceListResult value = default; + WebAppListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanResourceListResult.DeserializeAppServicePlanResourceListResult(document.RootElement); + value = WebAppListResult.DeserializeWebAppListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -2899,7 +2899,7 @@ internal HttpMessage CreateListWebAppsByHybridConnectionNextPageRequest(string n /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListWebAppsByHybridConnectionNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + public async Task> ListWebAppsByHybridConnectionNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -2914,9 +2914,9 @@ public async Task> ListWebAppsByHybri { case 200: { - AppServicePlanResourceListResult value = default; + WebAppListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanResourceListResult.DeserializeAppServicePlanResourceListResult(document.RootElement); + value = WebAppListResult.DeserializeWebAppListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -2934,7 +2934,7 @@ public async Task> ListWebAppsByHybri /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListWebAppsByHybridConnectionNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + public Response ListWebAppsByHybridConnectionNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -2949,9 +2949,9 @@ public Response ListWebAppsByHybridConnectionN { case 200: { - AppServicePlanResourceListResult value = default; + WebAppListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanResourceListResult.DeserializeAppServicePlanResourceListResult(document.RootElement); + value = WebAppListResult.DeserializeWebAppListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md index fccebe53abfc..2b565f0efe4c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md +++ b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md @@ -24,7 +24,7 @@ deserialize-null-collection-as-null-value: true use-model-reader-writer: true enable-bicep-serialization: true -#mgmt-debug: +#mgmt-debug: # show-serialized-names: true list-exception: @@ -107,6 +107,7 @@ override-operation-name: StaticSites_UpdateStaticSiteUser: UpdateUser CheckNameAvailability: CheckAppServiceNameAvailability AppServicePlans_ListHybridConnections: GetHybridConnectionRelays + AppServicePlans_ListWebAppsByHybridConnection: GetAllWebAppsByHybridConnection StaticSites_CreateOrUpdateStaticSiteBuildAppSettings: CreateOrUpdateAppSettings StaticSites_CreateOrUpdateStaticSiteBuildFunctionAppSettings: CreateOrUpdateFunctionAppSettings StaticSites_ListStaticSiteBuildFunctions: GetFunctions @@ -981,6 +982,11 @@ directive: where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'].get transform: > $['responses']['200']['schema']['$ref'] = "./AppServicePlans.json#/definitions/HybridConnectionCollection"; + # Fix https://github.com/Azure/azure-sdk-for-net/issues/47267, fix the issue of data type mismatch in the AsyncPageable return values. + - from: AppServicePlans.json + where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'].get + transform: > + $['responses']['200']['schema']['$ref'] = "./CommonDefinitions.json#/definitions/WebAppCollection"; # The Enum name "StorageType" is shared by artifactsStorageType, cause the apicompat error - from: CommonDefinitions.json where: $.definitions.FunctionsDeployment.properties.storage.properties.type @@ -1012,7 +1018,7 @@ directive: "$ref": "#/definitions/DayOfWeek", "description": "The days of the week." }; - # Fix https://github.com/Azure/azure-sdk-for-net/issues/39126, fix the `ProcessThreadInfo` definition based on the return result + # Fix https://github.com/Azure/azure-sdk-for-net/issues/39126, fix the `ProcessThreadInfo` definition based on the return result - from: WebApps.json where: $.definitions transform: > diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/CHANGELOG.md b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/CHANGELOG.md index 0baf5296d97b..ee3254656f2b 100644 --- a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/CHANGELOG.md +++ b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/CHANGELOG.md @@ -67,4 +67,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/README.md b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/README.md index 9acffaae70c5..09f1a8aa30cf 100644 --- a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/README.md +++ b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/README.md @@ -37,7 +37,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/CHANGELOG.md b/sdk/workloads/Azure.ResourceManager.Workloads/CHANGELOG.md index 23d447f55fa1..abe840440fd9 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/CHANGELOG.md +++ b/sdk/workloads/Azure.ResourceManager.Workloads/CHANGELOG.md @@ -95,4 +95,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/README.md b/sdk/workloads/Azure.ResourceManager.Workloads/README.md index 3edd8a2beb97..755bc10f9041 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/README.md +++ b/sdk/workloads/Azure.ResourceManager.Workloads/README.md @@ -39,7 +39,7 @@ Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azu Documentation is available to help you learn how to use this package: - [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). -- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). - [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). ## Examples